mirror of
https://bitbucket.org/myhomie/myhomie_app.git
synced 2025-12-06 09:01:20 +00:00
Merge branch 'master' of https://bitbucket.org/myhomie/myhomie_app
# Conflicts: # pubspec.lock
This commit is contained in:
commit
c4f2e29b9e
38
lib/Components/Buttons/rounded_button.dart
Normal file
38
lib/Components/Buttons/rounded_button.dart
Normal file
@ -0,0 +1,38 @@
|
|||||||
|
import 'package:flutter/material.dart';
|
||||||
|
import 'package:myhomie_app/constants.dart';
|
||||||
|
|
||||||
|
class RoundedButton extends StatelessWidget {
|
||||||
|
final String text;
|
||||||
|
final Function press;
|
||||||
|
final Color color, textColor;
|
||||||
|
final double fontSize;
|
||||||
|
|
||||||
|
const RoundedButton({
|
||||||
|
Key key,
|
||||||
|
this.text,
|
||||||
|
this.press,
|
||||||
|
this.color = kBodyTextColor, // TODO
|
||||||
|
this.textColor = Colors.white,
|
||||||
|
this.fontSize
|
||||||
|
}) : super(key: key);
|
||||||
|
|
||||||
|
@override
|
||||||
|
Widget build(BuildContext context) {
|
||||||
|
Size size = MediaQuery.of(context).size;
|
||||||
|
return FlatButton(
|
||||||
|
shape: RoundedRectangleBorder(
|
||||||
|
borderRadius: BorderRadius.circular(35.0),
|
||||||
|
//side: BorderSide(color: kSubTitleColor)
|
||||||
|
),
|
||||||
|
padding: EdgeInsets.symmetric(vertical: 8, horizontal: 25),
|
||||||
|
color: color,
|
||||||
|
onPressed: () => {
|
||||||
|
press()
|
||||||
|
},
|
||||||
|
child: Text(
|
||||||
|
text,
|
||||||
|
style: new TextStyle(color: textColor, fontSize: fontSize, fontWeight: FontWeight.w400),
|
||||||
|
),
|
||||||
|
);
|
||||||
|
}
|
||||||
|
}
|
||||||
46
lib/Components/rounded_input_field.dart
Normal file
46
lib/Components/rounded_input_field.dart
Normal file
@ -0,0 +1,46 @@
|
|||||||
|
import 'package:flutter/material.dart';
|
||||||
|
import 'package:myhomie_app/Components/text_field_container.dart';
|
||||||
|
import 'package:myhomie_app/constants.dart';
|
||||||
|
|
||||||
|
class RoundedInputField extends StatelessWidget {
|
||||||
|
final String hintText;
|
||||||
|
final IconData icon;
|
||||||
|
final ValueChanged<String> onChanged;
|
||||||
|
final String initialValue;
|
||||||
|
final Color color, textColor, iconColor;
|
||||||
|
final int maxLength;
|
||||||
|
const RoundedInputField({
|
||||||
|
Key key,
|
||||||
|
this.hintText,
|
||||||
|
this.initialValue,
|
||||||
|
this.icon,
|
||||||
|
this.color = kTitleTextColor, // TODO
|
||||||
|
this.textColor = kBodyTextColor, // TODO
|
||||||
|
this.iconColor = kTitleTextColor, // TODO
|
||||||
|
this.onChanged,
|
||||||
|
this.maxLength, // 50
|
||||||
|
}) : super(key: key);
|
||||||
|
|
||||||
|
@override
|
||||||
|
Widget build(BuildContext context) {
|
||||||
|
return TextFieldContainer(
|
||||||
|
color: color,
|
||||||
|
child: TextFormField (
|
||||||
|
onChanged: onChanged,
|
||||||
|
initialValue: initialValue,
|
||||||
|
cursorColor: textColor,
|
||||||
|
maxLength: maxLength,
|
||||||
|
style: TextStyle(fontSize: 20, color: textColor),
|
||||||
|
decoration: InputDecoration(
|
||||||
|
icon: icon != null ? Icon(
|
||||||
|
icon,
|
||||||
|
color: iconColor,
|
||||||
|
): null,
|
||||||
|
hintText: hintText,
|
||||||
|
hintStyle: TextStyle(fontSize: 20.0, color: textColor),
|
||||||
|
border: InputBorder.none,
|
||||||
|
)
|
||||||
|
),
|
||||||
|
);
|
||||||
|
}
|
||||||
|
}
|
||||||
34
lib/Components/rounded_password_field.dart
Normal file
34
lib/Components/rounded_password_field.dart
Normal file
@ -0,0 +1,34 @@
|
|||||||
|
import 'package:flutter/material.dart';
|
||||||
|
import 'package:myhomie_app/Components/text_field_container.dart';
|
||||||
|
import 'package:myhomie_app/constants.dart';
|
||||||
|
|
||||||
|
class RoundedPasswordField extends StatelessWidget {
|
||||||
|
final ValueChanged<String> onChanged;
|
||||||
|
const RoundedPasswordField({
|
||||||
|
Key key,
|
||||||
|
this.onChanged,
|
||||||
|
}) : super(key: key);
|
||||||
|
|
||||||
|
@override
|
||||||
|
Widget build(BuildContext context) {
|
||||||
|
return TextFieldContainer(
|
||||||
|
child: TextField(
|
||||||
|
obscureText: true,
|
||||||
|
onChanged: onChanged,
|
||||||
|
cursorColor: kBodyTextColor, // TODO
|
||||||
|
decoration: InputDecoration(
|
||||||
|
hintText: "Password",
|
||||||
|
icon: Icon(
|
||||||
|
Icons.lock,
|
||||||
|
color: kBodyTextColor, // TODO
|
||||||
|
),
|
||||||
|
suffixIcon: Icon(
|
||||||
|
Icons.visibility,
|
||||||
|
color: kBodyTextColor, // TODO
|
||||||
|
),
|
||||||
|
border: InputBorder.none,
|
||||||
|
),
|
||||||
|
),
|
||||||
|
);
|
||||||
|
}
|
||||||
|
}
|
||||||
27
lib/Components/text_field_container.dart
Normal file
27
lib/Components/text_field_container.dart
Normal file
@ -0,0 +1,27 @@
|
|||||||
|
import 'package:flutter/material.dart';
|
||||||
|
import 'package:myhomie_app/constants.dart';
|
||||||
|
|
||||||
|
class TextFieldContainer extends StatelessWidget {
|
||||||
|
final Widget child;
|
||||||
|
final Color color;
|
||||||
|
const TextFieldContainer({
|
||||||
|
Key key,
|
||||||
|
this.child,
|
||||||
|
this.color = kBackgroundColor, // TODO
|
||||||
|
}) : super(key: key);
|
||||||
|
|
||||||
|
@override
|
||||||
|
Widget build(BuildContext context) {
|
||||||
|
Size size = MediaQuery.of(context).size;
|
||||||
|
return Container(
|
||||||
|
margin: EdgeInsets.symmetric(vertical: 10),
|
||||||
|
padding: EdgeInsets.symmetric(horizontal: 20, vertical: 5),
|
||||||
|
width: size.width * 0.8,
|
||||||
|
decoration: BoxDecoration(
|
||||||
|
color: color,
|
||||||
|
borderRadius: BorderRadius.circular(29),
|
||||||
|
),
|
||||||
|
child: child,
|
||||||
|
);
|
||||||
|
}
|
||||||
|
}
|
||||||
107
lib/Helpers/DatabaseHelper.dart
Normal file
107
lib/Helpers/DatabaseHelper.dart
Normal file
@ -0,0 +1,107 @@
|
|||||||
|
import 'dart:convert';
|
||||||
|
|
||||||
|
import 'package:myhomie_app/Models/homieContext.dart';
|
||||||
|
import 'package:path/path.dart';
|
||||||
|
import 'package:sqflite/sqflite.dart';
|
||||||
|
|
||||||
|
class DatabaseHelper {
|
||||||
|
static final _databaseName = "homie_database.db";
|
||||||
|
static final _databaseVersion = 1;
|
||||||
|
|
||||||
|
static final table = 'homieAppContext';
|
||||||
|
|
||||||
|
static final columnId = 'id';
|
||||||
|
static final columnUserId = 'deviceId';
|
||||||
|
static final columnHomeId = 'homeId';
|
||||||
|
static final columnToken = 'token';
|
||||||
|
static final columnHost = 'host';
|
||||||
|
static final columnLanguage = 'language';
|
||||||
|
|
||||||
|
DatabaseHelper._privateConstructor();
|
||||||
|
static final DatabaseHelper instance = DatabaseHelper._privateConstructor();
|
||||||
|
|
||||||
|
static Database _database;
|
||||||
|
Future<Database> get database async {
|
||||||
|
if (_database != null) return _database;
|
||||||
|
_database = await _initDatabase();
|
||||||
|
return _database;
|
||||||
|
}
|
||||||
|
|
||||||
|
_initDatabase() async {
|
||||||
|
String path = join(await getDatabasesPath(), _databaseName);
|
||||||
|
return await openDatabase(path,
|
||||||
|
version: _databaseVersion, onCreate: _onCreate);
|
||||||
|
}
|
||||||
|
|
||||||
|
// SQL code to create the database table
|
||||||
|
Future _onCreate(Database db, int version) async {
|
||||||
|
await db.execute('''
|
||||||
|
CREATE TABLE $table (
|
||||||
|
$columnId TEXT NOT NULL PRIMARY KEY,
|
||||||
|
$columnUserId TEXT NOT NULL,
|
||||||
|
$columnToken TEXT NOT NULL,
|
||||||
|
$columnHomeId TEXT NOT NULL,
|
||||||
|
$columnHost TEXT NOT NULL,
|
||||||
|
$columnLanguage TEXT NOT NULL
|
||||||
|
)
|
||||||
|
''');
|
||||||
|
}
|
||||||
|
|
||||||
|
Future<int> insert(HomieAppContext tabletAppContext) async {
|
||||||
|
Database db = await instance.database;
|
||||||
|
|
||||||
|
var res = await db.insert(table, tabletAppContext.toMap());
|
||||||
|
return res;
|
||||||
|
}
|
||||||
|
|
||||||
|
Future<void> update(HomieAppContext tabletAppContext) async {
|
||||||
|
// Get a reference to the database.
|
||||||
|
final db = await instance.database;
|
||||||
|
|
||||||
|
await db.update(
|
||||||
|
'tabletAppContext',
|
||||||
|
tabletAppContext.toMap(),
|
||||||
|
where: "id = ?",
|
||||||
|
whereArgs: [tabletAppContext.id],
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
|
Future<List<Map<String, dynamic>>> queryAllRows() async {
|
||||||
|
Database db = await instance.database;
|
||||||
|
var res = await db.query(table, orderBy: "$columnId DESC");
|
||||||
|
return res;
|
||||||
|
}
|
||||||
|
|
||||||
|
Future<int> delete(String email) async {
|
||||||
|
Database db = await instance.database;
|
||||||
|
return await db.delete(table, where: '$columnId = ?', whereArgs: [email]);
|
||||||
|
}
|
||||||
|
|
||||||
|
Future<void> clearTable() async {
|
||||||
|
Database db = await instance.database;
|
||||||
|
return await db.rawQuery("DELETE FROM $table");
|
||||||
|
}
|
||||||
|
|
||||||
|
Future<HomieAppContext> getData() async {
|
||||||
|
HomieAppContext homieAppContext;
|
||||||
|
|
||||||
|
await DatabaseHelper.instance.queryAllRows().then((value) {
|
||||||
|
value.forEach((element) {
|
||||||
|
print("DB - CONTEXT --- ");
|
||||||
|
|
||||||
|
homieAppContext = HomieAppContext(
|
||||||
|
id: element["id"],
|
||||||
|
userId: element["userId"],
|
||||||
|
token: element["token"],
|
||||||
|
host: element["host"],
|
||||||
|
homeId: element["homeId"],
|
||||||
|
language: element["language"]
|
||||||
|
);
|
||||||
|
});
|
||||||
|
}).catchError((error) {
|
||||||
|
print(error);
|
||||||
|
});
|
||||||
|
|
||||||
|
return homieAppContext;
|
||||||
|
}
|
||||||
|
}
|
||||||
121
lib/Helpers/MQTTHelper.dart
Normal file
121
lib/Helpers/MQTTHelper.dart
Normal file
@ -0,0 +1,121 @@
|
|||||||
|
import 'dart:convert';
|
||||||
|
|
||||||
|
import 'package:fluttertoast/fluttertoast.dart';
|
||||||
|
import 'package:mqtt_client/mqtt_client.dart';
|
||||||
|
import 'package:mqtt_client/mqtt_server_client.dart';
|
||||||
|
import 'package:myhomie_app/Models/homieContext.dart';
|
||||||
|
|
||||||
|
|
||||||
|
class MQTTHelper {
|
||||||
|
MQTTHelper._privateConstructor();
|
||||||
|
bool isInstantiated = false;
|
||||||
|
static final MQTTHelper instance = MQTTHelper._privateConstructor();
|
||||||
|
String lastMessage;
|
||||||
|
|
||||||
|
void onConnected(dynamic appContext) {
|
||||||
|
print('Connected !!!!!!!!!!!! ----------------------------------');
|
||||||
|
HomieAppContext homieAppContext = appContext.getContext();
|
||||||
|
|
||||||
|
homieAppContext.clientMQTT.subscribe("#", MqttQos.atLeastOnce);
|
||||||
|
|
||||||
|
print(homieAppContext.clientMQTT);
|
||||||
|
|
||||||
|
homieAppContext.clientMQTT.updates.listen((List<MqttReceivedMessage<MqttMessage>> c) async {
|
||||||
|
print("IN Received message");
|
||||||
|
final MqttPublishMessage message = c[0].payload;
|
||||||
|
final payload = MqttPublishPayload.bytesToStringAsString(message.payload.message);
|
||||||
|
print('Received message:$payload from topic: ${c[0].topic}');
|
||||||
|
|
||||||
|
lastMessage = 'Received message:$payload from topic: ${c[0].topic}';
|
||||||
|
|
||||||
|
var topic = c[0].topic.split('/')[0];
|
||||||
|
|
||||||
|
switch(topic) {
|
||||||
|
case "config":
|
||||||
|
print('Get message in topic config = $payload');
|
||||||
|
break;
|
||||||
|
case "player":
|
||||||
|
print('Get message in topic player = $payload');
|
||||||
|
// refresh device info
|
||||||
|
try {
|
||||||
|
}
|
||||||
|
catch(e) {
|
||||||
|
print('Error = $e');
|
||||||
|
}
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
// unconnected
|
||||||
|
void onDisconnected() {
|
||||||
|
print('Disconnected');
|
||||||
|
}
|
||||||
|
|
||||||
|
// subscribe to topic succeeded
|
||||||
|
void onSubscribed(String topic) {
|
||||||
|
print('Subscribed topic: $topic');
|
||||||
|
}
|
||||||
|
|
||||||
|
// subscribe to topic failed
|
||||||
|
void onSubscribeFail(String topic) {
|
||||||
|
print('Failed to subscribe $topic');
|
||||||
|
}
|
||||||
|
|
||||||
|
// unsubscribe succeeded
|
||||||
|
void onUnsubscribed(String topic) {
|
||||||
|
print('Unsubscribed topic: $topic');
|
||||||
|
}
|
||||||
|
|
||||||
|
String getLastMessage() {
|
||||||
|
print("LAST MESSAAAGE");
|
||||||
|
print(lastMessage);
|
||||||
|
return lastMessage;
|
||||||
|
}
|
||||||
|
|
||||||
|
Future<MqttServerClient> connect(dynamic appContext) async {
|
||||||
|
HomieAppContext homieAppContext = appContext.getContext();
|
||||||
|
|
||||||
|
if (homieAppContext == null) {
|
||||||
|
homieAppContext = new HomieAppContext(host: '192.168.31.140', userId: 'TODO');
|
||||||
|
} // TO DEBUG
|
||||||
|
|
||||||
|
if(homieAppContext.host != null) {
|
||||||
|
homieAppContext.clientMQTT = MqttServerClient.withPort(homieAppContext.host.replaceAll('http://', ''), 'homie_app_'+homieAppContext.userId, 1883);
|
||||||
|
isInstantiated = true;
|
||||||
|
|
||||||
|
homieAppContext.clientMQTT.logging(on: false);
|
||||||
|
homieAppContext.clientMQTT.keepAlivePeriod = 20;
|
||||||
|
homieAppContext.clientMQTT.onDisconnected = onDisconnected;
|
||||||
|
homieAppContext.clientMQTT.onConnected = () => onConnected(appContext);
|
||||||
|
homieAppContext.clientMQTT.onSubscribed = onSubscribed;
|
||||||
|
|
||||||
|
var message = {
|
||||||
|
"userId": homieAppContext.userId,
|
||||||
|
"connected": false
|
||||||
|
};
|
||||||
|
|
||||||
|
final connMessage = MqttConnectMessage().authenticateAs('user', 'user') // TODO ONLINE
|
||||||
|
.keepAliveFor(60)
|
||||||
|
.withWillTopic('player/status')
|
||||||
|
.withWillMessage(jsonEncode(message))
|
||||||
|
.withClientIdentifier('tablet_app_'+homieAppContext.userId)
|
||||||
|
.startClean()
|
||||||
|
.withWillQos(MqttQos.atLeastOnce);
|
||||||
|
|
||||||
|
homieAppContext.clientMQTT.connectionMessage = connMessage;
|
||||||
|
homieAppContext.clientMQTT.autoReconnect = true;
|
||||||
|
try {
|
||||||
|
await homieAppContext.clientMQTT.connect();
|
||||||
|
|
||||||
|
} catch (e) {
|
||||||
|
print('Exception: $e');
|
||||||
|
homieAppContext.clientMQTT.disconnect();
|
||||||
|
}
|
||||||
|
appContext.setContext(homieAppContext); // TODO CLEAN
|
||||||
|
|
||||||
|
return homieAppContext.clientMQTT;
|
||||||
|
}
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
}
|
||||||
48
lib/Models/homieContext.dart
Normal file
48
lib/Models/homieContext.dart
Normal file
@ -0,0 +1,48 @@
|
|||||||
|
import 'package:flutter/material.dart';
|
||||||
|
import 'package:mqtt_client/mqtt_server_client.dart';
|
||||||
|
import 'dart:convert';
|
||||||
|
|
||||||
|
import 'package:myhomie_app/client.dart';
|
||||||
|
|
||||||
|
|
||||||
|
class HomieAppContext with ChangeNotifier{
|
||||||
|
Client clientAPI;
|
||||||
|
MqttServerClient clientMQTT;
|
||||||
|
String id;
|
||||||
|
String host;
|
||||||
|
String language;
|
||||||
|
String userId;
|
||||||
|
String homeId;
|
||||||
|
String token;
|
||||||
|
|
||||||
|
|
||||||
|
HomieAppContext({this.id, this.userId, this.homeId, this.host, this.language, this.token});
|
||||||
|
|
||||||
|
Map<String, dynamic> toMap() {
|
||||||
|
return {
|
||||||
|
'id': id,
|
||||||
|
'userId': userId,
|
||||||
|
'homeId': homeId,
|
||||||
|
'host': host,
|
||||||
|
'language': language,
|
||||||
|
'token': token,
|
||||||
|
};
|
||||||
|
}
|
||||||
|
|
||||||
|
factory HomieAppContext.fromJson(Map<String, dynamic> json) {
|
||||||
|
return new HomieAppContext(
|
||||||
|
id: json['id'] as String,
|
||||||
|
userId: json['userId'] as String,
|
||||||
|
host: json['host'] as String,
|
||||||
|
homeId: json['homeId'] as String,
|
||||||
|
language: json['language'] as String,
|
||||||
|
token: json['token'] as String
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
|
// Implement toString to make it easier to see information about
|
||||||
|
@override
|
||||||
|
String toString() {
|
||||||
|
return 'TabletAppContext{id: $id, userId: $userId, homeId: $homeId, language: $language, host: $host}';
|
||||||
|
}
|
||||||
|
}
|
||||||
47
lib/Screens/Debug/DebugPage.dart
Normal file
47
lib/Screens/Debug/DebugPage.dart
Normal file
@ -0,0 +1,47 @@
|
|||||||
|
import 'package:flutter/material.dart';
|
||||||
|
import 'package:myhomie_app/Helpers/MQTTHelper.dart';
|
||||||
|
import 'package:myhomie_app/app_context.dart';
|
||||||
|
import 'package:provider/provider.dart';
|
||||||
|
|
||||||
|
class DebugPage extends StatefulWidget {
|
||||||
|
DebugPage({Key key}) : super(key: key);
|
||||||
|
|
||||||
|
@override
|
||||||
|
_DebugPageState createState() => _DebugPageState();
|
||||||
|
}
|
||||||
|
|
||||||
|
class _DebugPageState extends State<DebugPage> {
|
||||||
|
|
||||||
|
@override
|
||||||
|
Widget build(BuildContext context) {
|
||||||
|
final appContext = Provider.of<AppContext>(context);
|
||||||
|
String lastMessage = "test";
|
||||||
|
|
||||||
|
//lastMessage = MQTTHelper.instance.getLastMessage() == null ? "rien" : MQTTHelper.instance.getLastMessage();
|
||||||
|
|
||||||
|
return Scaffold(
|
||||||
|
appBar: AppBar(
|
||||||
|
title: Text("Debug TODO"),
|
||||||
|
),
|
||||||
|
body: Center(
|
||||||
|
child: Column(
|
||||||
|
mainAxisAlignment: MainAxisAlignment.center,
|
||||||
|
children: <Widget>[
|
||||||
|
Text(
|
||||||
|
"Last Message",
|
||||||
|
),
|
||||||
|
Text(
|
||||||
|
MQTTHelper.instance.getLastMessage() == null ? "rien" : MQTTHelper.instance.getLastMessage(),
|
||||||
|
style: Theme.of(context).textTheme.headline4,
|
||||||
|
),
|
||||||
|
],
|
||||||
|
),
|
||||||
|
),
|
||||||
|
floatingActionButton: FloatingActionButton(
|
||||||
|
onPressed: () => {},
|
||||||
|
tooltip: 'Increment',
|
||||||
|
child: Icon(Icons.add),
|
||||||
|
),
|
||||||
|
);
|
||||||
|
}
|
||||||
|
}
|
||||||
155
lib/Screens/Home/HomePage.dart
Normal file
155
lib/Screens/Home/HomePage.dart
Normal file
@ -0,0 +1,155 @@
|
|||||||
|
import 'package:flutter/material.dart';
|
||||||
|
import 'package:flutter/rendering.dart';
|
||||||
|
import 'package:flutter/services.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/Helpers/MQTTHelper.dart';
|
||||||
|
import 'package:myhomie_app/Screens/Debug/DebugPage.dart';
|
||||||
|
import 'package:myhomie_app/app_context.dart';
|
||||||
|
import 'package:myhomie_app/client.dart';
|
||||||
|
import 'package:provider/provider.dart';
|
||||||
|
|
||||||
|
class HomePage extends StatefulWidget {
|
||||||
|
HomePage({Key key}) : super(key: key);
|
||||||
|
|
||||||
|
@override
|
||||||
|
_HomePageState createState() => _HomePageState();
|
||||||
|
}
|
||||||
|
|
||||||
|
class _HomePageState extends State<HomePage> {
|
||||||
|
int _counter = 0;
|
||||||
|
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
|
||||||
|
|
||||||
|
void _incrementCounter() {
|
||||||
|
setState(() {
|
||||||
|
_counter++;
|
||||||
|
|
||||||
|
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);
|
||||||
|
}
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
// connection succeeded
|
||||||
|
void onConnected() {
|
||||||
|
print('Connected !!!!!!!!!!!! ----------------------------------');
|
||||||
|
|
||||||
|
client.updates.listen((List<MqttReceivedMessage<MqttMessage>> c) {
|
||||||
|
final MqttPublishMessage message = c[0].payload;
|
||||||
|
final payload = MqttPublishPayload.bytesToStringAsString(message.payload.message);
|
||||||
|
print('Received message:$payload from topic: ${c[0].topic}>');
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
// unconnected
|
||||||
|
void onDisconnected() {
|
||||||
|
print('Disconnected');
|
||||||
|
}
|
||||||
|
|
||||||
|
// subscribe to topic succeeded
|
||||||
|
void onSubscribed(String topic) {
|
||||||
|
print('Subscribed topic: $topic');
|
||||||
|
}
|
||||||
|
|
||||||
|
// subscribe to topic failed
|
||||||
|
void onSubscribeFail(String topic) {
|
||||||
|
print('Failed to subscribe $topic');
|
||||||
|
}
|
||||||
|
|
||||||
|
// unsubscribe succeeded
|
||||||
|
void onUnsubscribed(String topic) {
|
||||||
|
print('Unsubscribed topic: $topic');
|
||||||
|
}
|
||||||
|
|
||||||
|
Future<MqttServerClient> connect() async {
|
||||||
|
client.logging(on: false);
|
||||||
|
client.keepAlivePeriod = 20;
|
||||||
|
client.onDisconnected = onDisconnected;
|
||||||
|
client.onConnected = onConnected;
|
||||||
|
client.onSubscribed = onSubscribed;
|
||||||
|
|
||||||
|
/// Security context
|
||||||
|
/*SecurityContext context = new SecurityContext()
|
||||||
|
..useCertificateChain('path/to/my_cert.pem')
|
||||||
|
..usePrivateKey('path/to/my_key.pem', password: 'key_password')
|
||||||
|
..setClientAuthorities('path/to/client.crt', password: 'password');*/
|
||||||
|
//client.setProtocolV31();
|
||||||
|
//client.secure = true;
|
||||||
|
//client.securityContext = context;
|
||||||
|
|
||||||
|
final connMessage = MqttConnectMessage()
|
||||||
|
.authenticateAs('thomas', 'MyCore,1') // TODO ONLINE
|
||||||
|
/*.keepAliveFor(60)
|
||||||
|
.withWillTopic('willtopic')
|
||||||
|
.withWillMessage('Will message')*/
|
||||||
|
.withClientIdentifier("TESSST")
|
||||||
|
.startClean();
|
||||||
|
//.withWillQos(MqttQos.atLeastOnce);
|
||||||
|
//client.secure = true;
|
||||||
|
client.connectionMessage = connMessage;
|
||||||
|
client.autoReconnect = true;
|
||||||
|
try {
|
||||||
|
await client.connect();
|
||||||
|
} catch (e) {
|
||||||
|
print('Exception: $e');
|
||||||
|
client.disconnect();
|
||||||
|
}
|
||||||
|
|
||||||
|
client.subscribe("#", MqttQos.atLeastOnce);
|
||||||
|
|
||||||
|
return client;
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
|
||||||
|
@override
|
||||||
|
Widget build(BuildContext context) {
|
||||||
|
final appContext = Provider.of<AppContext>(context);
|
||||||
|
|
||||||
|
if (!MQTTHelper.instance.isInstantiated)
|
||||||
|
{
|
||||||
|
print("MQTT NOT INSTANTIATED");
|
||||||
|
MQTTHelper.instance.connect(appContext);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
return Scaffold(
|
||||||
|
appBar: AppBar(
|
||||||
|
title: Text("HomePage TODO"),
|
||||||
|
),
|
||||||
|
body: Center(
|
||||||
|
child: Column(
|
||||||
|
mainAxisAlignment: MainAxisAlignment.center,
|
||||||
|
children: <Widget>[
|
||||||
|
Text(
|
||||||
|
'You have pushed the button this many times:',
|
||||||
|
),
|
||||||
|
Text(
|
||||||
|
'$_counter',
|
||||||
|
style: Theme.of(context).textTheme.headline4,
|
||||||
|
),
|
||||||
|
],
|
||||||
|
),
|
||||||
|
),
|
||||||
|
floatingActionButton: FloatingActionButton(
|
||||||
|
onPressed: () => {
|
||||||
|
Navigator.push(
|
||||||
|
context,
|
||||||
|
MaterialPageRoute(
|
||||||
|
builder: (context) {
|
||||||
|
return DebugPage();
|
||||||
|
},
|
||||||
|
)
|
||||||
|
)
|
||||||
|
},
|
||||||
|
tooltip: 'Increment',
|
||||||
|
child: Icon(Icons.add),
|
||||||
|
),
|
||||||
|
);
|
||||||
|
}
|
||||||
|
}
|
||||||
40
lib/Screens/Login/components/background.dart
Normal file
40
lib/Screens/Login/components/background.dart
Normal file
@ -0,0 +1,40 @@
|
|||||||
|
import 'package:flutter/material.dart';
|
||||||
|
|
||||||
|
class Background extends StatelessWidget {
|
||||||
|
final Widget child;
|
||||||
|
const Background({
|
||||||
|
Key key,
|
||||||
|
@required this.child,
|
||||||
|
}) : super(key: key);
|
||||||
|
|
||||||
|
@override
|
||||||
|
Widget build(BuildContext context) {
|
||||||
|
Size size = MediaQuery.of(context).size;
|
||||||
|
return Container(
|
||||||
|
width: double.infinity,
|
||||||
|
height: size.height,
|
||||||
|
child: Stack(
|
||||||
|
alignment: Alignment.center,
|
||||||
|
children: <Widget>[
|
||||||
|
/*Positioned(
|
||||||
|
top: 0,
|
||||||
|
left: 0,
|
||||||
|
child: Image.asset(
|
||||||
|
"assets/images/main_top.png",
|
||||||
|
width: size.width * 0.35,
|
||||||
|
),
|
||||||
|
),*/
|
||||||
|
/*Positioned(
|
||||||
|
bottom: 0,
|
||||||
|
right: 0,
|
||||||
|
child: Image.asset(
|
||||||
|
"assets/images/login_bottom.png",
|
||||||
|
width: size.width * 0.4,
|
||||||
|
),
|
||||||
|
),*/
|
||||||
|
child,
|
||||||
|
],
|
||||||
|
),
|
||||||
|
);
|
||||||
|
}
|
||||||
|
}
|
||||||
188
lib/Screens/Login/components/body.dart
Normal file
188
lib/Screens/Login/components/body.dart
Normal file
@ -0,0 +1,188 @@
|
|||||||
|
import 'package:flutter/material.dart';
|
||||||
|
import 'package:mqtt_client/mqtt_server_client.dart';
|
||||||
|
import 'package:mycoreapi/api.dart';
|
||||||
|
import 'package:myhomie_app/Components/Buttons/rounded_button.dart';
|
||||||
|
import 'package:myhomie_app/Components/rounded_input_field.dart';
|
||||||
|
import 'package:myhomie_app/Components/rounded_password_field.dart';
|
||||||
|
import 'package:myhomie_app/Models/homieContext.dart';
|
||||||
|
import 'package:myhomie_app/Screens/Home/HomePage.dart';
|
||||||
|
import 'package:myhomie_app/Screens/Login/components/background.dart';
|
||||||
|
import 'package:myhomie_app/app_context.dart';
|
||||||
|
import 'package:myhomie_app/client.dart';
|
||||||
|
import 'package:provider/provider.dart';
|
||||||
|
|
||||||
|
|
||||||
|
class Body extends StatefulWidget {
|
||||||
|
const Body({
|
||||||
|
Key key,
|
||||||
|
}) : super(key: key);
|
||||||
|
|
||||||
|
@override
|
||||||
|
State<Body> createState() => _BodyState();
|
||||||
|
}
|
||||||
|
|
||||||
|
class _BodyState extends State<Body> {
|
||||||
|
final clientAPI = Client('http://192.168.31.140'); // TODO field
|
||||||
|
|
||||||
|
@override
|
||||||
|
Widget build(BuildContext context) {
|
||||||
|
final appContext = Provider.of<AppContext>(context);
|
||||||
|
Size size = MediaQuery.of(context).size;
|
||||||
|
return Background(
|
||||||
|
child: SingleChildScrollView(
|
||||||
|
child: Column(
|
||||||
|
mainAxisAlignment: MainAxisAlignment.center,
|
||||||
|
children: <Widget>[
|
||||||
|
Text(
|
||||||
|
"LOGIN",
|
||||||
|
style: TextStyle(fontWeight: FontWeight.bold),
|
||||||
|
),
|
||||||
|
SizedBox(height: size.height * 0.03),
|
||||||
|
/*SvgPicture.asset(
|
||||||
|
"assets/icons/login.svg",
|
||||||
|
height: size.height * 0.35,
|
||||||
|
),*/
|
||||||
|
SizedBox(height: size.height * 0.03),
|
||||||
|
RoundedInputField(
|
||||||
|
hintText: "Your Email",
|
||||||
|
onChanged: (value) {},
|
||||||
|
),
|
||||||
|
RoundedPasswordField(
|
||||||
|
onChanged: (value) {},
|
||||||
|
),
|
||||||
|
RoundedButton(
|
||||||
|
text: "LOGIN",
|
||||||
|
press: () async {
|
||||||
|
// TODO check login etc
|
||||||
|
var connected = await authenticateTRY();
|
||||||
|
if (connected) {
|
||||||
|
HomieAppContext homieAppContext = new HomieAppContext();
|
||||||
|
homieAppContext.host = "http://192.168.31.140";// TODO
|
||||||
|
homieAppContext.clientMQTT = new MqttServerClient(homieAppContext.host.replaceAll('http://', ''),'tablet_app_'+'TODODODO');
|
||||||
|
// homieAppContext.clientAPI = client; // TODO
|
||||||
|
homieAppContext.userId = "TODO"; // TODO
|
||||||
|
|
||||||
|
setState(() {
|
||||||
|
appContext.setContext(homieAppContext);
|
||||||
|
});
|
||||||
|
|
||||||
|
Navigator.pushAndRemoveUntil(
|
||||||
|
context,
|
||||||
|
MaterialPageRoute(
|
||||||
|
builder: (context) {
|
||||||
|
return HomePage();
|
||||||
|
},
|
||||||
|
),
|
||||||
|
(Route<dynamic> route) => false
|
||||||
|
);
|
||||||
|
}
|
||||||
|
},
|
||||||
|
),
|
||||||
|
SizedBox(height: size.height * 0.03),
|
||||||
|
// TODO
|
||||||
|
/*AlreadyHaveAnAccountCheck(
|
||||||
|
press: () {
|
||||||
|
Navigator.push(
|
||||||
|
context,
|
||||||
|
MaterialPageRoute(
|
||||||
|
builder: (context) {
|
||||||
|
//return SignUpScreen();
|
||||||
|
// TODODODO
|
||||||
|
},
|
||||||
|
),
|
||||||
|
);
|
||||||
|
},
|
||||||
|
),*/
|
||||||
|
],
|
||||||
|
),
|
||||||
|
),
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
|
Future<bool> authenticateTRY() async {
|
||||||
|
print("try auth.. ");
|
||||||
|
|
||||||
|
// if () {} // Add if token exist and not null + not expired
|
||||||
|
var isConnected = false;
|
||||||
|
try {
|
||||||
|
//LoginDTO loginDTO = new LoginDTO(email: "test@email.be", password: "kljqsdkljqsd");
|
||||||
|
LoginDTO loginDTO = new LoginDTO(email: "", password: "");
|
||||||
|
TokenDTO token = await clientAPI.authenticationApi.authenticationAuthenticateWithJson(loginDTO);
|
||||||
|
print("Token ??");
|
||||||
|
print(token);
|
||||||
|
print(token.accessToken);
|
||||||
|
setAccessToken(token.accessToken);
|
||||||
|
isConnected = true; // TODO update context + db
|
||||||
|
}
|
||||||
|
catch (e) {
|
||||||
|
print("error auth");
|
||||||
|
}
|
||||||
|
|
||||||
|
return isConnected;
|
||||||
|
|
||||||
|
/*if (!isError) {
|
||||||
|
UserInfoDetailDTO user = await clientAPI.userApi.userGet("6182c472e20a6dbcfe8fe82c");
|
||||||
|
print("user values ??");
|
||||||
|
print(user.email);
|
||||||
|
print(user.id);
|
||||||
|
|
||||||
|
List<HomeDTO> homes = await clientAPI.homeApi.homeGetAll(user.id);
|
||||||
|
print("number of homes " + homes.length.toString());
|
||||||
|
homes.forEach((element) {
|
||||||
|
print(element);
|
||||||
|
});
|
||||||
|
|
||||||
|
HomeDTO home = homes[0]; // TODO
|
||||||
|
|
||||||
|
List<RoomSummaryDTO> rooms = await clientAPI.roomApi.roomGetAll(home.id);
|
||||||
|
print("number of rooms " + rooms.length.toString());
|
||||||
|
rooms.forEach((element) {
|
||||||
|
print(element);
|
||||||
|
});
|
||||||
|
|
||||||
|
List<ProviderDTO> providers = await clientAPI.providerApi.providerGetAll(home.id);
|
||||||
|
print("number of providers " + providers.length.toString());
|
||||||
|
providers.forEach((element) {
|
||||||
|
print(element);
|
||||||
|
});
|
||||||
|
|
||||||
|
List<DeviceSummaryDTO> devices = await clientAPI.deviceApi.deviceGetAll(home.id);
|
||||||
|
print("number of devices " + devices.length.toString());
|
||||||
|
/*devices.forEach((element) {
|
||||||
|
print(element);
|
||||||
|
});*/
|
||||||
|
|
||||||
|
List<AlarmModeDTO> alarms = await clientAPI.alarmApi.alarmGetAll(home.id);
|
||||||
|
print("number of alarms " + alarms.length.toString());
|
||||||
|
alarms.forEach((element) {
|
||||||
|
print(element);
|
||||||
|
});
|
||||||
|
|
||||||
|
/*List<EventDetailDTO> lastEvents = await clientAPI.eventApi.eventGet(home.id);
|
||||||
|
print("number of events " + lastEvents.length.toString());
|
||||||
|
lastEvents.forEach((element) {
|
||||||
|
print(element);
|
||||||
|
});*/
|
||||||
|
|
||||||
|
List<AutomationDTO> automations = await clientAPI.automationApi.automationGetAll(home.id);
|
||||||
|
print("number of automations " + automations.length.toString());
|
||||||
|
automations.forEach((element) {
|
||||||
|
print(element);
|
||||||
|
});
|
||||||
|
|
||||||
|
List<GroupSummaryDTO> groups = await clientAPI.groupApi.groupGetAll(home.id);
|
||||||
|
print("number of groups " + groups.length.toString());
|
||||||
|
groups.forEach((element) {
|
||||||
|
print(element);
|
||||||
|
});
|
||||||
|
}*/
|
||||||
|
}
|
||||||
|
|
||||||
|
void setAccessToken(String accessToken) {
|
||||||
|
clientAPI.apiApi.authentications.forEach((key, auth) {
|
||||||
|
if (auth is OAuth) {
|
||||||
|
auth.accessToken = accessToken;
|
||||||
|
}
|
||||||
|
});
|
||||||
|
}
|
||||||
|
}
|
||||||
11
lib/Screens/Login/login_screen.dart
Normal file
11
lib/Screens/Login/login_screen.dart
Normal file
@ -0,0 +1,11 @@
|
|||||||
|
import 'package:flutter/material.dart';
|
||||||
|
import 'package:myhomie_app/Screens/Login/components/body.dart';
|
||||||
|
|
||||||
|
class LoginScreen extends StatelessWidget {
|
||||||
|
@override
|
||||||
|
Widget build(BuildContext context) {
|
||||||
|
return Scaffold(
|
||||||
|
body: Body(),
|
||||||
|
);
|
||||||
|
}
|
||||||
|
}
|
||||||
18
lib/app_context.dart
Normal file
18
lib/app_context.dart
Normal file
@ -0,0 +1,18 @@
|
|||||||
|
import 'package:flutter/material.dart';
|
||||||
|
import 'package:myhomie_app/client.dart';
|
||||||
|
|
||||||
|
import 'Models/homieContext.dart';
|
||||||
|
|
||||||
|
class AppContext with ChangeNotifier {
|
||||||
|
HomieAppContext _homieContext;
|
||||||
|
Client clientAPI;
|
||||||
|
|
||||||
|
AppContext(this._homieContext);
|
||||||
|
|
||||||
|
getContext() => _homieContext;
|
||||||
|
setContext(HomieAppContext appContext) async {
|
||||||
|
_homieContext = appContext;
|
||||||
|
|
||||||
|
notifyListeners();
|
||||||
|
}
|
||||||
|
}
|
||||||
@ -14,6 +14,15 @@ class Client {
|
|||||||
UserApi _userApi;
|
UserApi _userApi;
|
||||||
UserApi get userApi => _userApi;
|
UserApi get userApi => _userApi;
|
||||||
|
|
||||||
|
HomeApi _homeApi;
|
||||||
|
HomeApi get homeApi => _homeApi;
|
||||||
|
|
||||||
|
AlarmApi _alarmApi;
|
||||||
|
AlarmApi get alarmApi => _alarmApi;
|
||||||
|
|
||||||
|
EventApi _eventApi;
|
||||||
|
EventApi get eventApi => _eventApi;
|
||||||
|
|
||||||
GroupApi _groupApi;
|
GroupApi _groupApi;
|
||||||
GroupApi get groupApi => _groupApi;
|
GroupApi get groupApi => _groupApi;
|
||||||
|
|
||||||
@ -29,13 +38,16 @@ class Client {
|
|||||||
RoomApi _roomApi;
|
RoomApi _roomApi;
|
||||||
RoomApi get roomApi => _roomApi;
|
RoomApi get roomApi => _roomApi;
|
||||||
|
|
||||||
Client() {
|
Client(String path) {
|
||||||
_apiClient = ApiClient(
|
_apiClient = ApiClient(
|
||||||
basePath: "http://192.168.31.140");
|
basePath: path);
|
||||||
//basePath: "http://localhost:25049");
|
//basePath: "http://localhost:25049");
|
||||||
_tokenApi = TokenApi(_apiClient);
|
_tokenApi = TokenApi(_apiClient);
|
||||||
_authenticationApi = AuthenticationApi(_apiClient);
|
_authenticationApi = AuthenticationApi(_apiClient);
|
||||||
_userApi = UserApi(_apiClient);
|
_userApi = UserApi(_apiClient);
|
||||||
|
_homeApi = HomeApi(_apiClient);
|
||||||
|
_alarmApi = AlarmApi(_apiClient);
|
||||||
|
_eventApi = EventApi(_apiClient);
|
||||||
_groupApi = GroupApi(_apiClient);
|
_groupApi = GroupApi(_apiClient);
|
||||||
_deviceApi = DeviceApi(_apiClient);
|
_deviceApi = DeviceApi(_apiClient);
|
||||||
_automationApi = AutomationApi(_apiClient);
|
_automationApi = AutomationApi(_apiClient);
|
||||||
|
|||||||
231
lib/main.dart
231
lib/main.dart
@ -1,19 +1,36 @@
|
|||||||
import 'package:flutter/material.dart';
|
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 'package:myhomie_app/client.dart';
|
||||||
|
import 'package:provider/provider.dart';
|
||||||
|
|
||||||
|
import 'Helpers/DatabaseHelper.dart';
|
||||||
|
import 'Models/homieContext.dart';
|
||||||
|
import 'Screens/Home/HomePage.dart';
|
||||||
|
import 'Screens/Login/login_screen.dart';
|
||||||
|
import 'app_context.dart';
|
||||||
import 'constants.dart';
|
import 'constants.dart';
|
||||||
|
|
||||||
void main() {
|
void main() async {
|
||||||
|
WidgetsFlutterBinding.ensureInitialized();
|
||||||
String initialRoute;
|
String initialRoute;
|
||||||
|
HomieAppContext localContext = new HomieAppContext();
|
||||||
|
bool isLogged = false;
|
||||||
|
|
||||||
initialRoute = '/home';
|
localContext = await DatabaseHelper.instance.getData();
|
||||||
|
|
||||||
|
if(localContext != null) {
|
||||||
|
print("we've got an local db !");
|
||||||
|
localContext.clientAPI = new Client(localContext.host); // TODO "http://192.168.31.140"
|
||||||
|
isLogged = localContext.token != null; // TODO refresh token..
|
||||||
|
print(localContext);
|
||||||
|
} else {
|
||||||
|
print("NO LOCAL DB !");
|
||||||
|
}
|
||||||
|
|
||||||
|
initialRoute = isLogged ? '/home' : '/login';
|
||||||
|
|
||||||
final MyApp myApp = MyApp(
|
final MyApp myApp = MyApp(
|
||||||
initialRoute: initialRoute,
|
initialRoute: initialRoute,
|
||||||
//context: localContext,
|
homieAppContext: localContext,
|
||||||
);
|
);
|
||||||
|
|
||||||
runApp(myApp);
|
runApp(myApp);
|
||||||
@ -21,19 +38,21 @@ void main() {
|
|||||||
|
|
||||||
class MyApp extends StatefulWidget {
|
class MyApp extends StatefulWidget {
|
||||||
final String initialRoute;
|
final String initialRoute;
|
||||||
//final Context context;
|
final HomieAppContext homieAppContext;
|
||||||
MyApp({this.initialRoute});
|
MyApp({this.initialRoute, this.homieAppContext});
|
||||||
|
|
||||||
// This widget is the root of your application.
|
|
||||||
@override
|
@override
|
||||||
_MyAppState createState() => _MyAppState();
|
_MyAppState createState() => _MyAppState();
|
||||||
}
|
}
|
||||||
|
|
||||||
class _MyAppState extends State<MyApp> {
|
class _MyAppState extends State<MyApp> {
|
||||||
|
//HomieAppContext homieAppContext;
|
||||||
|
|
||||||
@override
|
@override
|
||||||
Widget build(BuildContext context) {
|
Widget build(BuildContext context) {
|
||||||
return MaterialApp(
|
return ChangeNotifierProvider<AppContext>(
|
||||||
|
create: (_) => AppContext(widget.homieAppContext),
|
||||||
|
child: MaterialApp(
|
||||||
debugShowCheckedModeBanner: false,
|
debugShowCheckedModeBanner: false,
|
||||||
title: 'MyHomie App Demo',
|
title: 'MyHomie App Demo',
|
||||||
initialRoute: widget.initialRoute,
|
initialRoute: widget.initialRoute,
|
||||||
@ -49,197 +68,9 @@ class _MyAppState extends State<MyApp> {
|
|||||||
visualDensity: VisualDensity.adaptivePlatformDensity,
|
visualDensity: VisualDensity.adaptivePlatformDensity,
|
||||||
),
|
),
|
||||||
routes: {
|
routes: {
|
||||||
'/home': (context) => MyHomePage(title: 'MyHomie App Demo Home Page')
|
'/home': (context) => HomePage(),
|
||||||
|
'/login': (context) => LoginScreen()
|
||||||
}
|
}
|
||||||
);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
class MyHomePage extends StatefulWidget {
|
|
||||||
MyHomePage({Key key, this.title}) : super(key: key);
|
|
||||||
final String title;
|
|
||||||
|
|
||||||
@override
|
|
||||||
_MyHomePageState createState() => _MyHomePageState();
|
|
||||||
}
|
|
||||||
|
|
||||||
class _MyHomePageState extends State<MyHomePage> {
|
|
||||||
int _counter = 0;
|
|
||||||
//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());
|
|
||||||
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.. ");
|
|
||||||
var isError = true;
|
|
||||||
try {
|
|
||||||
LoginDTO loginDTO = new LoginDTO(email: "test@email.be", password: "kljqsdkljqsd");
|
|
||||||
TokenDTO token = await clientAPI.authenticationApi.authenticationAuthenticateWithJson(loginDTO);
|
|
||||||
print("Token ??");
|
|
||||||
print(token.accessToken);
|
|
||||||
setAccessToken(token.accessToken);
|
|
||||||
isError = false;
|
|
||||||
}
|
|
||||||
catch (e) {
|
|
||||||
print("error auth");
|
|
||||||
}
|
|
||||||
|
|
||||||
if (!isError) {
|
|
||||||
UserInfoDetailDTO user = await clientAPI.userApi.userGet("604a33639b4a377a413045b9");
|
|
||||||
print("user values ??");
|
|
||||||
print(user.email);
|
|
||||||
print(user.id);
|
|
||||||
|
|
||||||
List<RoomSummaryDTO> rooms = await clientAPI.roomApi.roomGetAll(user.id);
|
|
||||||
print("number of rooms " + rooms.length.toString());
|
|
||||||
rooms.forEach((element) {
|
|
||||||
print(element);
|
|
||||||
});
|
|
||||||
|
|
||||||
List<ProviderDTO> providers = await clientAPI.providerApi.providerGetAll(user.id);
|
|
||||||
print("number of providers " + providers.length.toString());
|
|
||||||
providers.forEach((element) {
|
|
||||||
print(element);
|
|
||||||
});
|
|
||||||
|
|
||||||
List<DeviceSummaryDTO> devices = await clientAPI.deviceApi.deviceGetAll(user.id);
|
|
||||||
print("number of devices " + devices.length.toString());
|
|
||||||
/*devices.forEach((element) {
|
|
||||||
print(element);
|
|
||||||
});*/
|
|
||||||
|
|
||||||
List<AutomationDTO> automations = await clientAPI.automationApi.automationGetAll(user.id);
|
|
||||||
print("number of automations " + automations.length.toString());
|
|
||||||
automations.forEach((element) {
|
|
||||||
print(element);
|
|
||||||
});
|
|
||||||
|
|
||||||
List<GroupSummaryDTO> groups = await clientAPI.groupApi.groupGetAll(user.id);
|
|
||||||
print("number of groups " + groups.length.toString());
|
|
||||||
groups.forEach((element) {
|
|
||||||
print(element);
|
|
||||||
});
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
// connection succeeded
|
|
||||||
void onConnected() {
|
|
||||||
print('Connected !!!!!!!!!!!! ----------------------------------');
|
|
||||||
|
|
||||||
/*client.updates.listen((List<MqttReceivedMessage<MqttMessage>> c) {
|
|
||||||
final MqttPublishMessage message = c[0].payload;
|
|
||||||
final payload = MqttPublishPayload.bytesToStringAsString(message.payload.message);
|
|
||||||
print('Received message:$payload from topic: ${c[0].topic}>');
|
|
||||||
});*/
|
|
||||||
}
|
|
||||||
|
|
||||||
void setAccessToken(String accessToken) {
|
|
||||||
clientAPI.apiApi.authentications.forEach((key, auth) {
|
|
||||||
if (auth is OAuth) {
|
|
||||||
auth.accessToken = accessToken;
|
|
||||||
}
|
|
||||||
});
|
|
||||||
}
|
|
||||||
|
|
||||||
// unconnected
|
|
||||||
void onDisconnected() {
|
|
||||||
print('Disconnected');
|
|
||||||
}
|
|
||||||
|
|
||||||
// subscribe to topic succeeded
|
|
||||||
void onSubscribed(String topic) {
|
|
||||||
print('Subscribed topic: $topic');
|
|
||||||
}
|
|
||||||
|
|
||||||
// subscribe to topic failed
|
|
||||||
void onSubscribeFail(String topic) {
|
|
||||||
print('Failed to subscribe $topic');
|
|
||||||
}
|
|
||||||
|
|
||||||
// unsubscribe succeeded
|
|
||||||
void onUnsubscribed(String topic) {
|
|
||||||
print('Unsubscribed topic: $topic');
|
|
||||||
}
|
|
||||||
|
|
||||||
Future<MqttServerClient> connect() async {
|
|
||||||
/*client.logging(on: false);
|
|
||||||
client.keepAlivePeriod = 20;
|
|
||||||
client.onDisconnected = onDisconnected;
|
|
||||||
client.onConnected = onConnected;
|
|
||||||
client.onSubscribed = onSubscribed;*/
|
|
||||||
|
|
||||||
/// Security context
|
|
||||||
/*SecurityContext context = new SecurityContext()
|
|
||||||
..useCertificateChain('path/to/my_cert.pem')
|
|
||||||
..usePrivateKey('path/to/my_key.pem', password: 'key_password')
|
|
||||||
..setClientAuthorities('path/to/client.crt', password: 'password');*/
|
|
||||||
//client.setProtocolV31();
|
|
||||||
//client.secure = true;
|
|
||||||
//client.securityContext = context;
|
|
||||||
|
|
||||||
final connMessage = MqttConnectMessage()
|
|
||||||
.authenticateAs('thomas', 'MyCore,1') // TODO ONLINE
|
|
||||||
/*.keepAliveFor(60)
|
|
||||||
.withWillTopic('willtopic')
|
|
||||||
.withWillMessage('Will message')*/
|
|
||||||
.withClientIdentifier("TESSST")
|
|
||||||
.startClean();
|
|
||||||
//.withWillQos(MqttQos.atLeastOnce);
|
|
||||||
//client.secure = true;
|
|
||||||
/*client.connectionMessage = connMessage;
|
|
||||||
client.autoReconnect = true;
|
|
||||||
try {
|
|
||||||
await client.connect();
|
|
||||||
} catch (e) {
|
|
||||||
print('Exception: $e');
|
|
||||||
client.disconnect();
|
|
||||||
}
|
|
||||||
|
|
||||||
client.subscribe("#", MqttQos.atLeastOnce);
|
|
||||||
*/
|
|
||||||
//return client;
|
|
||||||
return null;
|
|
||||||
}
|
|
||||||
|
|
||||||
@override
|
|
||||||
Widget build(BuildContext context) {
|
|
||||||
connect();
|
|
||||||
return Scaffold(
|
|
||||||
appBar: AppBar(
|
|
||||||
title: Text(widget.title),
|
|
||||||
),
|
|
||||||
body: Center(
|
|
||||||
child: Column(
|
|
||||||
mainAxisAlignment: MainAxisAlignment.center,
|
|
||||||
children: <Widget>[
|
|
||||||
Text(
|
|
||||||
'You have pushed the button this many times:',
|
|
||||||
),
|
|
||||||
Text(
|
|
||||||
'$_counter',
|
|
||||||
style: Theme.of(context).textTheme.headline4,
|
|
||||||
),
|
|
||||||
],
|
|
||||||
),
|
|
||||||
),
|
|
||||||
floatingActionButton: FloatingActionButton(
|
|
||||||
onPressed: authenticateTRY,
|
|
||||||
tooltip: 'Increment',
|
|
||||||
child: Icon(Icons.add),
|
|
||||||
),
|
),
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|||||||
@ -2,11 +2,11 @@
|
|||||||
// Generated file. Do not edit.
|
// Generated file. Do not edit.
|
||||||
//
|
//
|
||||||
|
|
||||||
// clang-format off
|
|
||||||
|
|
||||||
import FlutterMacOS
|
import FlutterMacOS
|
||||||
import Foundation
|
import Foundation
|
||||||
|
|
||||||
|
import sqflite
|
||||||
|
|
||||||
func RegisterGeneratedPlugins(registry: FlutterPluginRegistry) {
|
func RegisterGeneratedPlugins(registry: FlutterPluginRegistry) {
|
||||||
|
SqflitePlugin.register(with: registry.registrar(forPlugin: "SqflitePlugin"))
|
||||||
}
|
}
|
||||||
|
|||||||
@ -3,15 +3,22 @@
|
|||||||
README.md
|
README.md
|
||||||
doc/Action.md
|
doc/Action.md
|
||||||
doc/ActionType.md
|
doc/ActionType.md
|
||||||
|
doc/AlarmApi.md
|
||||||
|
doc/AlarmMode.md
|
||||||
|
doc/AlarmModeCreateOrUpdateDetailDTO.md
|
||||||
|
doc/AlarmModeCreateOrUpdateDetailDTOAllOf.md
|
||||||
|
doc/AlarmModeDTO.md
|
||||||
|
doc/AlarmModeDetailDTO.md
|
||||||
|
doc/AlarmModeDetailDTOAllOf.md
|
||||||
|
doc/AlarmTriggered.md
|
||||||
|
doc/AlarmType.md
|
||||||
doc/AuthenticationApi.md
|
doc/AuthenticationApi.md
|
||||||
doc/Automation.md
|
|
||||||
doc/AutomationApi.md
|
doc/AutomationApi.md
|
||||||
doc/AutomationCreateOrUpdateDetailDTO.md
|
|
||||||
doc/AutomationCreateOrUpdateDetailDTOAllOf.md
|
|
||||||
doc/AutomationDTO.md
|
doc/AutomationDTO.md
|
||||||
doc/AutomationDetailDTO.md
|
doc/AutomationDetailDTO.md
|
||||||
doc/AutomationDetailDTOAllOf.md
|
doc/AutomationDetailDTOAllOf.md
|
||||||
doc/AutomationState.md
|
doc/AutomationState.md
|
||||||
|
doc/AutomationTriggered.md
|
||||||
doc/AzureADAuthModel.md
|
doc/AzureADAuthModel.md
|
||||||
doc/AzureApi.md
|
doc/AzureApi.md
|
||||||
doc/Book.md
|
doc/Book.md
|
||||||
@ -20,25 +27,36 @@ doc/Condition.md
|
|||||||
doc/ConditionType.md
|
doc/ConditionType.md
|
||||||
doc/ConditionValue.md
|
doc/ConditionValue.md
|
||||||
doc/ConnectionStatus.md
|
doc/ConnectionStatus.md
|
||||||
doc/Device.md
|
doc/CreateOrUpdateHomeDTO.md
|
||||||
|
doc/CreateOrUpdateHomeDTOAllOf.md
|
||||||
doc/DeviceApi.md
|
doc/DeviceApi.md
|
||||||
doc/DeviceDetailDTO.md
|
doc/DeviceDetailDTO.md
|
||||||
doc/DeviceDetailDTOAllOf.md
|
doc/DeviceDetailDTOAllOf.md
|
||||||
|
doc/DeviceState.md
|
||||||
doc/DeviceSummaryDTO.md
|
doc/DeviceSummaryDTO.md
|
||||||
doc/DeviceType.md
|
doc/DeviceType.md
|
||||||
doc/ElectricityProduction.md
|
doc/ElectricityProduction.md
|
||||||
doc/EnergyApi.md
|
doc/EnergyApi.md
|
||||||
|
doc/EventApi.md
|
||||||
|
doc/EventDTO.md
|
||||||
|
doc/EventDetailDTO.md
|
||||||
|
doc/EventDetailDTOAllOf.md
|
||||||
|
doc/EventType.md
|
||||||
doc/FacebookApi.md
|
doc/FacebookApi.md
|
||||||
doc/FacebookAuthModel.md
|
doc/FacebookAuthModel.md
|
||||||
|
doc/GeolocalizedMode.md
|
||||||
doc/GoogleApi.md
|
doc/GoogleApi.md
|
||||||
doc/GoogleAuthModel.md
|
doc/GoogleAuthModel.md
|
||||||
doc/Group.md
|
|
||||||
doc/GroupApi.md
|
doc/GroupApi.md
|
||||||
doc/GroupCreateOrUpdateDetailDTO.md
|
doc/GroupCreateOrUpdateDetailDTO.md
|
||||||
doc/GroupCreateOrUpdateDetailDTOAllOf.md
|
doc/GroupCreateOrUpdateDetailDTOAllOf.md
|
||||||
doc/GroupDetailDTO.md
|
doc/GroupDetailDTO.md
|
||||||
doc/GroupDetailDTOAllOf.md
|
doc/GroupDetailDTOAllOf.md
|
||||||
doc/GroupSummaryDTO.md
|
doc/GroupSummaryDTO.md
|
||||||
|
doc/HomeApi.md
|
||||||
|
doc/HomeDTO.md
|
||||||
|
doc/HomeDetailDTO.md
|
||||||
|
doc/HomeDetailDTOAllOf.md
|
||||||
doc/IOTApi.md
|
doc/IOTApi.md
|
||||||
doc/LayoutApi.md
|
doc/LayoutApi.md
|
||||||
doc/LoginDTO.md
|
doc/LoginDTO.md
|
||||||
@ -50,20 +68,19 @@ doc/OddNice.md
|
|||||||
doc/OddObject.md
|
doc/OddObject.md
|
||||||
doc/PanelMenuItem.md
|
doc/PanelMenuItem.md
|
||||||
doc/PanelSection.md
|
doc/PanelSection.md
|
||||||
doc/PlaceDTO.md
|
doc/ProgrammedMode.md
|
||||||
doc/Provider.md
|
|
||||||
doc/ProviderApi.md
|
doc/ProviderApi.md
|
||||||
doc/ProviderDTO.md
|
doc/ProviderDTO.md
|
||||||
|
doc/ProviderType.md
|
||||||
doc/RoomApi.md
|
doc/RoomApi.md
|
||||||
doc/RoomCreateOrUpdateDetailDTO.md
|
doc/RoomCreateOrUpdateDetailDTO.md
|
||||||
doc/RoomDetailDTO.md
|
doc/RoomDetailDTO.md
|
||||||
doc/RoomSummaryDTO.md
|
doc/RoomSummaryDTO.md
|
||||||
doc/ScreenConfiguration.md
|
|
||||||
doc/ScreenDevice.md
|
doc/ScreenDevice.md
|
||||||
doc/ScreenDeviceApi.md
|
doc/ScreenDeviceApi.md
|
||||||
doc/ScreenWidget.md
|
|
||||||
doc/SmartGardenMessage.md
|
doc/SmartGardenMessage.md
|
||||||
doc/SmartPrinterMessage.md
|
doc/SmartPrinterMessage.md
|
||||||
|
doc/TimePeriodAlarm.md
|
||||||
doc/TokenApi.md
|
doc/TokenApi.md
|
||||||
doc/TokenDTO.md
|
doc/TokenDTO.md
|
||||||
doc/Trigger.md
|
doc/Trigger.md
|
||||||
@ -78,15 +95,18 @@ doc/ValuesApi.md
|
|||||||
doc/ViewBy.md
|
doc/ViewBy.md
|
||||||
git_push.sh
|
git_push.sh
|
||||||
lib/api.dart
|
lib/api.dart
|
||||||
|
lib/api/alarm_api.dart
|
||||||
lib/api/authentication_api.dart
|
lib/api/authentication_api.dart
|
||||||
lib/api/automation_api.dart
|
lib/api/automation_api.dart
|
||||||
lib/api/azure_api.dart
|
lib/api/azure_api.dart
|
||||||
lib/api/books_api.dart
|
lib/api/books_api.dart
|
||||||
lib/api/device_api.dart
|
lib/api/device_api.dart
|
||||||
lib/api/energy_api.dart
|
lib/api/energy_api.dart
|
||||||
|
lib/api/event_api.dart
|
||||||
lib/api/facebook_api.dart
|
lib/api/facebook_api.dart
|
||||||
lib/api/google_api.dart
|
lib/api/google_api.dart
|
||||||
lib/api/group_api.dart
|
lib/api/group_api.dart
|
||||||
|
lib/api/home_api.dart
|
||||||
lib/api/iot_api.dart
|
lib/api/iot_api.dart
|
||||||
lib/api/layout_api.dart
|
lib/api/layout_api.dart
|
||||||
lib/api/mqtt_api.dart
|
lib/api/mqtt_api.dart
|
||||||
@ -108,33 +128,48 @@ lib/auth/http_bearer_auth.dart
|
|||||||
lib/auth/oauth.dart
|
lib/auth/oauth.dart
|
||||||
lib/model/action.dart
|
lib/model/action.dart
|
||||||
lib/model/action_type.dart
|
lib/model/action_type.dart
|
||||||
lib/model/automation.dart
|
lib/model/alarm_mode.dart
|
||||||
lib/model/automation_create_or_update_detail_dto.dart
|
lib/model/alarm_mode_create_or_update_detail_dto.dart
|
||||||
lib/model/automation_create_or_update_detail_dto_all_of.dart
|
lib/model/alarm_mode_create_or_update_detail_dto_all_of.dart
|
||||||
|
lib/model/alarm_mode_detail_dto.dart
|
||||||
|
lib/model/alarm_mode_detail_dto_all_of.dart
|
||||||
|
lib/model/alarm_mode_dto.dart
|
||||||
|
lib/model/alarm_triggered.dart
|
||||||
|
lib/model/alarm_type.dart
|
||||||
lib/model/automation_detail_dto.dart
|
lib/model/automation_detail_dto.dart
|
||||||
lib/model/automation_detail_dto_all_of.dart
|
lib/model/automation_detail_dto_all_of.dart
|
||||||
lib/model/automation_dto.dart
|
lib/model/automation_dto.dart
|
||||||
lib/model/automation_state.dart
|
lib/model/automation_state.dart
|
||||||
|
lib/model/automation_triggered.dart
|
||||||
lib/model/azure_ad_auth_model.dart
|
lib/model/azure_ad_auth_model.dart
|
||||||
lib/model/book.dart
|
lib/model/book.dart
|
||||||
lib/model/condition.dart
|
lib/model/condition.dart
|
||||||
lib/model/condition_type.dart
|
lib/model/condition_type.dart
|
||||||
lib/model/condition_value.dart
|
lib/model/condition_value.dart
|
||||||
lib/model/connection_status.dart
|
lib/model/connection_status.dart
|
||||||
lib/model/device.dart
|
lib/model/create_or_update_home_dto.dart
|
||||||
|
lib/model/create_or_update_home_dto_all_of.dart
|
||||||
lib/model/device_detail_dto.dart
|
lib/model/device_detail_dto.dart
|
||||||
lib/model/device_detail_dto_all_of.dart
|
lib/model/device_detail_dto_all_of.dart
|
||||||
|
lib/model/device_state.dart
|
||||||
lib/model/device_summary_dto.dart
|
lib/model/device_summary_dto.dart
|
||||||
lib/model/device_type.dart
|
lib/model/device_type.dart
|
||||||
lib/model/electricity_production.dart
|
lib/model/electricity_production.dart
|
||||||
|
lib/model/event_detail_dto.dart
|
||||||
|
lib/model/event_detail_dto_all_of.dart
|
||||||
|
lib/model/event_dto.dart
|
||||||
|
lib/model/event_type.dart
|
||||||
lib/model/facebook_auth_model.dart
|
lib/model/facebook_auth_model.dart
|
||||||
|
lib/model/geolocalized_mode.dart
|
||||||
lib/model/google_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.dart
|
||||||
lib/model/group_create_or_update_detail_dto_all_of.dart
|
lib/model/group_create_or_update_detail_dto_all_of.dart
|
||||||
lib/model/group_detail_dto.dart
|
lib/model/group_detail_dto.dart
|
||||||
lib/model/group_detail_dto_all_of.dart
|
lib/model/group_detail_dto_all_of.dart
|
||||||
lib/model/group_summary_dto.dart
|
lib/model/group_summary_dto.dart
|
||||||
|
lib/model/home_detail_dto.dart
|
||||||
|
lib/model/home_detail_dto_all_of.dart
|
||||||
|
lib/model/home_dto.dart
|
||||||
lib/model/login_dto.dart
|
lib/model/login_dto.dart
|
||||||
lib/model/means_of_communication.dart
|
lib/model/means_of_communication.dart
|
||||||
lib/model/mqtt_message_dto.dart
|
lib/model/mqtt_message_dto.dart
|
||||||
@ -142,17 +177,16 @@ lib/model/odd_nice.dart
|
|||||||
lib/model/odd_object.dart
|
lib/model/odd_object.dart
|
||||||
lib/model/panel_menu_item.dart
|
lib/model/panel_menu_item.dart
|
||||||
lib/model/panel_section.dart
|
lib/model/panel_section.dart
|
||||||
lib/model/place_dto.dart
|
lib/model/programmed_mode.dart
|
||||||
lib/model/provider.dart
|
|
||||||
lib/model/provider_dto.dart
|
lib/model/provider_dto.dart
|
||||||
|
lib/model/provider_type.dart
|
||||||
lib/model/room_create_or_update_detail_dto.dart
|
lib/model/room_create_or_update_detail_dto.dart
|
||||||
lib/model/room_detail_dto.dart
|
lib/model/room_detail_dto.dart
|
||||||
lib/model/room_summary_dto.dart
|
lib/model/room_summary_dto.dart
|
||||||
lib/model/screen_configuration.dart
|
|
||||||
lib/model/screen_device.dart
|
lib/model/screen_device.dart
|
||||||
lib/model/screen_widget.dart
|
|
||||||
lib/model/smart_garden_message.dart
|
lib/model/smart_garden_message.dart
|
||||||
lib/model/smart_printer_message.dart
|
lib/model/smart_printer_message.dart
|
||||||
|
lib/model/time_period_alarm.dart
|
||||||
lib/model/token_dto.dart
|
lib/model/token_dto.dart
|
||||||
lib/model/trigger.dart
|
lib/model/trigger.dart
|
||||||
lib/model/trigger_type.dart
|
lib/model/trigger_type.dart
|
||||||
@ -162,3 +196,29 @@ lib/model/user_info.dart
|
|||||||
lib/model/user_info_detail_dto.dart
|
lib/model/user_info_detail_dto.dart
|
||||||
lib/model/view_by.dart
|
lib/model/view_by.dart
|
||||||
pubspec.yaml
|
pubspec.yaml
|
||||||
|
test/alarm_api_test.dart
|
||||||
|
test/alarm_mode_create_or_update_detail_dto_all_of_test.dart
|
||||||
|
test/alarm_mode_create_or_update_detail_dto_test.dart
|
||||||
|
test/alarm_mode_detail_dto_all_of_test.dart
|
||||||
|
test/alarm_mode_detail_dto_test.dart
|
||||||
|
test/alarm_mode_dto_test.dart
|
||||||
|
test/alarm_mode_test.dart
|
||||||
|
test/alarm_triggered_test.dart
|
||||||
|
test/alarm_type_test.dart
|
||||||
|
test/automation_triggered_test.dart
|
||||||
|
test/create_or_update_home_dto_all_of_test.dart
|
||||||
|
test/create_or_update_home_dto_test.dart
|
||||||
|
test/device_state_test.dart
|
||||||
|
test/event_api_test.dart
|
||||||
|
test/event_detail_dto_all_of_test.dart
|
||||||
|
test/event_detail_dto_test.dart
|
||||||
|
test/event_dto_test.dart
|
||||||
|
test/event_type_test.dart
|
||||||
|
test/geolocalized_mode_test.dart
|
||||||
|
test/home_api_test.dart
|
||||||
|
test/home_detail_dto_all_of_test.dart
|
||||||
|
test/home_detail_dto_test.dart
|
||||||
|
test/home_dto_test.dart
|
||||||
|
test/programmed_mode_test.dart
|
||||||
|
test/provider_type_test.dart
|
||||||
|
test/time_period_alarm_test.dart
|
||||||
|
|||||||
@ -42,34 +42,38 @@ import 'package:mycoreapi/api.dart';
|
|||||||
// TODO Configure OAuth2 access token for authorization: bearer
|
// TODO Configure OAuth2 access token for authorization: bearer
|
||||||
//defaultApiClient.getAuthentication<OAuth>('bearer').accessToken = 'YOUR_ACCESS_TOKEN';
|
//defaultApiClient.getAuthentication<OAuth>('bearer').accessToken = 'YOUR_ACCESS_TOKEN';
|
||||||
|
|
||||||
final api_instance = AuthenticationApi();
|
final api_instance = AlarmApi();
|
||||||
final grantType = grantType_example; // String |
|
final alarmModeId = alarmModeId_example; // String | Alarm mode to activate
|
||||||
final username = username_example; // String |
|
|
||||||
final password = password_example; // String |
|
|
||||||
final clientId = clientId_example; // String |
|
|
||||||
final clientSecret = clientSecret_example; // String |
|
|
||||||
|
|
||||||
try {
|
try {
|
||||||
final result = api_instance.authenticationAuthenticateWithForm(grantType, username, password, clientId, clientSecret);
|
final result = api_instance.alarmActivate(alarmModeId);
|
||||||
print(result);
|
print(result);
|
||||||
} catch (e) {
|
} catch (e) {
|
||||||
print('Exception when calling AuthenticationApi->authenticationAuthenticateWithForm: $e\n');
|
print('Exception when calling AlarmApi->alarmActivate: $e\n');
|
||||||
}
|
}
|
||||||
|
|
||||||
```
|
```
|
||||||
|
|
||||||
## Documentation for API Endpoints
|
## Documentation for API Endpoints
|
||||||
|
|
||||||
All URIs are relative to *http://localhost:25049*
|
All URIs are relative to *http://192.168.31.140*
|
||||||
|
|
||||||
Class | Method | HTTP request | Description
|
Class | Method | HTTP request | Description
|
||||||
------------ | ------------- | ------------- | -------------
|
------------ | ------------- | ------------- | -------------
|
||||||
|
*AlarmApi* | [**alarmActivate**](doc\/AlarmApi.md#alarmactivate) | **POST** /api/alarm/activate/{alarmModeId} | Activate current alarm mode
|
||||||
|
*AlarmApi* | [**alarmCreate**](doc\/AlarmApi.md#alarmcreate) | **POST** /api/alarm | Create an alarm mode
|
||||||
|
*AlarmApi* | [**alarmCreateDefaultAlarms**](doc\/AlarmApi.md#alarmcreatedefaultalarms) | **POST** /api/alarm/defaults/{homeId} | Create default alarm modes
|
||||||
|
*AlarmApi* | [**alarmDelete**](doc\/AlarmApi.md#alarmdelete) | **DELETE** /api/alarm/{alarmModeId} | Delete an alarm mode
|
||||||
|
*AlarmApi* | [**alarmDeleteAllForHome**](doc\/AlarmApi.md#alarmdeleteallforhome) | **DELETE** /api/alarm/home/{homeId} | Delete all alarm mode for a specified home
|
||||||
|
*AlarmApi* | [**alarmGetAll**](doc\/AlarmApi.md#alarmgetall) | **GET** /api/alarm/{homeId} | Get all alarm modes for the specified home
|
||||||
|
*AlarmApi* | [**alarmGetDetail**](doc\/AlarmApi.md#alarmgetdetail) | **GET** /api/alarm/detail/{alarmId} | Get detail info of a specified alarm mode
|
||||||
|
*AlarmApi* | [**alarmUpdate**](doc\/AlarmApi.md#alarmupdate) | **PUT** /api/alarm | Update an alarm mode
|
||||||
*AuthenticationApi* | [**authenticationAuthenticateWithForm**](doc\/AuthenticationApi.md#authenticationauthenticatewithform) | **POST** /api/Authentication/Token | Authenticate with form parameters (used by Swagger test client)
|
*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)
|
*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 | Create an automation
|
*AutomationApi* | [**automationCreate**](doc\/AutomationApi.md#automationcreate) | **POST** /api/automation | Create an automation
|
||||||
*AutomationApi* | [**automationDelete**](doc\/AutomationApi.md#automationdelete) | **DELETE** /api/automation/{automationId} | Delete an 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* | [**automationDeleteAllForHome**](doc\/AutomationApi.md#automationdeleteallforhome) | **DELETE** /api/automation/home/{homeId} | Delete all automation for a specified home
|
||||||
*AutomationApi* | [**automationGetAll**](doc\/AutomationApi.md#automationgetall) | **GET** /api/automation/{userId} | Get all automations for the specified user
|
*AutomationApi* | [**automationGetAll**](doc\/AutomationApi.md#automationgetall) | **GET** /api/automation/{homeId} | Get all automations for the specified home
|
||||||
*AutomationApi* | [**automationGetDetail**](doc\/AutomationApi.md#automationgetdetail) | **GET** /api/automation/detail/{automationId} | Get detail info of a specified automation
|
*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
|
*AutomationApi* | [**automationUpdate**](doc\/AutomationApi.md#automationupdate) | **PUT** /api/automation | Update an automation
|
||||||
*AzureApi* | [**azureCreate**](doc\/AzureApi.md#azurecreate) | **POST** /azure |
|
*AzureApi* | [**azureCreate**](doc\/AzureApi.md#azurecreate) | **POST** /azure |
|
||||||
@ -79,29 +83,38 @@ Class | Method | HTTP request | Description
|
|||||||
*BooksApi* | [**booksGetAll**](doc\/BooksApi.md#booksgetall) | **GET** /api/books |
|
*BooksApi* | [**booksGetAll**](doc\/BooksApi.md#booksgetall) | **GET** /api/books |
|
||||||
*BooksApi* | [**booksUpdate**](doc\/BooksApi.md#booksupdate) | **PUT** /api/books/{id} |
|
*BooksApi* | [**booksUpdate**](doc\/BooksApi.md#booksupdate) | **PUT** /api/books/{id} |
|
||||||
*DeviceApi* | [**deviceCreate**](doc\/DeviceApi.md#devicecreate) | **POST** /api/device | Create a device
|
*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* | [**deviceCreateDevicesFromProvider**](doc\/DeviceApi.md#devicecreatedevicesfromprovider) | **POST** /api/device/{homeId}/fromProvider/{providerId} | Create devices from provider
|
||||||
*DeviceApi* | [**deviceDelete**](doc\/DeviceApi.md#devicedelete) | **DELETE** /api/device/{deviceId} | Delete a device
|
*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 user
|
*DeviceApi* | [**deviceDeleteAllForHome**](doc\/DeviceApi.md#devicedeleteallforhome) | **DELETE** /api/device/home/{homeId} | Delete all device for a specified home
|
||||||
*DeviceApi* | [**deviceDeleteDevicesFromProvider**](doc\/DeviceApi.md#devicedeletedevicesfromprovider) | **DELETE** /api/device/{userId}/fromProvider/{providerId} | Delete devices from provider
|
*DeviceApi* | [**deviceDeleteDevicesFromProvider**](doc\/DeviceApi.md#devicedeletedevicesfromprovider) | **DELETE** /api/device/{homeId}/fromProvider/{providerId} | Delete devices from provider
|
||||||
*DeviceApi* | [**deviceGetAll**](doc\/DeviceApi.md#devicegetall) | **GET** /api/device/{userId} | Get all devices summary
|
*DeviceApi* | [**deviceGetAll**](doc\/DeviceApi.md#devicegetall) | **GET** /api/device/{homeId} | Get all devices summary
|
||||||
*DeviceApi* | [**deviceGetDetail**](doc\/DeviceApi.md#devicegetdetail) | **GET** /api/device/detail/{deviceId} | Get a specific device info
|
*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* | [**deviceGetDevicesByType**](doc\/DeviceApi.md#devicegetdevicesbytype) | **GET** /api/device/{homeId}/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* | [**deviceGetDevicesFromProvider**](doc\/DeviceApi.md#devicegetdevicesfromprovider) | **GET** /api/device/{homeId}/fromProvider/{providerId} | Get devices from provider
|
||||||
*DeviceApi* | [**deviceGetDevicesFromZigbee2Mqtt**](doc\/DeviceApi.md#devicegetdevicesfromzigbee2mqtt) | **GET** /api/device/zigbee2Mqtt/{userId} | Get all zigbee2Mqtt devices
|
*DeviceApi* | [**deviceGetDevicesFromZigbee2Mqtt**](doc\/DeviceApi.md#devicegetdevicesfromzigbee2mqtt) | **GET** /api/device/zigbee2Mqtt/{homeId} | Get all zigbee2Mqtt devices
|
||||||
*DeviceApi* | [**deviceUpdate**](doc\/DeviceApi.md#deviceupdate) | **PUT** /api/device/{deviceId} | Update a device
|
*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
|
*EnergyApi* | [**energyGetElectricityProduction**](doc\/EnergyApi.md#energygetelectricityproduction) | **GET** /api/energy/electricity | Get summary production of Kwh/Year
|
||||||
|
*EventApi* | [**eventDelete**](doc\/EventApi.md#eventdelete) | **DELETE** /api/event/{eventId} | Delete an event
|
||||||
|
*EventApi* | [**eventDeleteAllForHome**](doc\/EventApi.md#eventdeleteallforhome) | **DELETE** /api/event/home/{homeId} | Delete all events for a specified home
|
||||||
|
*EventApi* | [**eventGet**](doc\/EventApi.md#eventget) | **GET** /api/event/{homeId} | Get events for the specified home
|
||||||
|
*EventApi* | [**eventGetDetail**](doc\/EventApi.md#eventgetdetail) | **GET** /api/event/detail/{eventId} | Get detail info of a specified event
|
||||||
*FacebookApi* | [**facebookCreate**](doc\/FacebookApi.md#facebookcreate) | **POST** /facebook |
|
*FacebookApi* | [**facebookCreate**](doc\/FacebookApi.md#facebookcreate) | **POST** /facebook |
|
||||||
*GoogleApi* | [**googleCreate**](doc\/GoogleApi.md#googlecreate) | **POST** /google |
|
*GoogleApi* | [**googleCreate**](doc\/GoogleApi.md#googlecreate) | **POST** /google |
|
||||||
*GroupApi* | [**groupCreate**](doc\/GroupApi.md#groupcreate) | **POST** /api/group | Create a group
|
*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* | [**groupCreateDevicesFromZigbee2Mqtt**](doc\/GroupApi.md#groupcreatedevicesfromzigbee2mqtt) | **POST** /api/group/{homeId}/fromZigbee | Create groups from provider
|
||||||
*GroupApi* | [**groupDelete**](doc\/GroupApi.md#groupdelete) | **DELETE** /api/group/{groupId}/device/{deviceId} | Delete device from a group
|
*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* | [**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* | [**groupDeleteAllForHome**](doc\/GroupApi.md#groupdeleteallforhome) | **DELETE** /api/group/home/{homeId} | Delete all group for a specified home
|
||||||
*GroupApi* | [**groupGetAll**](doc\/GroupApi.md#groupgetall) | **GET** /api/group/{userId} | Get all groups for the specified user
|
*GroupApi* | [**groupGetAll**](doc\/GroupApi.md#groupgetall) | **GET** /api/group/{homeId} | Get all groups for the specified home
|
||||||
*GroupApi* | [**groupGetDetail**](doc\/GroupApi.md#groupgetdetail) | **GET** /api/group/detail/{groupId} | Get detail info of a specified group
|
*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* | [**groupGetGroupsByType**](doc\/GroupApi.md#groupgetgroupsbytype) | **GET** /api/group/{homeId}/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* | [**groupGetGroupsFromZigbee2Mqtt**](doc\/GroupApi.md#groupgetgroupsfromzigbee2mqtt) | **GET** /api/group/zigbee2Mqtt/{homeId} | Get all zigbee2Mqtt groups
|
||||||
*GroupApi* | [**groupUpdate**](doc\/GroupApi.md#groupupdate) | **PUT** /api/group | Update a group
|
*GroupApi* | [**groupUpdate**](doc\/GroupApi.md#groupupdate) | **PUT** /api/group | Update a group
|
||||||
|
*HomeApi* | [**homeCreate**](doc\/HomeApi.md#homecreate) | **POST** /api/home | Create a home
|
||||||
|
*HomeApi* | [**homeDelete**](doc\/HomeApi.md#homedelete) | **DELETE** /api/home/{homeId} | Delete a home
|
||||||
|
*HomeApi* | [**homeGetAll**](doc\/HomeApi.md#homegetall) | **GET** /api/home/{userId} | Get all home for specified user
|
||||||
|
*HomeApi* | [**homeGetDetail**](doc\/HomeApi.md#homegetdetail) | **GET** /api/home/detail/{homeId} | Get detail info of a specified home
|
||||||
|
*HomeApi* | [**homeUpdate**](doc\/HomeApi.md#homeupdate) | **PUT** /api/home | Update a home
|
||||||
*IOTApi* | [**iOTGetSmartPrinterMessages**](doc\/IOTApi.md#iotgetsmartprintermessages) | **GET** /api/iot/smartprinter/{idDevice} | Retrieve all SmartPrinterMessage
|
*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* | [**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!)
|
*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!)
|
||||||
@ -111,13 +124,13 @@ Class | Method | HTTP request | Description
|
|||||||
*OddApi* | [**oddGetForCountry**](doc\/OddApi.md#oddgetforcountry) | **GET** /api/odd/country/{id}/{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* | [**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* | [**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* | [**providerGetAll**](doc\/ProviderApi.md#providergetall) | **GET** /api/provider/{homeId} | Get all home providers
|
||||||
*ProviderApi* | [**providerUpdate**](doc\/ProviderApi.md#providerupdate) | **PUT** /api/provider | Update a provider
|
*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* | [**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* | [**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* | [**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 user
|
*RoomApi* | [**roomDeleteAllForHome**](doc\/RoomApi.md#roomdeleteallforhome) | **DELETE** /api/room/home/{homeId} | Delete all rooms for a specified home
|
||||||
*RoomApi* | [**roomGetAll**](doc\/RoomApi.md#roomgetall) | **GET** /api/room/{userId} | Get all rooms for the specified user
|
*RoomApi* | [**roomGetAll**](doc\/RoomApi.md#roomgetall) | **GET** /api/room/{homeId} | Get all rooms for the specified home
|
||||||
*RoomApi* | [**roomGetDetail**](doc\/RoomApi.md#roomgetdetail) | **GET** /api/room/detail/{roomId} | Get detail info of a specified room
|
*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
|
*RoomApi* | [**roomUpdate**](doc\/RoomApi.md#roomupdate) | **PUT** /api/room | Update a room
|
||||||
*ScreenDeviceApi* | [**screenDeviceCreateDevice**](doc\/ScreenDeviceApi.md#screendevicecreatedevice) | **POST** /api/device/screen | Create screen device
|
*ScreenDeviceApi* | [**screenDeviceCreateDevice**](doc\/ScreenDeviceApi.md#screendevicecreatedevice) | **POST** /api/device/screen | Create screen device
|
||||||
@ -144,33 +157,48 @@ Class | Method | HTTP request | Description
|
|||||||
|
|
||||||
- [Action](doc\/Action.md)
|
- [Action](doc\/Action.md)
|
||||||
- [ActionType](doc\/ActionType.md)
|
- [ActionType](doc\/ActionType.md)
|
||||||
- [Automation](doc\/Automation.md)
|
- [AlarmMode](doc\/AlarmMode.md)
|
||||||
- [AutomationCreateOrUpdateDetailDTO](doc\/AutomationCreateOrUpdateDetailDTO.md)
|
- [AlarmModeCreateOrUpdateDetailDTO](doc\/AlarmModeCreateOrUpdateDetailDTO.md)
|
||||||
- [AutomationCreateOrUpdateDetailDTOAllOf](doc\/AutomationCreateOrUpdateDetailDTOAllOf.md)
|
- [AlarmModeCreateOrUpdateDetailDTOAllOf](doc\/AlarmModeCreateOrUpdateDetailDTOAllOf.md)
|
||||||
|
- [AlarmModeDTO](doc\/AlarmModeDTO.md)
|
||||||
|
- [AlarmModeDetailDTO](doc\/AlarmModeDetailDTO.md)
|
||||||
|
- [AlarmModeDetailDTOAllOf](doc\/AlarmModeDetailDTOAllOf.md)
|
||||||
|
- [AlarmTriggered](doc\/AlarmTriggered.md)
|
||||||
|
- [AlarmType](doc\/AlarmType.md)
|
||||||
- [AutomationDTO](doc\/AutomationDTO.md)
|
- [AutomationDTO](doc\/AutomationDTO.md)
|
||||||
- [AutomationDetailDTO](doc\/AutomationDetailDTO.md)
|
- [AutomationDetailDTO](doc\/AutomationDetailDTO.md)
|
||||||
- [AutomationDetailDTOAllOf](doc\/AutomationDetailDTOAllOf.md)
|
- [AutomationDetailDTOAllOf](doc\/AutomationDetailDTOAllOf.md)
|
||||||
- [AutomationState](doc\/AutomationState.md)
|
- [AutomationState](doc\/AutomationState.md)
|
||||||
|
- [AutomationTriggered](doc\/AutomationTriggered.md)
|
||||||
- [AzureADAuthModel](doc\/AzureADAuthModel.md)
|
- [AzureADAuthModel](doc\/AzureADAuthModel.md)
|
||||||
- [Book](doc\/Book.md)
|
- [Book](doc\/Book.md)
|
||||||
- [Condition](doc\/Condition.md)
|
- [Condition](doc\/Condition.md)
|
||||||
- [ConditionType](doc\/ConditionType.md)
|
- [ConditionType](doc\/ConditionType.md)
|
||||||
- [ConditionValue](doc\/ConditionValue.md)
|
- [ConditionValue](doc\/ConditionValue.md)
|
||||||
- [ConnectionStatus](doc\/ConnectionStatus.md)
|
- [ConnectionStatus](doc\/ConnectionStatus.md)
|
||||||
- [Device](doc\/Device.md)
|
- [CreateOrUpdateHomeDTO](doc\/CreateOrUpdateHomeDTO.md)
|
||||||
|
- [CreateOrUpdateHomeDTOAllOf](doc\/CreateOrUpdateHomeDTOAllOf.md)
|
||||||
- [DeviceDetailDTO](doc\/DeviceDetailDTO.md)
|
- [DeviceDetailDTO](doc\/DeviceDetailDTO.md)
|
||||||
- [DeviceDetailDTOAllOf](doc\/DeviceDetailDTOAllOf.md)
|
- [DeviceDetailDTOAllOf](doc\/DeviceDetailDTOAllOf.md)
|
||||||
|
- [DeviceState](doc\/DeviceState.md)
|
||||||
- [DeviceSummaryDTO](doc\/DeviceSummaryDTO.md)
|
- [DeviceSummaryDTO](doc\/DeviceSummaryDTO.md)
|
||||||
- [DeviceType](doc\/DeviceType.md)
|
- [DeviceType](doc\/DeviceType.md)
|
||||||
- [ElectricityProduction](doc\/ElectricityProduction.md)
|
- [ElectricityProduction](doc\/ElectricityProduction.md)
|
||||||
|
- [EventDTO](doc\/EventDTO.md)
|
||||||
|
- [EventDetailDTO](doc\/EventDetailDTO.md)
|
||||||
|
- [EventDetailDTOAllOf](doc\/EventDetailDTOAllOf.md)
|
||||||
|
- [EventType](doc\/EventType.md)
|
||||||
- [FacebookAuthModel](doc\/FacebookAuthModel.md)
|
- [FacebookAuthModel](doc\/FacebookAuthModel.md)
|
||||||
|
- [GeolocalizedMode](doc\/GeolocalizedMode.md)
|
||||||
- [GoogleAuthModel](doc\/GoogleAuthModel.md)
|
- [GoogleAuthModel](doc\/GoogleAuthModel.md)
|
||||||
- [Group](doc\/Group.md)
|
|
||||||
- [GroupCreateOrUpdateDetailDTO](doc\/GroupCreateOrUpdateDetailDTO.md)
|
- [GroupCreateOrUpdateDetailDTO](doc\/GroupCreateOrUpdateDetailDTO.md)
|
||||||
- [GroupCreateOrUpdateDetailDTOAllOf](doc\/GroupCreateOrUpdateDetailDTOAllOf.md)
|
- [GroupCreateOrUpdateDetailDTOAllOf](doc\/GroupCreateOrUpdateDetailDTOAllOf.md)
|
||||||
- [GroupDetailDTO](doc\/GroupDetailDTO.md)
|
- [GroupDetailDTO](doc\/GroupDetailDTO.md)
|
||||||
- [GroupDetailDTOAllOf](doc\/GroupDetailDTOAllOf.md)
|
- [GroupDetailDTOAllOf](doc\/GroupDetailDTOAllOf.md)
|
||||||
- [GroupSummaryDTO](doc\/GroupSummaryDTO.md)
|
- [GroupSummaryDTO](doc\/GroupSummaryDTO.md)
|
||||||
|
- [HomeDTO](doc\/HomeDTO.md)
|
||||||
|
- [HomeDetailDTO](doc\/HomeDetailDTO.md)
|
||||||
|
- [HomeDetailDTOAllOf](doc\/HomeDetailDTOAllOf.md)
|
||||||
- [LoginDTO](doc\/LoginDTO.md)
|
- [LoginDTO](doc\/LoginDTO.md)
|
||||||
- [MeansOfCommunication](doc\/MeansOfCommunication.md)
|
- [MeansOfCommunication](doc\/MeansOfCommunication.md)
|
||||||
- [MqttMessageDTO](doc\/MqttMessageDTO.md)
|
- [MqttMessageDTO](doc\/MqttMessageDTO.md)
|
||||||
@ -178,17 +206,16 @@ Class | Method | HTTP request | Description
|
|||||||
- [OddObject](doc\/OddObject.md)
|
- [OddObject](doc\/OddObject.md)
|
||||||
- [PanelMenuItem](doc\/PanelMenuItem.md)
|
- [PanelMenuItem](doc\/PanelMenuItem.md)
|
||||||
- [PanelSection](doc\/PanelSection.md)
|
- [PanelSection](doc\/PanelSection.md)
|
||||||
- [PlaceDTO](doc\/PlaceDTO.md)
|
- [ProgrammedMode](doc\/ProgrammedMode.md)
|
||||||
- [Provider](doc\/Provider.md)
|
|
||||||
- [ProviderDTO](doc\/ProviderDTO.md)
|
- [ProviderDTO](doc\/ProviderDTO.md)
|
||||||
|
- [ProviderType](doc\/ProviderType.md)
|
||||||
- [RoomCreateOrUpdateDetailDTO](doc\/RoomCreateOrUpdateDetailDTO.md)
|
- [RoomCreateOrUpdateDetailDTO](doc\/RoomCreateOrUpdateDetailDTO.md)
|
||||||
- [RoomDetailDTO](doc\/RoomDetailDTO.md)
|
- [RoomDetailDTO](doc\/RoomDetailDTO.md)
|
||||||
- [RoomSummaryDTO](doc\/RoomSummaryDTO.md)
|
- [RoomSummaryDTO](doc\/RoomSummaryDTO.md)
|
||||||
- [ScreenConfiguration](doc\/ScreenConfiguration.md)
|
|
||||||
- [ScreenDevice](doc\/ScreenDevice.md)
|
- [ScreenDevice](doc\/ScreenDevice.md)
|
||||||
- [ScreenWidget](doc\/ScreenWidget.md)
|
|
||||||
- [SmartGardenMessage](doc\/SmartGardenMessage.md)
|
- [SmartGardenMessage](doc\/SmartGardenMessage.md)
|
||||||
- [SmartPrinterMessage](doc\/SmartPrinterMessage.md)
|
- [SmartPrinterMessage](doc\/SmartPrinterMessage.md)
|
||||||
|
- [TimePeriodAlarm](doc\/TimePeriodAlarm.md)
|
||||||
- [TokenDTO](doc\/TokenDTO.md)
|
- [TokenDTO](doc\/TokenDTO.md)
|
||||||
- [Trigger](doc\/Trigger.md)
|
- [Trigger](doc\/Trigger.md)
|
||||||
- [TriggerType](doc\/TriggerType.md)
|
- [TriggerType](doc\/TriggerType.md)
|
||||||
|
|||||||
@ -14,6 +14,7 @@ Name | Type | Description | Notes
|
|||||||
**rawRequest** | **String** | | [optional]
|
**rawRequest** | **String** | | [optional]
|
||||||
**providerId** | **String** | | [optional]
|
**providerId** | **String** | | [optional]
|
||||||
**type** | [**ActionType**](ActionType.md) | | [optional]
|
**type** | [**ActionType**](ActionType.md) | | [optional]
|
||||||
|
**isForce** | **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)
|
[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md)
|
||||||
|
|
||||||
|
|||||||
367
mycore_api/doc/AlarmApi.md
Normal file
367
mycore_api/doc/AlarmApi.md
Normal file
@ -0,0 +1,367 @@
|
|||||||
|
# mycoreapi.api.AlarmApi
|
||||||
|
|
||||||
|
## Load the API package
|
||||||
|
```dart
|
||||||
|
import 'package:mycoreapi/api.dart';
|
||||||
|
```
|
||||||
|
|
||||||
|
All URIs are relative to *http://192.168.31.140*
|
||||||
|
|
||||||
|
Method | HTTP request | Description
|
||||||
|
------------- | ------------- | -------------
|
||||||
|
[**alarmActivate**](AlarmApi.md#alarmactivate) | **POST** /api/alarm/activate/{alarmModeId} | Activate current alarm mode
|
||||||
|
[**alarmCreate**](AlarmApi.md#alarmcreate) | **POST** /api/alarm | Create an alarm mode
|
||||||
|
[**alarmCreateDefaultAlarms**](AlarmApi.md#alarmcreatedefaultalarms) | **POST** /api/alarm/defaults/{homeId} | Create default alarm modes
|
||||||
|
[**alarmDelete**](AlarmApi.md#alarmdelete) | **DELETE** /api/alarm/{alarmModeId} | Delete an alarm mode
|
||||||
|
[**alarmDeleteAllForHome**](AlarmApi.md#alarmdeleteallforhome) | **DELETE** /api/alarm/home/{homeId} | Delete all alarm mode for a specified home
|
||||||
|
[**alarmGetAll**](AlarmApi.md#alarmgetall) | **GET** /api/alarm/{homeId} | Get all alarm modes for the specified home
|
||||||
|
[**alarmGetDetail**](AlarmApi.md#alarmgetdetail) | **GET** /api/alarm/detail/{alarmId} | Get detail info of a specified alarm mode
|
||||||
|
[**alarmUpdate**](AlarmApi.md#alarmupdate) | **PUT** /api/alarm | Update an alarm mode
|
||||||
|
|
||||||
|
|
||||||
|
# **alarmActivate**
|
||||||
|
> String alarmActivate(alarmModeId)
|
||||||
|
|
||||||
|
Activate current alarm mode
|
||||||
|
|
||||||
|
### Example
|
||||||
|
```dart
|
||||||
|
import 'package:mycoreapi/api.dart';
|
||||||
|
// TODO Configure OAuth2 access token for authorization: bearer
|
||||||
|
//defaultApiClient.getAuthentication<OAuth>('bearer').accessToken = 'YOUR_ACCESS_TOKEN';
|
||||||
|
|
||||||
|
final api_instance = AlarmApi();
|
||||||
|
final alarmModeId = alarmModeId_example; // String | Alarm mode to activate
|
||||||
|
|
||||||
|
try {
|
||||||
|
final result = api_instance.alarmActivate(alarmModeId);
|
||||||
|
print(result);
|
||||||
|
} catch (e) {
|
||||||
|
print('Exception when calling AlarmApi->alarmActivate: $e\n');
|
||||||
|
}
|
||||||
|
```
|
||||||
|
|
||||||
|
### Parameters
|
||||||
|
|
||||||
|
Name | Type | Description | Notes
|
||||||
|
------------- | ------------- | ------------- | -------------
|
||||||
|
**alarmModeId** | **String**| Alarm mode to activate |
|
||||||
|
|
||||||
|
### 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)
|
||||||
|
|
||||||
|
# **alarmCreate**
|
||||||
|
> AlarmModeDetailDTO alarmCreate(alarmModeCreateOrUpdateDetailDTO)
|
||||||
|
|
||||||
|
Create an alarm mode
|
||||||
|
|
||||||
|
### Example
|
||||||
|
```dart
|
||||||
|
import 'package:mycoreapi/api.dart';
|
||||||
|
// TODO Configure OAuth2 access token for authorization: bearer
|
||||||
|
//defaultApiClient.getAuthentication<OAuth>('bearer').accessToken = 'YOUR_ACCESS_TOKEN';
|
||||||
|
|
||||||
|
final api_instance = AlarmApi();
|
||||||
|
final alarmModeCreateOrUpdateDetailDTO = AlarmModeCreateOrUpdateDetailDTO(); // AlarmModeCreateOrUpdateDetailDTO | Alarm mode to create
|
||||||
|
|
||||||
|
try {
|
||||||
|
final result = api_instance.alarmCreate(alarmModeCreateOrUpdateDetailDTO);
|
||||||
|
print(result);
|
||||||
|
} catch (e) {
|
||||||
|
print('Exception when calling AlarmApi->alarmCreate: $e\n');
|
||||||
|
}
|
||||||
|
```
|
||||||
|
|
||||||
|
### Parameters
|
||||||
|
|
||||||
|
Name | Type | Description | Notes
|
||||||
|
------------- | ------------- | ------------- | -------------
|
||||||
|
**alarmModeCreateOrUpdateDetailDTO** | [**AlarmModeCreateOrUpdateDetailDTO**](AlarmModeCreateOrUpdateDetailDTO.md)| Alarm mode to create |
|
||||||
|
|
||||||
|
### Return type
|
||||||
|
|
||||||
|
[**AlarmModeDetailDTO**](AlarmModeDetailDTO.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)
|
||||||
|
|
||||||
|
# **alarmCreateDefaultAlarms**
|
||||||
|
> bool alarmCreateDefaultAlarms(homeId)
|
||||||
|
|
||||||
|
Create default alarm modes
|
||||||
|
|
||||||
|
### Example
|
||||||
|
```dart
|
||||||
|
import 'package:mycoreapi/api.dart';
|
||||||
|
// TODO Configure OAuth2 access token for authorization: bearer
|
||||||
|
//defaultApiClient.getAuthentication<OAuth>('bearer').accessToken = 'YOUR_ACCESS_TOKEN';
|
||||||
|
|
||||||
|
final api_instance = AlarmApi();
|
||||||
|
final homeId = homeId_example; // String | Home Id
|
||||||
|
|
||||||
|
try {
|
||||||
|
final result = api_instance.alarmCreateDefaultAlarms(homeId);
|
||||||
|
print(result);
|
||||||
|
} catch (e) {
|
||||||
|
print('Exception when calling AlarmApi->alarmCreateDefaultAlarms: $e\n');
|
||||||
|
}
|
||||||
|
```
|
||||||
|
|
||||||
|
### Parameters
|
||||||
|
|
||||||
|
Name | Type | Description | Notes
|
||||||
|
------------- | ------------- | ------------- | -------------
|
||||||
|
**homeId** | **String**| Home Id |
|
||||||
|
|
||||||
|
### Return type
|
||||||
|
|
||||||
|
**bool**
|
||||||
|
|
||||||
|
### 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)
|
||||||
|
|
||||||
|
# **alarmDelete**
|
||||||
|
> String alarmDelete(alarmModeId)
|
||||||
|
|
||||||
|
Delete an alarm mode
|
||||||
|
|
||||||
|
### Example
|
||||||
|
```dart
|
||||||
|
import 'package:mycoreapi/api.dart';
|
||||||
|
// TODO Configure OAuth2 access token for authorization: bearer
|
||||||
|
//defaultApiClient.getAuthentication<OAuth>('bearer').accessToken = 'YOUR_ACCESS_TOKEN';
|
||||||
|
|
||||||
|
final api_instance = AlarmApi();
|
||||||
|
final alarmModeId = alarmModeId_example; // String | Id of alarm mode to delete
|
||||||
|
|
||||||
|
try {
|
||||||
|
final result = api_instance.alarmDelete(alarmModeId);
|
||||||
|
print(result);
|
||||||
|
} catch (e) {
|
||||||
|
print('Exception when calling AlarmApi->alarmDelete: $e\n');
|
||||||
|
}
|
||||||
|
```
|
||||||
|
|
||||||
|
### Parameters
|
||||||
|
|
||||||
|
Name | Type | Description | Notes
|
||||||
|
------------- | ------------- | ------------- | -------------
|
||||||
|
**alarmModeId** | **String**| Id of alarm mode to delete |
|
||||||
|
|
||||||
|
### 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)
|
||||||
|
|
||||||
|
# **alarmDeleteAllForHome**
|
||||||
|
> String alarmDeleteAllForHome(homeId)
|
||||||
|
|
||||||
|
Delete all alarm mode for a specified home
|
||||||
|
|
||||||
|
### Example
|
||||||
|
```dart
|
||||||
|
import 'package:mycoreapi/api.dart';
|
||||||
|
// TODO Configure OAuth2 access token for authorization: bearer
|
||||||
|
//defaultApiClient.getAuthentication<OAuth>('bearer').accessToken = 'YOUR_ACCESS_TOKEN';
|
||||||
|
|
||||||
|
final api_instance = AlarmApi();
|
||||||
|
final homeId = homeId_example; // String | Home Id
|
||||||
|
|
||||||
|
try {
|
||||||
|
final result = api_instance.alarmDeleteAllForHome(homeId);
|
||||||
|
print(result);
|
||||||
|
} catch (e) {
|
||||||
|
print('Exception when calling AlarmApi->alarmDeleteAllForHome: $e\n');
|
||||||
|
}
|
||||||
|
```
|
||||||
|
|
||||||
|
### Parameters
|
||||||
|
|
||||||
|
Name | Type | Description | Notes
|
||||||
|
------------- | ------------- | ------------- | -------------
|
||||||
|
**homeId** | **String**| Home Id |
|
||||||
|
|
||||||
|
### 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)
|
||||||
|
|
||||||
|
# **alarmGetAll**
|
||||||
|
> List<AlarmModeDTO> alarmGetAll(homeId)
|
||||||
|
|
||||||
|
Get all alarm modes for the specified home
|
||||||
|
|
||||||
|
### Example
|
||||||
|
```dart
|
||||||
|
import 'package:mycoreapi/api.dart';
|
||||||
|
// TODO Configure OAuth2 access token for authorization: bearer
|
||||||
|
//defaultApiClient.getAuthentication<OAuth>('bearer').accessToken = 'YOUR_ACCESS_TOKEN';
|
||||||
|
|
||||||
|
final api_instance = AlarmApi();
|
||||||
|
final homeId = homeId_example; // String | Home Id
|
||||||
|
|
||||||
|
try {
|
||||||
|
final result = api_instance.alarmGetAll(homeId);
|
||||||
|
print(result);
|
||||||
|
} catch (e) {
|
||||||
|
print('Exception when calling AlarmApi->alarmGetAll: $e\n');
|
||||||
|
}
|
||||||
|
```
|
||||||
|
|
||||||
|
### Parameters
|
||||||
|
|
||||||
|
Name | Type | Description | Notes
|
||||||
|
------------- | ------------- | ------------- | -------------
|
||||||
|
**homeId** | **String**| Home Id |
|
||||||
|
|
||||||
|
### Return type
|
||||||
|
|
||||||
|
[**List<AlarmModeDTO>**](AlarmModeDTO.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)
|
||||||
|
|
||||||
|
# **alarmGetDetail**
|
||||||
|
> AlarmModeDetailDTO alarmGetDetail(alarmId, alarmModeId)
|
||||||
|
|
||||||
|
Get detail info of a specified alarm mode
|
||||||
|
|
||||||
|
### Example
|
||||||
|
```dart
|
||||||
|
import 'package:mycoreapi/api.dart';
|
||||||
|
// TODO Configure OAuth2 access token for authorization: bearer
|
||||||
|
//defaultApiClient.getAuthentication<OAuth>('bearer').accessToken = 'YOUR_ACCESS_TOKEN';
|
||||||
|
|
||||||
|
final api_instance = AlarmApi();
|
||||||
|
final alarmId = alarmId_example; // String |
|
||||||
|
final alarmModeId = alarmModeId_example; // String | alarm id
|
||||||
|
|
||||||
|
try {
|
||||||
|
final result = api_instance.alarmGetDetail(alarmId, alarmModeId);
|
||||||
|
print(result);
|
||||||
|
} catch (e) {
|
||||||
|
print('Exception when calling AlarmApi->alarmGetDetail: $e\n');
|
||||||
|
}
|
||||||
|
```
|
||||||
|
|
||||||
|
### Parameters
|
||||||
|
|
||||||
|
Name | Type | Description | Notes
|
||||||
|
------------- | ------------- | ------------- | -------------
|
||||||
|
**alarmId** | **String**| |
|
||||||
|
**alarmModeId** | **String**| alarm id | [optional]
|
||||||
|
|
||||||
|
### Return type
|
||||||
|
|
||||||
|
[**AlarmModeDetailDTO**](AlarmModeDetailDTO.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)
|
||||||
|
|
||||||
|
# **alarmUpdate**
|
||||||
|
> AlarmModeDetailDTO alarmUpdate(alarmModeCreateOrUpdateDetailDTO)
|
||||||
|
|
||||||
|
Update an alarm mode
|
||||||
|
|
||||||
|
### Example
|
||||||
|
```dart
|
||||||
|
import 'package:mycoreapi/api.dart';
|
||||||
|
// TODO Configure OAuth2 access token for authorization: bearer
|
||||||
|
//defaultApiClient.getAuthentication<OAuth>('bearer').accessToken = 'YOUR_ACCESS_TOKEN';
|
||||||
|
|
||||||
|
final api_instance = AlarmApi();
|
||||||
|
final alarmModeCreateOrUpdateDetailDTO = AlarmModeCreateOrUpdateDetailDTO(); // AlarmModeCreateOrUpdateDetailDTO | alarm mode to update
|
||||||
|
|
||||||
|
try {
|
||||||
|
final result = api_instance.alarmUpdate(alarmModeCreateOrUpdateDetailDTO);
|
||||||
|
print(result);
|
||||||
|
} catch (e) {
|
||||||
|
print('Exception when calling AlarmApi->alarmUpdate: $e\n');
|
||||||
|
}
|
||||||
|
```
|
||||||
|
|
||||||
|
### Parameters
|
||||||
|
|
||||||
|
Name | Type | Description | Notes
|
||||||
|
------------- | ------------- | ------------- | -------------
|
||||||
|
**alarmModeCreateOrUpdateDetailDTO** | [**AlarmModeCreateOrUpdateDetailDTO**](AlarmModeCreateOrUpdateDetailDTO.md)| alarm mode to update |
|
||||||
|
|
||||||
|
### Return type
|
||||||
|
|
||||||
|
[**AlarmModeDetailDTO**](AlarmModeDetailDTO.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)
|
||||||
|
|
||||||
28
mycore_api/doc/AlarmMode.md
Normal file
28
mycore_api/doc/AlarmMode.md
Normal file
@ -0,0 +1,28 @@
|
|||||||
|
# mycoreapi.model.AlarmMode
|
||||||
|
|
||||||
|
## Load the model package
|
||||||
|
```dart
|
||||||
|
import 'package:mycoreapi/api.dart';
|
||||||
|
```
|
||||||
|
|
||||||
|
## Properties
|
||||||
|
Name | Type | Description | Notes
|
||||||
|
------------ | ------------- | ------------- | -------------
|
||||||
|
**id** | **String** | | [optional]
|
||||||
|
**homeId** | **String** | | [optional]
|
||||||
|
**name** | **String** | | [optional]
|
||||||
|
**activated** | **bool** | | [optional]
|
||||||
|
**isDefault** | **bool** | | [optional]
|
||||||
|
**notification** | **bool** | | [optional]
|
||||||
|
**createdDate** | [**DateTime**](DateTime.md) | | [optional]
|
||||||
|
**updatedDate** | [**DateTime**](DateTime.md) | | [optional]
|
||||||
|
**type** | [**AlarmType**](AlarmType.md) | | [optional]
|
||||||
|
**programmedMode** | [**OneOfProgrammedMode**](OneOfProgrammedMode.md) | | [optional]
|
||||||
|
**geolocalizedMode** | [**OneOfGeolocalizedMode**](OneOfGeolocalizedMode.md) | | [optional]
|
||||||
|
**triggers** | [**List<Trigger>**](Trigger.md) | | [optional] [default to const []]
|
||||||
|
**actions** | [**List<Action>**](Action.md) | | [optional] [default to const []]
|
||||||
|
**devicesIds** | **List<String>** | | [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)
|
||||||
|
|
||||||
|
|
||||||
27
mycore_api/doc/AlarmModeCreateOrUpdateDetailDTO.md
Normal file
27
mycore_api/doc/AlarmModeCreateOrUpdateDetailDTO.md
Normal file
@ -0,0 +1,27 @@
|
|||||||
|
# mycoreapi.model.AlarmModeCreateOrUpdateDetailDTO
|
||||||
|
|
||||||
|
## Load the model package
|
||||||
|
```dart
|
||||||
|
import 'package:mycoreapi/api.dart';
|
||||||
|
```
|
||||||
|
|
||||||
|
## Properties
|
||||||
|
Name | Type | Description | Notes
|
||||||
|
------------ | ------------- | ------------- | -------------
|
||||||
|
**id** | **String** | | [optional]
|
||||||
|
**homeId** | **String** | | [optional]
|
||||||
|
**name** | **String** | | [optional]
|
||||||
|
**type** | [**AlarmType**](AlarmType.md) | | [optional]
|
||||||
|
**activated** | **bool** | | [optional]
|
||||||
|
**isDefault** | **bool** | | [optional]
|
||||||
|
**notification** | **bool** | | [optional]
|
||||||
|
**createdDate** | [**DateTime**](DateTime.md) | | [optional]
|
||||||
|
**updatedDate** | [**DateTime**](DateTime.md) | | [optional]
|
||||||
|
**triggers** | [**List<Trigger>**](Trigger.md) | | [optional] [default to const []]
|
||||||
|
**actions** | [**List<Action>**](Action.md) | | [optional] [default to const []]
|
||||||
|
**programmedMode** | [**OneOfProgrammedMode**](OneOfProgrammedMode.md) | | [optional]
|
||||||
|
**geolocalizedMode** | [**OneOfGeolocalizedMode**](OneOfGeolocalizedMode.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)
|
||||||
|
|
||||||
|
|
||||||
18
mycore_api/doc/AlarmModeCreateOrUpdateDetailDTOAllOf.md
Normal file
18
mycore_api/doc/AlarmModeCreateOrUpdateDetailDTOAllOf.md
Normal file
@ -0,0 +1,18 @@
|
|||||||
|
# mycoreapi.model.AlarmModeCreateOrUpdateDetailDTOAllOf
|
||||||
|
|
||||||
|
## Load the model package
|
||||||
|
```dart
|
||||||
|
import 'package:mycoreapi/api.dart';
|
||||||
|
```
|
||||||
|
|
||||||
|
## Properties
|
||||||
|
Name | Type | Description | Notes
|
||||||
|
------------ | ------------- | ------------- | -------------
|
||||||
|
**triggers** | [**List<Trigger>**](Trigger.md) | | [optional] [default to const []]
|
||||||
|
**actions** | [**List<Action>**](Action.md) | | [optional] [default to const []]
|
||||||
|
**programmedMode** | [**OneOfProgrammedMode**](OneOfProgrammedMode.md) | | [optional]
|
||||||
|
**geolocalizedMode** | [**OneOfGeolocalizedMode**](OneOfGeolocalizedMode.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)
|
||||||
|
|
||||||
|
|
||||||
23
mycore_api/doc/AlarmModeDTO.md
Normal file
23
mycore_api/doc/AlarmModeDTO.md
Normal file
@ -0,0 +1,23 @@
|
|||||||
|
# mycoreapi.model.AlarmModeDTO
|
||||||
|
|
||||||
|
## Load the model package
|
||||||
|
```dart
|
||||||
|
import 'package:mycoreapi/api.dart';
|
||||||
|
```
|
||||||
|
|
||||||
|
## Properties
|
||||||
|
Name | Type | Description | Notes
|
||||||
|
------------ | ------------- | ------------- | -------------
|
||||||
|
**id** | **String** | | [optional]
|
||||||
|
**homeId** | **String** | | [optional]
|
||||||
|
**name** | **String** | | [optional]
|
||||||
|
**type** | [**AlarmType**](AlarmType.md) | | [optional]
|
||||||
|
**activated** | **bool** | | [optional]
|
||||||
|
**isDefault** | **bool** | | [optional]
|
||||||
|
**notification** | **bool** | | [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)
|
||||||
|
|
||||||
|
|
||||||
27
mycore_api/doc/AlarmModeDetailDTO.md
Normal file
27
mycore_api/doc/AlarmModeDetailDTO.md
Normal file
@ -0,0 +1,27 @@
|
|||||||
|
# mycoreapi.model.AlarmModeDetailDTO
|
||||||
|
|
||||||
|
## Load the model package
|
||||||
|
```dart
|
||||||
|
import 'package:mycoreapi/api.dart';
|
||||||
|
```
|
||||||
|
|
||||||
|
## Properties
|
||||||
|
Name | Type | Description | Notes
|
||||||
|
------------ | ------------- | ------------- | -------------
|
||||||
|
**id** | **String** | | [optional]
|
||||||
|
**homeId** | **String** | | [optional]
|
||||||
|
**name** | **String** | | [optional]
|
||||||
|
**type** | [**AlarmType**](AlarmType.md) | | [optional]
|
||||||
|
**activated** | **bool** | | [optional]
|
||||||
|
**isDefault** | **bool** | | [optional]
|
||||||
|
**notification** | **bool** | | [optional]
|
||||||
|
**createdDate** | [**DateTime**](DateTime.md) | | [optional]
|
||||||
|
**updatedDate** | [**DateTime**](DateTime.md) | | [optional]
|
||||||
|
**triggers** | [**List<Trigger>**](Trigger.md) | | [optional] [default to const []]
|
||||||
|
**devices** | [**List<DeviceDetailDTO>**](DeviceDetailDTO.md) | | [optional] [default to const []]
|
||||||
|
**programmedMode** | [**OneOfProgrammedMode**](OneOfProgrammedMode.md) | | [optional]
|
||||||
|
**geolocalizedMode** | [**OneOfGeolocalizedMode**](OneOfGeolocalizedMode.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)
|
||||||
|
|
||||||
|
|
||||||
18
mycore_api/doc/AlarmModeDetailDTOAllOf.md
Normal file
18
mycore_api/doc/AlarmModeDetailDTOAllOf.md
Normal file
@ -0,0 +1,18 @@
|
|||||||
|
# mycoreapi.model.AlarmModeDetailDTOAllOf
|
||||||
|
|
||||||
|
## Load the model package
|
||||||
|
```dart
|
||||||
|
import 'package:mycoreapi/api.dart';
|
||||||
|
```
|
||||||
|
|
||||||
|
## Properties
|
||||||
|
Name | Type | Description | Notes
|
||||||
|
------------ | ------------- | ------------- | -------------
|
||||||
|
**triggers** | [**List<Trigger>**](Trigger.md) | | [optional] [default to const []]
|
||||||
|
**devices** | [**List<DeviceDetailDTO>**](DeviceDetailDTO.md) | | [optional] [default to const []]
|
||||||
|
**programmedMode** | [**OneOfProgrammedMode**](OneOfProgrammedMode.md) | | [optional]
|
||||||
|
**geolocalizedMode** | [**OneOfGeolocalizedMode**](OneOfGeolocalizedMode.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)
|
||||||
|
|
||||||
|
|
||||||
17
mycore_api/doc/AlarmTriggered.md
Normal file
17
mycore_api/doc/AlarmTriggered.md
Normal file
@ -0,0 +1,17 @@
|
|||||||
|
# mycoreapi.model.AlarmTriggered
|
||||||
|
|
||||||
|
## Load the model package
|
||||||
|
```dart
|
||||||
|
import 'package:mycoreapi/api.dart';
|
||||||
|
```
|
||||||
|
|
||||||
|
## Properties
|
||||||
|
Name | Type | Description | Notes
|
||||||
|
------------ | ------------- | ------------- | -------------
|
||||||
|
**alarmModeId** | **String** | | [optional]
|
||||||
|
**alarmModeName** | **String** | | [optional]
|
||||||
|
**type** | [**AlarmType**](AlarmType.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)
|
||||||
|
|
||||||
|
|
||||||
14
mycore_api/doc/AlarmType.md
Normal file
14
mycore_api/doc/AlarmType.md
Normal file
@ -0,0 +1,14 @@
|
|||||||
|
# mycoreapi.model.AlarmType
|
||||||
|
|
||||||
|
## 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)
|
||||||
|
|
||||||
|
|
||||||
@ -5,7 +5,7 @@
|
|||||||
import 'package:mycoreapi/api.dart';
|
import 'package:mycoreapi/api.dart';
|
||||||
```
|
```
|
||||||
|
|
||||||
All URIs are relative to *http://localhost:25049*
|
All URIs are relative to *http://192.168.31.140*
|
||||||
|
|
||||||
Method | HTTP request | Description
|
Method | HTTP request | Description
|
||||||
------------- | ------------- | -------------
|
------------- | ------------- | -------------
|
||||||
|
|||||||
@ -5,20 +5,20 @@
|
|||||||
import 'package:mycoreapi/api.dart';
|
import 'package:mycoreapi/api.dart';
|
||||||
```
|
```
|
||||||
|
|
||||||
All URIs are relative to *http://localhost:25049*
|
All URIs are relative to *http://192.168.31.140*
|
||||||
|
|
||||||
Method | HTTP request | Description
|
Method | HTTP request | Description
|
||||||
------------- | ------------- | -------------
|
------------- | ------------- | -------------
|
||||||
[**automationCreate**](AutomationApi.md#automationcreate) | **POST** /api/automation | Create an automation
|
[**automationCreate**](AutomationApi.md#automationcreate) | **POST** /api/automation | Create an automation
|
||||||
[**automationDelete**](AutomationApi.md#automationdelete) | **DELETE** /api/automation/{automationId} | Delete an 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
|
[**automationDeleteAllForHome**](AutomationApi.md#automationdeleteallforhome) | **DELETE** /api/automation/home/{homeId} | Delete all automation for a specified home
|
||||||
[**automationGetAll**](AutomationApi.md#automationgetall) | **GET** /api/automation/{userId} | Get all automations for the specified user
|
[**automationGetAll**](AutomationApi.md#automationgetall) | **GET** /api/automation/{homeId} | Get all automations for the specified home
|
||||||
[**automationGetDetail**](AutomationApi.md#automationgetdetail) | **GET** /api/automation/detail/{automationId} | Get detail info of a specified automation
|
[**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
|
[**automationUpdate**](AutomationApi.md#automationupdate) | **PUT** /api/automation | Update an automation
|
||||||
|
|
||||||
|
|
||||||
# **automationCreate**
|
# **automationCreate**
|
||||||
> AutomationDTO automationCreate(automationCreateOrUpdateDetailDTO)
|
> AutomationDTO automationCreate(automationDetailDTO)
|
||||||
|
|
||||||
Create an automation
|
Create an automation
|
||||||
|
|
||||||
@ -29,10 +29,10 @@ import 'package:mycoreapi/api.dart';
|
|||||||
//defaultApiClient.getAuthentication<OAuth>('bearer').accessToken = 'YOUR_ACCESS_TOKEN';
|
//defaultApiClient.getAuthentication<OAuth>('bearer').accessToken = 'YOUR_ACCESS_TOKEN';
|
||||||
|
|
||||||
final api_instance = AutomationApi();
|
final api_instance = AutomationApi();
|
||||||
final automationCreateOrUpdateDetailDTO = AutomationCreateOrUpdateDetailDTO(); // AutomationCreateOrUpdateDetailDTO | Automation to create
|
final automationDetailDTO = AutomationDetailDTO(); // AutomationDetailDTO | Automation to create
|
||||||
|
|
||||||
try {
|
try {
|
||||||
final result = api_instance.automationCreate(automationCreateOrUpdateDetailDTO);
|
final result = api_instance.automationCreate(automationDetailDTO);
|
||||||
print(result);
|
print(result);
|
||||||
} catch (e) {
|
} catch (e) {
|
||||||
print('Exception when calling AutomationApi->automationCreate: $e\n');
|
print('Exception when calling AutomationApi->automationCreate: $e\n');
|
||||||
@ -43,7 +43,7 @@ try {
|
|||||||
|
|
||||||
Name | Type | Description | Notes
|
Name | Type | Description | Notes
|
||||||
------------- | ------------- | ------------- | -------------
|
------------- | ------------- | ------------- | -------------
|
||||||
**automationCreateOrUpdateDetailDTO** | [**AutomationCreateOrUpdateDetailDTO**](AutomationCreateOrUpdateDetailDTO.md)| Automation to create |
|
**automationDetailDTO** | [**AutomationDetailDTO**](AutomationDetailDTO.md)| Automation to create |
|
||||||
|
|
||||||
### Return type
|
### Return type
|
||||||
|
|
||||||
@ -103,10 +103,10 @@ Name | Type | Description | Notes
|
|||||||
|
|
||||||
[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md)
|
[[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**
|
# **automationDeleteAllForHome**
|
||||||
> String automationDeleteAllForUser(userId)
|
> String automationDeleteAllForHome(homeId)
|
||||||
|
|
||||||
Delete all automation for a specified
|
Delete all automation for a specified home
|
||||||
|
|
||||||
### Example
|
### Example
|
||||||
```dart
|
```dart
|
||||||
@ -115,13 +115,13 @@ import 'package:mycoreapi/api.dart';
|
|||||||
//defaultApiClient.getAuthentication<OAuth>('bearer').accessToken = 'YOUR_ACCESS_TOKEN';
|
//defaultApiClient.getAuthentication<OAuth>('bearer').accessToken = 'YOUR_ACCESS_TOKEN';
|
||||||
|
|
||||||
final api_instance = AutomationApi();
|
final api_instance = AutomationApi();
|
||||||
final userId = userId_example; // String | Id of user
|
final homeId = homeId_example; // String | Home Id
|
||||||
|
|
||||||
try {
|
try {
|
||||||
final result = api_instance.automationDeleteAllForUser(userId);
|
final result = api_instance.automationDeleteAllForHome(homeId);
|
||||||
print(result);
|
print(result);
|
||||||
} catch (e) {
|
} catch (e) {
|
||||||
print('Exception when calling AutomationApi->automationDeleteAllForUser: $e\n');
|
print('Exception when calling AutomationApi->automationDeleteAllForHome: $e\n');
|
||||||
}
|
}
|
||||||
```
|
```
|
||||||
|
|
||||||
@ -129,7 +129,7 @@ try {
|
|||||||
|
|
||||||
Name | Type | Description | Notes
|
Name | Type | Description | Notes
|
||||||
------------- | ------------- | ------------- | -------------
|
------------- | ------------- | ------------- | -------------
|
||||||
**userId** | **String**| Id of user |
|
**homeId** | **String**| Home Id |
|
||||||
|
|
||||||
### Return type
|
### Return type
|
||||||
|
|
||||||
@ -147,9 +147,9 @@ Name | Type | Description | Notes
|
|||||||
[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md)
|
[[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**
|
# **automationGetAll**
|
||||||
> List<RoomSummaryDTO> automationGetAll(userId)
|
> List<AutomationDTO> automationGetAll(homeId)
|
||||||
|
|
||||||
Get all automations for the specified user
|
Get all automations for the specified home
|
||||||
|
|
||||||
### Example
|
### Example
|
||||||
```dart
|
```dart
|
||||||
@ -158,10 +158,10 @@ import 'package:mycoreapi/api.dart';
|
|||||||
//defaultApiClient.getAuthentication<OAuth>('bearer').accessToken = 'YOUR_ACCESS_TOKEN';
|
//defaultApiClient.getAuthentication<OAuth>('bearer').accessToken = 'YOUR_ACCESS_TOKEN';
|
||||||
|
|
||||||
final api_instance = AutomationApi();
|
final api_instance = AutomationApi();
|
||||||
final userId = userId_example; // String | Id of user
|
final homeId = homeId_example; // String | Home Id
|
||||||
|
|
||||||
try {
|
try {
|
||||||
final result = api_instance.automationGetAll(userId);
|
final result = api_instance.automationGetAll(homeId);
|
||||||
print(result);
|
print(result);
|
||||||
} catch (e) {
|
} catch (e) {
|
||||||
print('Exception when calling AutomationApi->automationGetAll: $e\n');
|
print('Exception when calling AutomationApi->automationGetAll: $e\n');
|
||||||
@ -172,11 +172,11 @@ try {
|
|||||||
|
|
||||||
Name | Type | Description | Notes
|
Name | Type | Description | Notes
|
||||||
------------- | ------------- | ------------- | -------------
|
------------- | ------------- | ------------- | -------------
|
||||||
**userId** | **String**| Id of user |
|
**homeId** | **String**| Home Id |
|
||||||
|
|
||||||
### Return type
|
### Return type
|
||||||
|
|
||||||
[**List<RoomSummaryDTO>**](RoomSummaryDTO.md)
|
[**List<AutomationDTO>**](AutomationDTO.md)
|
||||||
|
|
||||||
### Authorization
|
### Authorization
|
||||||
|
|
||||||
@ -233,7 +233,7 @@ Name | Type | Description | Notes
|
|||||||
[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md)
|
[[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**
|
# **automationUpdate**
|
||||||
> AutomationCreateOrUpdateDetailDTO automationUpdate(automationCreateOrUpdateDetailDTO)
|
> AutomationDetailDTO automationUpdate(automationDetailDTO)
|
||||||
|
|
||||||
Update an automation
|
Update an automation
|
||||||
|
|
||||||
@ -244,10 +244,10 @@ import 'package:mycoreapi/api.dart';
|
|||||||
//defaultApiClient.getAuthentication<OAuth>('bearer').accessToken = 'YOUR_ACCESS_TOKEN';
|
//defaultApiClient.getAuthentication<OAuth>('bearer').accessToken = 'YOUR_ACCESS_TOKEN';
|
||||||
|
|
||||||
final api_instance = AutomationApi();
|
final api_instance = AutomationApi();
|
||||||
final automationCreateOrUpdateDetailDTO = AutomationCreateOrUpdateDetailDTO(); // AutomationCreateOrUpdateDetailDTO | automation to update
|
final automationDetailDTO = AutomationDetailDTO(); // AutomationDetailDTO | automation to update
|
||||||
|
|
||||||
try {
|
try {
|
||||||
final result = api_instance.automationUpdate(automationCreateOrUpdateDetailDTO);
|
final result = api_instance.automationUpdate(automationDetailDTO);
|
||||||
print(result);
|
print(result);
|
||||||
} catch (e) {
|
} catch (e) {
|
||||||
print('Exception when calling AutomationApi->automationUpdate: $e\n');
|
print('Exception when calling AutomationApi->automationUpdate: $e\n');
|
||||||
@ -258,11 +258,11 @@ try {
|
|||||||
|
|
||||||
Name | Type | Description | Notes
|
Name | Type | Description | Notes
|
||||||
------------- | ------------- | ------------- | -------------
|
------------- | ------------- | ------------- | -------------
|
||||||
**automationCreateOrUpdateDetailDTO** | [**AutomationCreateOrUpdateDetailDTO**](AutomationCreateOrUpdateDetailDTO.md)| automation to update |
|
**automationDetailDTO** | [**AutomationDetailDTO**](AutomationDetailDTO.md)| automation to update |
|
||||||
|
|
||||||
### Return type
|
### Return type
|
||||||
|
|
||||||
[**AutomationCreateOrUpdateDetailDTO**](AutomationCreateOrUpdateDetailDTO.md)
|
[**AutomationDetailDTO**](AutomationDetailDTO.md)
|
||||||
|
|
||||||
### Authorization
|
### Authorization
|
||||||
|
|
||||||
|
|||||||
@ -11,7 +11,7 @@ Name | Type | Description | Notes
|
|||||||
**id** | **String** | | [optional]
|
**id** | **String** | | [optional]
|
||||||
**name** | **String** | | [optional]
|
**name** | **String** | | [optional]
|
||||||
**active** | **bool** | | [optional]
|
**active** | **bool** | | [optional]
|
||||||
**userId** | **String** | | [optional]
|
**homeId** | **String** | | [optional]
|
||||||
**createdDate** | [**DateTime**](DateTime.md) | | [optional]
|
**createdDate** | [**DateTime**](DateTime.md) | | [optional]
|
||||||
**updatedDate** | [**DateTime**](DateTime.md) | | [optional]
|
**updatedDate** | [**DateTime**](DateTime.md) | | [optional]
|
||||||
|
|
||||||
|
|||||||
@ -11,7 +11,7 @@ Name | Type | Description | Notes
|
|||||||
**id** | **String** | | [optional]
|
**id** | **String** | | [optional]
|
||||||
**name** | **String** | | [optional]
|
**name** | **String** | | [optional]
|
||||||
**active** | **bool** | | [optional]
|
**active** | **bool** | | [optional]
|
||||||
**userId** | **String** | | [optional]
|
**homeId** | **String** | | [optional]
|
||||||
**createdDate** | [**DateTime**](DateTime.md) | | [optional]
|
**createdDate** | [**DateTime**](DateTime.md) | | [optional]
|
||||||
**updatedDate** | [**DateTime**](DateTime.md) | | [optional]
|
**updatedDate** | [**DateTime**](DateTime.md) | | [optional]
|
||||||
**triggers** | [**List<Trigger>**](Trigger.md) | | [optional] [default to const []]
|
**triggers** | [**List<Trigger>**](Trigger.md) | | [optional] [default to const []]
|
||||||
|
|||||||
16
mycore_api/doc/AutomationTriggered.md
Normal file
16
mycore_api/doc/AutomationTriggered.md
Normal file
@ -0,0 +1,16 @@
|
|||||||
|
# mycoreapi.model.AutomationTriggered
|
||||||
|
|
||||||
|
## Load the model package
|
||||||
|
```dart
|
||||||
|
import 'package:mycoreapi/api.dart';
|
||||||
|
```
|
||||||
|
|
||||||
|
## Properties
|
||||||
|
Name | Type | Description | Notes
|
||||||
|
------------ | ------------- | ------------- | -------------
|
||||||
|
**automationId** | **String** | | [optional]
|
||||||
|
**automationName** | **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)
|
||||||
|
|
||||||
|
|
||||||
@ -5,7 +5,7 @@
|
|||||||
import 'package:mycoreapi/api.dart';
|
import 'package:mycoreapi/api.dart';
|
||||||
```
|
```
|
||||||
|
|
||||||
All URIs are relative to *http://localhost:25049*
|
All URIs are relative to *http://192.168.31.140*
|
||||||
|
|
||||||
Method | HTTP request | Description
|
Method | HTTP request | Description
|
||||||
------------- | ------------- | -------------
|
------------- | ------------- | -------------
|
||||||
|
|||||||
@ -5,7 +5,7 @@
|
|||||||
import 'package:mycoreapi/api.dart';
|
import 'package:mycoreapi/api.dart';
|
||||||
```
|
```
|
||||||
|
|
||||||
All URIs are relative to *http://localhost:25049*
|
All URIs are relative to *http://192.168.31.140*
|
||||||
|
|
||||||
Method | HTTP request | Description
|
Method | HTTP request | Description
|
||||||
------------- | ------------- | -------------
|
------------- | ------------- | -------------
|
||||||
|
|||||||
22
mycore_api/doc/CreateOrUpdateHomeDTO.md
Normal file
22
mycore_api/doc/CreateOrUpdateHomeDTO.md
Normal file
@ -0,0 +1,22 @@
|
|||||||
|
# mycoreapi.model.CreateOrUpdateHomeDTO
|
||||||
|
|
||||||
|
## Load the model package
|
||||||
|
```dart
|
||||||
|
import 'package:mycoreapi/api.dart';
|
||||||
|
```
|
||||||
|
|
||||||
|
## Properties
|
||||||
|
Name | Type | Description | Notes
|
||||||
|
------------ | ------------- | ------------- | -------------
|
||||||
|
**id** | **String** | | [optional]
|
||||||
|
**name** | **String** | | [optional]
|
||||||
|
**isAlarm** | **bool** | | [optional]
|
||||||
|
**isDefault** | **bool** | | [optional]
|
||||||
|
**currentAlarmMode** | [**OneOfAlarmModeDTO**](OneOfAlarmModeDTO.md) | | [optional]
|
||||||
|
**createdDate** | [**DateTime**](DateTime.md) | | [optional]
|
||||||
|
**updatedDate** | [**DateTime**](DateTime.md) | | [optional]
|
||||||
|
**usersIds** | **List<String>** | | [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)
|
||||||
|
|
||||||
|
|
||||||
15
mycore_api/doc/CreateOrUpdateHomeDTOAllOf.md
Normal file
15
mycore_api/doc/CreateOrUpdateHomeDTOAllOf.md
Normal file
@ -0,0 +1,15 @@
|
|||||||
|
# mycoreapi.model.CreateOrUpdateHomeDTOAllOf
|
||||||
|
|
||||||
|
## Load the model package
|
||||||
|
```dart
|
||||||
|
import 'package:mycoreapi/api.dart';
|
||||||
|
```
|
||||||
|
|
||||||
|
## Properties
|
||||||
|
Name | Type | Description | Notes
|
||||||
|
------------ | ------------- | ------------- | -------------
|
||||||
|
**usersIds** | **List<String>** | | [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)
|
||||||
|
|
||||||
|
|
||||||
@ -5,20 +5,20 @@
|
|||||||
import 'package:mycoreapi/api.dart';
|
import 'package:mycoreapi/api.dart';
|
||||||
```
|
```
|
||||||
|
|
||||||
All URIs are relative to *http://localhost:25049*
|
All URIs are relative to *http://192.168.31.140*
|
||||||
|
|
||||||
Method | HTTP request | Description
|
Method | HTTP request | Description
|
||||||
------------- | ------------- | -------------
|
------------- | ------------- | -------------
|
||||||
[**deviceCreate**](DeviceApi.md#devicecreate) | **POST** /api/device | Create a device
|
[**deviceCreate**](DeviceApi.md#devicecreate) | **POST** /api/device | Create a device
|
||||||
[**deviceCreateDevicesFromProvider**](DeviceApi.md#devicecreatedevicesfromprovider) | **POST** /api/device/{userId}/fromProvider/{providerId} | Create devices from provider
|
[**deviceCreateDevicesFromProvider**](DeviceApi.md#devicecreatedevicesfromprovider) | **POST** /api/device/{homeId}/fromProvider/{providerId} | Create devices from provider
|
||||||
[**deviceDelete**](DeviceApi.md#devicedelete) | **DELETE** /api/device/{deviceId} | Delete a device
|
[**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 user
|
[**deviceDeleteAllForHome**](DeviceApi.md#devicedeleteallforhome) | **DELETE** /api/device/home/{homeId} | Delete all device for a specified home
|
||||||
[**deviceDeleteDevicesFromProvider**](DeviceApi.md#devicedeletedevicesfromprovider) | **DELETE** /api/device/{userId}/fromProvider/{providerId} | Delete devices from provider
|
[**deviceDeleteDevicesFromProvider**](DeviceApi.md#devicedeletedevicesfromprovider) | **DELETE** /api/device/{homeId}/fromProvider/{providerId} | Delete devices from provider
|
||||||
[**deviceGetAll**](DeviceApi.md#devicegetall) | **GET** /api/device/{userId} | Get all devices summary
|
[**deviceGetAll**](DeviceApi.md#devicegetall) | **GET** /api/device/{homeId} | Get all devices summary
|
||||||
[**deviceGetDetail**](DeviceApi.md#devicegetdetail) | **GET** /api/device/detail/{deviceId} | Get a specific device info
|
[**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
|
[**deviceGetDevicesByType**](DeviceApi.md#devicegetdevicesbytype) | **GET** /api/device/{homeId}/type/{type} | Get list of devices from a type
|
||||||
[**deviceGetDevicesFromProvider**](DeviceApi.md#devicegetdevicesfromprovider) | **GET** /api/device/{userId}/fromProvider/{providerId} | Get devices from provider
|
[**deviceGetDevicesFromProvider**](DeviceApi.md#devicegetdevicesfromprovider) | **GET** /api/device/{homeId}/fromProvider/{providerId} | Get devices from provider
|
||||||
[**deviceGetDevicesFromZigbee2Mqtt**](DeviceApi.md#devicegetdevicesfromzigbee2mqtt) | **GET** /api/device/zigbee2Mqtt/{userId} | Get all zigbee2Mqtt devices
|
[**deviceGetDevicesFromZigbee2Mqtt**](DeviceApi.md#devicegetdevicesfromzigbee2mqtt) | **GET** /api/device/zigbee2Mqtt/{homeId} | Get all zigbee2Mqtt devices
|
||||||
[**deviceUpdate**](DeviceApi.md#deviceupdate) | **PUT** /api/device/{deviceId} | Update a device
|
[**deviceUpdate**](DeviceApi.md#deviceupdate) | **PUT** /api/device/{deviceId} | Update a device
|
||||||
|
|
||||||
|
|
||||||
@ -66,7 +66,7 @@ Name | Type | Description | Notes
|
|||||||
[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md)
|
[[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**
|
# **deviceCreateDevicesFromProvider**
|
||||||
> List<DeviceDetailDTO> deviceCreateDevicesFromProvider(userId, providerId)
|
> List<DeviceDetailDTO> deviceCreateDevicesFromProvider(homeId, providerId)
|
||||||
|
|
||||||
Create devices from provider
|
Create devices from provider
|
||||||
|
|
||||||
@ -77,11 +77,11 @@ import 'package:mycoreapi/api.dart';
|
|||||||
//defaultApiClient.getAuthentication<OAuth>('bearer').accessToken = 'YOUR_ACCESS_TOKEN';
|
//defaultApiClient.getAuthentication<OAuth>('bearer').accessToken = 'YOUR_ACCESS_TOKEN';
|
||||||
|
|
||||||
final api_instance = DeviceApi();
|
final api_instance = DeviceApi();
|
||||||
final userId = userId_example; // String | User Id
|
final homeId = homeId_example; // String | Home Id
|
||||||
final providerId = providerId_example; // String | Id of Provider
|
final providerId = providerId_example; // String | Id of Provider
|
||||||
|
|
||||||
try {
|
try {
|
||||||
final result = api_instance.deviceCreateDevicesFromProvider(userId, providerId);
|
final result = api_instance.deviceCreateDevicesFromProvider(homeId, providerId);
|
||||||
print(result);
|
print(result);
|
||||||
} catch (e) {
|
} catch (e) {
|
||||||
print('Exception when calling DeviceApi->deviceCreateDevicesFromProvider: $e\n');
|
print('Exception when calling DeviceApi->deviceCreateDevicesFromProvider: $e\n');
|
||||||
@ -92,7 +92,7 @@ try {
|
|||||||
|
|
||||||
Name | Type | Description | Notes
|
Name | Type | Description | Notes
|
||||||
------------- | ------------- | ------------- | -------------
|
------------- | ------------- | ------------- | -------------
|
||||||
**userId** | **String**| User Id |
|
**homeId** | **String**| Home Id |
|
||||||
**providerId** | **String**| Id of Provider |
|
**providerId** | **String**| Id of Provider |
|
||||||
|
|
||||||
### Return type
|
### Return type
|
||||||
@ -153,10 +153,10 @@ Name | Type | Description | Notes
|
|||||||
|
|
||||||
[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md)
|
[[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**
|
# **deviceDeleteAllForHome**
|
||||||
> String deviceDeleteAllForUser(userId)
|
> String deviceDeleteAllForHome(homeId)
|
||||||
|
|
||||||
Delete all device for a specified user
|
Delete all device for a specified home
|
||||||
|
|
||||||
### Example
|
### Example
|
||||||
```dart
|
```dart
|
||||||
@ -165,13 +165,13 @@ import 'package:mycoreapi/api.dart';
|
|||||||
//defaultApiClient.getAuthentication<OAuth>('bearer').accessToken = 'YOUR_ACCESS_TOKEN';
|
//defaultApiClient.getAuthentication<OAuth>('bearer').accessToken = 'YOUR_ACCESS_TOKEN';
|
||||||
|
|
||||||
final api_instance = DeviceApi();
|
final api_instance = DeviceApi();
|
||||||
final userId = userId_example; // String | Id of user
|
final homeId = homeId_example; // String | Id of home
|
||||||
|
|
||||||
try {
|
try {
|
||||||
final result = api_instance.deviceDeleteAllForUser(userId);
|
final result = api_instance.deviceDeleteAllForHome(homeId);
|
||||||
print(result);
|
print(result);
|
||||||
} catch (e) {
|
} catch (e) {
|
||||||
print('Exception when calling DeviceApi->deviceDeleteAllForUser: $e\n');
|
print('Exception when calling DeviceApi->deviceDeleteAllForHome: $e\n');
|
||||||
}
|
}
|
||||||
```
|
```
|
||||||
|
|
||||||
@ -179,7 +179,7 @@ try {
|
|||||||
|
|
||||||
Name | Type | Description | Notes
|
Name | Type | Description | Notes
|
||||||
------------- | ------------- | ------------- | -------------
|
------------- | ------------- | ------------- | -------------
|
||||||
**userId** | **String**| Id of user |
|
**homeId** | **String**| Id of home |
|
||||||
|
|
||||||
### Return type
|
### Return type
|
||||||
|
|
||||||
@ -197,7 +197,7 @@ Name | Type | Description | Notes
|
|||||||
[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md)
|
[[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**
|
# **deviceDeleteDevicesFromProvider**
|
||||||
> String deviceDeleteDevicesFromProvider(userId, providerId)
|
> String deviceDeleteDevicesFromProvider(homeId, providerId)
|
||||||
|
|
||||||
Delete devices from provider
|
Delete devices from provider
|
||||||
|
|
||||||
@ -208,11 +208,11 @@ import 'package:mycoreapi/api.dart';
|
|||||||
//defaultApiClient.getAuthentication<OAuth>('bearer').accessToken = 'YOUR_ACCESS_TOKEN';
|
//defaultApiClient.getAuthentication<OAuth>('bearer').accessToken = 'YOUR_ACCESS_TOKEN';
|
||||||
|
|
||||||
final api_instance = DeviceApi();
|
final api_instance = DeviceApi();
|
||||||
final userId = userId_example; // String | User Id
|
final homeId = homeId_example; // String | Home Id
|
||||||
final providerId = providerId_example; // String | Id of Provider
|
final providerId = providerId_example; // String | Id of Provider
|
||||||
|
|
||||||
try {
|
try {
|
||||||
final result = api_instance.deviceDeleteDevicesFromProvider(userId, providerId);
|
final result = api_instance.deviceDeleteDevicesFromProvider(homeId, providerId);
|
||||||
print(result);
|
print(result);
|
||||||
} catch (e) {
|
} catch (e) {
|
||||||
print('Exception when calling DeviceApi->deviceDeleteDevicesFromProvider: $e\n');
|
print('Exception when calling DeviceApi->deviceDeleteDevicesFromProvider: $e\n');
|
||||||
@ -223,7 +223,7 @@ try {
|
|||||||
|
|
||||||
Name | Type | Description | Notes
|
Name | Type | Description | Notes
|
||||||
------------- | ------------- | ------------- | -------------
|
------------- | ------------- | ------------- | -------------
|
||||||
**userId** | **String**| User Id |
|
**homeId** | **String**| Home Id |
|
||||||
**providerId** | **String**| Id of Provider |
|
**providerId** | **String**| Id of Provider |
|
||||||
|
|
||||||
### Return type
|
### Return type
|
||||||
@ -242,7 +242,7 @@ Name | Type | Description | Notes
|
|||||||
[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md)
|
[[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**
|
# **deviceGetAll**
|
||||||
> List<DeviceSummaryDTO> deviceGetAll(userId)
|
> List<DeviceSummaryDTO> deviceGetAll(homeId)
|
||||||
|
|
||||||
Get all devices summary
|
Get all devices summary
|
||||||
|
|
||||||
@ -253,10 +253,10 @@ import 'package:mycoreapi/api.dart';
|
|||||||
//defaultApiClient.getAuthentication<OAuth>('bearer').accessToken = 'YOUR_ACCESS_TOKEN';
|
//defaultApiClient.getAuthentication<OAuth>('bearer').accessToken = 'YOUR_ACCESS_TOKEN';
|
||||||
|
|
||||||
final api_instance = DeviceApi();
|
final api_instance = DeviceApi();
|
||||||
final userId = userId_example; // String | Id of user
|
final homeId = homeId_example; // String | Home Id
|
||||||
|
|
||||||
try {
|
try {
|
||||||
final result = api_instance.deviceGetAll(userId);
|
final result = api_instance.deviceGetAll(homeId);
|
||||||
print(result);
|
print(result);
|
||||||
} catch (e) {
|
} catch (e) {
|
||||||
print('Exception when calling DeviceApi->deviceGetAll: $e\n');
|
print('Exception when calling DeviceApi->deviceGetAll: $e\n');
|
||||||
@ -267,7 +267,7 @@ try {
|
|||||||
|
|
||||||
Name | Type | Description | Notes
|
Name | Type | Description | Notes
|
||||||
------------- | ------------- | ------------- | -------------
|
------------- | ------------- | ------------- | -------------
|
||||||
**userId** | **String**| Id of user |
|
**homeId** | **String**| Home Id |
|
||||||
|
|
||||||
### Return type
|
### Return type
|
||||||
|
|
||||||
@ -328,7 +328,7 @@ Name | Type | Description | Notes
|
|||||||
[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md)
|
[[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**
|
# **deviceGetDevicesByType**
|
||||||
> List<DeviceDetailDTO> deviceGetDevicesByType(userId, type)
|
> List<DeviceDetailDTO> deviceGetDevicesByType(homeId, type)
|
||||||
|
|
||||||
Get list of devices from a type
|
Get list of devices from a type
|
||||||
|
|
||||||
@ -339,11 +339,11 @@ import 'package:mycoreapi/api.dart';
|
|||||||
//defaultApiClient.getAuthentication<OAuth>('bearer').accessToken = 'YOUR_ACCESS_TOKEN';
|
//defaultApiClient.getAuthentication<OAuth>('bearer').accessToken = 'YOUR_ACCESS_TOKEN';
|
||||||
|
|
||||||
final api_instance = DeviceApi();
|
final api_instance = DeviceApi();
|
||||||
final userId = userId_example; // String | user Id
|
final homeId = homeId_example; // String | Home Id
|
||||||
final type = ; // DeviceType | device type
|
final type = ; // DeviceType | device type
|
||||||
|
|
||||||
try {
|
try {
|
||||||
final result = api_instance.deviceGetDevicesByType(userId, type);
|
final result = api_instance.deviceGetDevicesByType(homeId, type);
|
||||||
print(result);
|
print(result);
|
||||||
} catch (e) {
|
} catch (e) {
|
||||||
print('Exception when calling DeviceApi->deviceGetDevicesByType: $e\n');
|
print('Exception when calling DeviceApi->deviceGetDevicesByType: $e\n');
|
||||||
@ -354,7 +354,7 @@ try {
|
|||||||
|
|
||||||
Name | Type | Description | Notes
|
Name | Type | Description | Notes
|
||||||
------------- | ------------- | ------------- | -------------
|
------------- | ------------- | ------------- | -------------
|
||||||
**userId** | **String**| user Id |
|
**homeId** | **String**| Home Id |
|
||||||
**type** | [**DeviceType**](.md)| device type |
|
**type** | [**DeviceType**](.md)| device type |
|
||||||
|
|
||||||
### Return type
|
### Return type
|
||||||
@ -373,7 +373,7 @@ Name | Type | Description | Notes
|
|||||||
[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md)
|
[[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**
|
# **deviceGetDevicesFromProvider**
|
||||||
> List<DeviceDetailDTO> deviceGetDevicesFromProvider(userId, providerId)
|
> List<DeviceDetailDTO> deviceGetDevicesFromProvider(homeId, providerId)
|
||||||
|
|
||||||
Get devices from provider
|
Get devices from provider
|
||||||
|
|
||||||
@ -384,11 +384,11 @@ import 'package:mycoreapi/api.dart';
|
|||||||
//defaultApiClient.getAuthentication<OAuth>('bearer').accessToken = 'YOUR_ACCESS_TOKEN';
|
//defaultApiClient.getAuthentication<OAuth>('bearer').accessToken = 'YOUR_ACCESS_TOKEN';
|
||||||
|
|
||||||
final api_instance = DeviceApi();
|
final api_instance = DeviceApi();
|
||||||
final userId = userId_example; // String | User Id
|
final homeId = homeId_example; // String | Home Id
|
||||||
final providerId = providerId_example; // String | Id of Provider
|
final providerId = providerId_example; // String | Id of Provider
|
||||||
|
|
||||||
try {
|
try {
|
||||||
final result = api_instance.deviceGetDevicesFromProvider(userId, providerId);
|
final result = api_instance.deviceGetDevicesFromProvider(homeId, providerId);
|
||||||
print(result);
|
print(result);
|
||||||
} catch (e) {
|
} catch (e) {
|
||||||
print('Exception when calling DeviceApi->deviceGetDevicesFromProvider: $e\n');
|
print('Exception when calling DeviceApi->deviceGetDevicesFromProvider: $e\n');
|
||||||
@ -399,7 +399,7 @@ try {
|
|||||||
|
|
||||||
Name | Type | Description | Notes
|
Name | Type | Description | Notes
|
||||||
------------- | ------------- | ------------- | -------------
|
------------- | ------------- | ------------- | -------------
|
||||||
**userId** | **String**| User Id |
|
**homeId** | **String**| Home Id |
|
||||||
**providerId** | **String**| Id of Provider |
|
**providerId** | **String**| Id of Provider |
|
||||||
|
|
||||||
### Return type
|
### Return type
|
||||||
@ -418,7 +418,7 @@ Name | Type | Description | Notes
|
|||||||
[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md)
|
[[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**
|
# **deviceGetDevicesFromZigbee2Mqtt**
|
||||||
> List<DeviceDetailDTO> deviceGetDevicesFromZigbee2Mqtt(userId)
|
> List<DeviceDetailDTO> deviceGetDevicesFromZigbee2Mqtt(homeId)
|
||||||
|
|
||||||
Get all zigbee2Mqtt devices
|
Get all zigbee2Mqtt devices
|
||||||
|
|
||||||
@ -429,10 +429,10 @@ import 'package:mycoreapi/api.dart';
|
|||||||
//defaultApiClient.getAuthentication<OAuth>('bearer').accessToken = 'YOUR_ACCESS_TOKEN';
|
//defaultApiClient.getAuthentication<OAuth>('bearer').accessToken = 'YOUR_ACCESS_TOKEN';
|
||||||
|
|
||||||
final api_instance = DeviceApi();
|
final api_instance = DeviceApi();
|
||||||
final userId = userId_example; // String | User Id
|
final homeId = homeId_example; // String | Home Id
|
||||||
|
|
||||||
try {
|
try {
|
||||||
final result = api_instance.deviceGetDevicesFromZigbee2Mqtt(userId);
|
final result = api_instance.deviceGetDevicesFromZigbee2Mqtt(homeId);
|
||||||
print(result);
|
print(result);
|
||||||
} catch (e) {
|
} catch (e) {
|
||||||
print('Exception when calling DeviceApi->deviceGetDevicesFromZigbee2Mqtt: $e\n');
|
print('Exception when calling DeviceApi->deviceGetDevicesFromZigbee2Mqtt: $e\n');
|
||||||
@ -443,7 +443,7 @@ try {
|
|||||||
|
|
||||||
Name | Type | Description | Notes
|
Name | Type | Description | Notes
|
||||||
------------- | ------------- | ------------- | -------------
|
------------- | ------------- | ------------- | -------------
|
||||||
**userId** | **String**| User Id |
|
**homeId** | **String**| Home Id |
|
||||||
|
|
||||||
### Return type
|
### Return type
|
||||||
|
|
||||||
|
|||||||
@ -9,17 +9,16 @@ import 'package:mycoreapi/api.dart';
|
|||||||
Name | Type | Description | Notes
|
Name | Type | Description | Notes
|
||||||
------------ | ------------- | ------------- | -------------
|
------------ | ------------- | ------------- | -------------
|
||||||
**id** | **String** | | [optional]
|
**id** | **String** | | [optional]
|
||||||
**userId** | **String** | | [optional]
|
**homeId** | **String** | | [optional]
|
||||||
**description** | **String** | | [optional]
|
**description** | **String** | | [optional]
|
||||||
**name** | **String** | | [optional]
|
**name** | **String** | | [optional]
|
||||||
**model** | **String** | | [optional]
|
**model** | **String** | | [optional]
|
||||||
**type** | [**DeviceType**](DeviceType.md) | | [optional]
|
**type** | [**DeviceType**](DeviceType.md) | | [optional]
|
||||||
**status** | **bool** | | [optional]
|
**status** | **bool** | | [optional]
|
||||||
**connectionStatus** | [**ConnectionStatus**](ConnectionStatus.md) | | [optional]
|
**connectionStatus** | [**ConnectionStatus**](ConnectionStatus.md) | | [optional]
|
||||||
**locationId** | **String** | | [optional]
|
**roomId** | **String** | | [optional]
|
||||||
**providerId** | **String** | | [optional]
|
**providerId** | **String** | | [optional]
|
||||||
**providerName** | **String** | | [optional]
|
**providerName** | **String** | | [optional]
|
||||||
**location** | [**OneOfPlaceDTO**](OneOfPlaceDTO.md) | | [optional]
|
|
||||||
**lastStateDate** | [**DateTime**](DateTime.md) | | [optional]
|
**lastStateDate** | [**DateTime**](DateTime.md) | | [optional]
|
||||||
**battery** | **bool** | | [optional]
|
**battery** | **bool** | | [optional]
|
||||||
**batteryStatus** | **int** | | [optional]
|
**batteryStatus** | **int** | | [optional]
|
||||||
|
|||||||
18
mycore_api/doc/DeviceState.md
Normal file
18
mycore_api/doc/DeviceState.md
Normal file
@ -0,0 +1,18 @@
|
|||||||
|
# mycoreapi.model.DeviceState
|
||||||
|
|
||||||
|
## Load the model package
|
||||||
|
```dart
|
||||||
|
import 'package:mycoreapi/api.dart';
|
||||||
|
```
|
||||||
|
|
||||||
|
## Properties
|
||||||
|
Name | Type | Description | Notes
|
||||||
|
------------ | ------------- | ------------- | -------------
|
||||||
|
**deviceId** | **String** | | [optional]
|
||||||
|
**deviceName** | **String** | | [optional]
|
||||||
|
**message** | **String** | | [optional]
|
||||||
|
**deviceType** | [**DeviceType**](DeviceType.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)
|
||||||
|
|
||||||
|
|
||||||
@ -9,17 +9,16 @@ import 'package:mycoreapi/api.dart';
|
|||||||
Name | Type | Description | Notes
|
Name | Type | Description | Notes
|
||||||
------------ | ------------- | ------------- | -------------
|
------------ | ------------- | ------------- | -------------
|
||||||
**id** | **String** | | [optional]
|
**id** | **String** | | [optional]
|
||||||
**userId** | **String** | | [optional]
|
**homeId** | **String** | | [optional]
|
||||||
**description** | **String** | | [optional]
|
**description** | **String** | | [optional]
|
||||||
**name** | **String** | | [optional]
|
**name** | **String** | | [optional]
|
||||||
**model** | **String** | | [optional]
|
**model** | **String** | | [optional]
|
||||||
**type** | [**DeviceType**](DeviceType.md) | | [optional]
|
**type** | [**DeviceType**](DeviceType.md) | | [optional]
|
||||||
**status** | **bool** | | [optional]
|
**status** | **bool** | | [optional]
|
||||||
**connectionStatus** | [**ConnectionStatus**](ConnectionStatus.md) | | [optional]
|
**connectionStatus** | [**ConnectionStatus**](ConnectionStatus.md) | | [optional]
|
||||||
**locationId** | **String** | | [optional]
|
**roomId** | **String** | | [optional]
|
||||||
**providerId** | **String** | | [optional]
|
**providerId** | **String** | | [optional]
|
||||||
**providerName** | **String** | | [optional]
|
**providerName** | **String** | | [optional]
|
||||||
**location** | [**OneOfPlaceDTO**](OneOfPlaceDTO.md) | | [optional]
|
|
||||||
**lastStateDate** | [**DateTime**](DateTime.md) | | [optional]
|
**lastStateDate** | [**DateTime**](DateTime.md) | | [optional]
|
||||||
**battery** | **bool** | | [optional]
|
**battery** | **bool** | | [optional]
|
||||||
**batteryStatus** | **int** | | [optional]
|
**batteryStatus** | **int** | | [optional]
|
||||||
|
|||||||
@ -10,7 +10,7 @@ Name | Type | Description | Notes
|
|||||||
------------ | ------------- | ------------- | -------------
|
------------ | ------------- | ------------- | -------------
|
||||||
**id** | **String** | | [optional]
|
**id** | **String** | | [optional]
|
||||||
**deviceId** | **String** | | [optional]
|
**deviceId** | **String** | | [optional]
|
||||||
**userId** | **String** | | [optional]
|
**homeId** | **String** | | [optional]
|
||||||
**watt** | **double** | | [optional]
|
**watt** | **double** | | [optional]
|
||||||
**ampere** | **double** | | [optional]
|
**ampere** | **double** | | [optional]
|
||||||
**timestamp** | [**DateTime**](DateTime.md) | | [optional]
|
**timestamp** | [**DateTime**](DateTime.md) | | [optional]
|
||||||
|
|||||||
@ -5,7 +5,7 @@
|
|||||||
import 'package:mycoreapi/api.dart';
|
import 'package:mycoreapi/api.dart';
|
||||||
```
|
```
|
||||||
|
|
||||||
All URIs are relative to *http://localhost:25049*
|
All URIs are relative to *http://192.168.31.140*
|
||||||
|
|
||||||
Method | HTTP request | Description
|
Method | HTTP request | Description
|
||||||
------------- | ------------- | -------------
|
------------- | ------------- | -------------
|
||||||
@ -13,7 +13,7 @@ Method | HTTP request | Description
|
|||||||
|
|
||||||
|
|
||||||
# **energyGetElectricityProduction**
|
# **energyGetElectricityProduction**
|
||||||
> List<ElectricityProduction> energyGetElectricityProduction(userId, viewBy)
|
> List<ElectricityProduction> energyGetElectricityProduction(homeId, viewBy)
|
||||||
|
|
||||||
Get summary production of Kwh/Year
|
Get summary production of Kwh/Year
|
||||||
|
|
||||||
@ -24,11 +24,11 @@ import 'package:mycoreapi/api.dart';
|
|||||||
//defaultApiClient.getAuthentication<OAuth>('bearer').accessToken = 'YOUR_ACCESS_TOKEN';
|
//defaultApiClient.getAuthentication<OAuth>('bearer').accessToken = 'YOUR_ACCESS_TOKEN';
|
||||||
|
|
||||||
final api_instance = EnergyApi();
|
final api_instance = EnergyApi();
|
||||||
final userId = userId_example; // String |
|
final homeId = homeId_example; // String |
|
||||||
final viewBy = ; // ViewBy |
|
final viewBy = ; // ViewBy |
|
||||||
|
|
||||||
try {
|
try {
|
||||||
final result = api_instance.energyGetElectricityProduction(userId, viewBy);
|
final result = api_instance.energyGetElectricityProduction(homeId, viewBy);
|
||||||
print(result);
|
print(result);
|
||||||
} catch (e) {
|
} catch (e) {
|
||||||
print('Exception when calling EnergyApi->energyGetElectricityProduction: $e\n');
|
print('Exception when calling EnergyApi->energyGetElectricityProduction: $e\n');
|
||||||
@ -39,7 +39,7 @@ try {
|
|||||||
|
|
||||||
Name | Type | Description | Notes
|
Name | Type | Description | Notes
|
||||||
------------- | ------------- | ------------- | -------------
|
------------- | ------------- | ------------- | -------------
|
||||||
**userId** | **String**| | [optional]
|
**homeId** | **String**| | [optional]
|
||||||
**viewBy** | [**ViewBy**](.md)| | [optional]
|
**viewBy** | [**ViewBy**](.md)| | [optional]
|
||||||
|
|
||||||
### Return type
|
### Return type
|
||||||
|
|||||||
205
mycore_api/doc/EventApi.md
Normal file
205
mycore_api/doc/EventApi.md
Normal file
@ -0,0 +1,205 @@
|
|||||||
|
# mycoreapi.api.EventApi
|
||||||
|
|
||||||
|
## Load the API package
|
||||||
|
```dart
|
||||||
|
import 'package:mycoreapi/api.dart';
|
||||||
|
```
|
||||||
|
|
||||||
|
All URIs are relative to *http://192.168.31.140*
|
||||||
|
|
||||||
|
Method | HTTP request | Description
|
||||||
|
------------- | ------------- | -------------
|
||||||
|
[**eventDelete**](EventApi.md#eventdelete) | **DELETE** /api/event/{eventId} | Delete an event
|
||||||
|
[**eventDeleteAllForHome**](EventApi.md#eventdeleteallforhome) | **DELETE** /api/event/home/{homeId} | Delete all events for a specified home
|
||||||
|
[**eventGet**](EventApi.md#eventget) | **GET** /api/event/{homeId} | Get events for the specified home
|
||||||
|
[**eventGetDetail**](EventApi.md#eventgetdetail) | **GET** /api/event/detail/{eventId} | Get detail info of a specified event
|
||||||
|
|
||||||
|
|
||||||
|
# **eventDelete**
|
||||||
|
> String eventDelete(eventId)
|
||||||
|
|
||||||
|
Delete an event
|
||||||
|
|
||||||
|
### Example
|
||||||
|
```dart
|
||||||
|
import 'package:mycoreapi/api.dart';
|
||||||
|
// TODO Configure OAuth2 access token for authorization: bearer
|
||||||
|
//defaultApiClient.getAuthentication<OAuth>('bearer').accessToken = 'YOUR_ACCESS_TOKEN';
|
||||||
|
|
||||||
|
final api_instance = EventApi();
|
||||||
|
final eventId = eventId_example; // String | Id of event to delete
|
||||||
|
|
||||||
|
try {
|
||||||
|
final result = api_instance.eventDelete(eventId);
|
||||||
|
print(result);
|
||||||
|
} catch (e) {
|
||||||
|
print('Exception when calling EventApi->eventDelete: $e\n');
|
||||||
|
}
|
||||||
|
```
|
||||||
|
|
||||||
|
### Parameters
|
||||||
|
|
||||||
|
Name | Type | Description | Notes
|
||||||
|
------------- | ------------- | ------------- | -------------
|
||||||
|
**eventId** | **String**| Id of event to delete |
|
||||||
|
|
||||||
|
### 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)
|
||||||
|
|
||||||
|
# **eventDeleteAllForHome**
|
||||||
|
> String eventDeleteAllForHome(homeId)
|
||||||
|
|
||||||
|
Delete all events for a specified home
|
||||||
|
|
||||||
|
### Example
|
||||||
|
```dart
|
||||||
|
import 'package:mycoreapi/api.dart';
|
||||||
|
// TODO Configure OAuth2 access token for authorization: bearer
|
||||||
|
//defaultApiClient.getAuthentication<OAuth>('bearer').accessToken = 'YOUR_ACCESS_TOKEN';
|
||||||
|
|
||||||
|
final api_instance = EventApi();
|
||||||
|
final homeId = homeId_example; // String | Home Id
|
||||||
|
|
||||||
|
try {
|
||||||
|
final result = api_instance.eventDeleteAllForHome(homeId);
|
||||||
|
print(result);
|
||||||
|
} catch (e) {
|
||||||
|
print('Exception when calling EventApi->eventDeleteAllForHome: $e\n');
|
||||||
|
}
|
||||||
|
```
|
||||||
|
|
||||||
|
### Parameters
|
||||||
|
|
||||||
|
Name | Type | Description | Notes
|
||||||
|
------------- | ------------- | ------------- | -------------
|
||||||
|
**homeId** | **String**| Home Id |
|
||||||
|
|
||||||
|
### 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)
|
||||||
|
|
||||||
|
# **eventGet**
|
||||||
|
> List<EventDetailDTO> eventGet(homeId, deviceId, roomId, startIndex, count, dateStart, dateEnd, eventType, deviceType)
|
||||||
|
|
||||||
|
Get events for the specified home
|
||||||
|
|
||||||
|
### Example
|
||||||
|
```dart
|
||||||
|
import 'package:mycoreapi/api.dart';
|
||||||
|
// TODO Configure OAuth2 access token for authorization: bearer
|
||||||
|
//defaultApiClient.getAuthentication<OAuth>('bearer').accessToken = 'YOUR_ACCESS_TOKEN';
|
||||||
|
|
||||||
|
final api_instance = EventApi();
|
||||||
|
final homeId = homeId_example; // String | Home Id
|
||||||
|
final deviceId = deviceId_example; // String |
|
||||||
|
final roomId = roomId_example; // String |
|
||||||
|
final startIndex = 56; // int |
|
||||||
|
final count = 56; // int |
|
||||||
|
final dateStart = 2013-10-20T19:20:30+01:00; // DateTime |
|
||||||
|
final dateEnd = 2013-10-20T19:20:30+01:00; // DateTime |
|
||||||
|
final eventType = ; // OneOfEventType |
|
||||||
|
final deviceType = ; // OneOfDeviceType |
|
||||||
|
|
||||||
|
try {
|
||||||
|
final result = api_instance.eventGet(homeId, deviceId, roomId, startIndex, count, dateStart, dateEnd, eventType, deviceType);
|
||||||
|
print(result);
|
||||||
|
} catch (e) {
|
||||||
|
print('Exception when calling EventApi->eventGet: $e\n');
|
||||||
|
}
|
||||||
|
```
|
||||||
|
|
||||||
|
### Parameters
|
||||||
|
|
||||||
|
Name | Type | Description | Notes
|
||||||
|
------------- | ------------- | ------------- | -------------
|
||||||
|
**homeId** | **String**| Home Id |
|
||||||
|
**deviceId** | **String**| | [optional]
|
||||||
|
**roomId** | **String**| | [optional]
|
||||||
|
**startIndex** | **int**| | [optional]
|
||||||
|
**count** | **int**| | [optional]
|
||||||
|
**dateStart** | **DateTime**| | [optional]
|
||||||
|
**dateEnd** | **DateTime**| | [optional]
|
||||||
|
**eventType** | [**OneOfEventType**](.md)| | [optional]
|
||||||
|
**deviceType** | [**OneOfDeviceType**](.md)| | [optional]
|
||||||
|
|
||||||
|
### Return type
|
||||||
|
|
||||||
|
[**List<EventDetailDTO>**](EventDetailDTO.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)
|
||||||
|
|
||||||
|
# **eventGetDetail**
|
||||||
|
> EventDetailDTO eventGetDetail(eventId)
|
||||||
|
|
||||||
|
Get detail info of a specified event
|
||||||
|
|
||||||
|
### Example
|
||||||
|
```dart
|
||||||
|
import 'package:mycoreapi/api.dart';
|
||||||
|
// TODO Configure OAuth2 access token for authorization: bearer
|
||||||
|
//defaultApiClient.getAuthentication<OAuth>('bearer').accessToken = 'YOUR_ACCESS_TOKEN';
|
||||||
|
|
||||||
|
final api_instance = EventApi();
|
||||||
|
final eventId = eventId_example; // String | event id
|
||||||
|
|
||||||
|
try {
|
||||||
|
final result = api_instance.eventGetDetail(eventId);
|
||||||
|
print(result);
|
||||||
|
} catch (e) {
|
||||||
|
print('Exception when calling EventApi->eventGetDetail: $e\n');
|
||||||
|
}
|
||||||
|
```
|
||||||
|
|
||||||
|
### Parameters
|
||||||
|
|
||||||
|
Name | Type | Description | Notes
|
||||||
|
------------- | ------------- | ------------- | -------------
|
||||||
|
**eventId** | **String**| event id |
|
||||||
|
|
||||||
|
### Return type
|
||||||
|
|
||||||
|
[**EventDetailDTO**](EventDetailDTO.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)
|
||||||
|
|
||||||
19
mycore_api/doc/EventDTO.md
Normal file
19
mycore_api/doc/EventDTO.md
Normal file
@ -0,0 +1,19 @@
|
|||||||
|
# mycoreapi.model.EventDTO
|
||||||
|
|
||||||
|
## Load the model package
|
||||||
|
```dart
|
||||||
|
import 'package:mycoreapi/api.dart';
|
||||||
|
```
|
||||||
|
|
||||||
|
## Properties
|
||||||
|
Name | Type | Description | Notes
|
||||||
|
------------ | ------------- | ------------- | -------------
|
||||||
|
**id** | **String** | | [optional]
|
||||||
|
**homeId** | **String** | | [optional]
|
||||||
|
**date** | [**DateTime**](DateTime.md) | | [optional]
|
||||||
|
**type** | [**EventType**](EventType.md) | | [optional]
|
||||||
|
**roomId** | **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)
|
||||||
|
|
||||||
|
|
||||||
22
mycore_api/doc/EventDetailDTO.md
Normal file
22
mycore_api/doc/EventDetailDTO.md
Normal file
@ -0,0 +1,22 @@
|
|||||||
|
# mycoreapi.model.EventDetailDTO
|
||||||
|
|
||||||
|
## Load the model package
|
||||||
|
```dart
|
||||||
|
import 'package:mycoreapi/api.dart';
|
||||||
|
```
|
||||||
|
|
||||||
|
## Properties
|
||||||
|
Name | Type | Description | Notes
|
||||||
|
------------ | ------------- | ------------- | -------------
|
||||||
|
**id** | **String** | | [optional]
|
||||||
|
**homeId** | **String** | | [optional]
|
||||||
|
**date** | [**DateTime**](DateTime.md) | | [optional]
|
||||||
|
**type** | [**EventType**](EventType.md) | | [optional]
|
||||||
|
**roomId** | **String** | | [optional]
|
||||||
|
**deviceState** | [**OneOfDeviceState**](OneOfDeviceState.md) | | [optional]
|
||||||
|
**automationTriggered** | [**OneOfAutomationTriggered**](OneOfAutomationTriggered.md) | | [optional]
|
||||||
|
**alarmTriggered** | [**OneOfAlarmTriggered**](OneOfAlarmTriggered.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)
|
||||||
|
|
||||||
|
|
||||||
17
mycore_api/doc/EventDetailDTOAllOf.md
Normal file
17
mycore_api/doc/EventDetailDTOAllOf.md
Normal file
@ -0,0 +1,17 @@
|
|||||||
|
# mycoreapi.model.EventDetailDTOAllOf
|
||||||
|
|
||||||
|
## Load the model package
|
||||||
|
```dart
|
||||||
|
import 'package:mycoreapi/api.dart';
|
||||||
|
```
|
||||||
|
|
||||||
|
## Properties
|
||||||
|
Name | Type | Description | Notes
|
||||||
|
------------ | ------------- | ------------- | -------------
|
||||||
|
**deviceState** | [**OneOfDeviceState**](OneOfDeviceState.md) | | [optional]
|
||||||
|
**automationTriggered** | [**OneOfAutomationTriggered**](OneOfAutomationTriggered.md) | | [optional]
|
||||||
|
**alarmTriggered** | [**OneOfAlarmTriggered**](OneOfAlarmTriggered.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)
|
||||||
|
|
||||||
|
|
||||||
14
mycore_api/doc/EventType.md
Normal file
14
mycore_api/doc/EventType.md
Normal file
@ -0,0 +1,14 @@
|
|||||||
|
# mycoreapi.model.EventType
|
||||||
|
|
||||||
|
## 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)
|
||||||
|
|
||||||
|
|
||||||
@ -5,7 +5,7 @@
|
|||||||
import 'package:mycoreapi/api.dart';
|
import 'package:mycoreapi/api.dart';
|
||||||
```
|
```
|
||||||
|
|
||||||
All URIs are relative to *http://localhost:25049*
|
All URIs are relative to *http://192.168.31.140*
|
||||||
|
|
||||||
Method | HTTP request | Description
|
Method | HTTP request | Description
|
||||||
------------- | ------------- | -------------
|
------------- | ------------- | -------------
|
||||||
|
|||||||
18
mycore_api/doc/GeolocalizedMode.md
Normal file
18
mycore_api/doc/GeolocalizedMode.md
Normal file
@ -0,0 +1,18 @@
|
|||||||
|
# mycoreapi.model.GeolocalizedMode
|
||||||
|
|
||||||
|
## Load the model package
|
||||||
|
```dart
|
||||||
|
import 'package:mycoreapi/api.dart';
|
||||||
|
```
|
||||||
|
|
||||||
|
## Properties
|
||||||
|
Name | Type | Description | Notes
|
||||||
|
------------ | ------------- | ------------- | -------------
|
||||||
|
**latitude** | **String** | | [optional]
|
||||||
|
**longitude** | **String** | | [optional]
|
||||||
|
**homeMode** | [**OneOfAlarmMode**](OneOfAlarmMode.md) | | [optional]
|
||||||
|
**absentMode** | [**OneOfAlarmMode**](OneOfAlarmMode.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)
|
||||||
|
|
||||||
|
|
||||||
@ -5,7 +5,7 @@
|
|||||||
import 'package:mycoreapi/api.dart';
|
import 'package:mycoreapi/api.dart';
|
||||||
```
|
```
|
||||||
|
|
||||||
All URIs are relative to *http://localhost:25049*
|
All URIs are relative to *http://192.168.31.140*
|
||||||
|
|
||||||
Method | HTTP request | Description
|
Method | HTTP request | Description
|
||||||
------------- | ------------- | -------------
|
------------- | ------------- | -------------
|
||||||
|
|||||||
@ -5,19 +5,19 @@
|
|||||||
import 'package:mycoreapi/api.dart';
|
import 'package:mycoreapi/api.dart';
|
||||||
```
|
```
|
||||||
|
|
||||||
All URIs are relative to *http://localhost:25049*
|
All URIs are relative to *http://192.168.31.140*
|
||||||
|
|
||||||
Method | HTTP request | Description
|
Method | HTTP request | Description
|
||||||
------------- | ------------- | -------------
|
------------- | ------------- | -------------
|
||||||
[**groupCreate**](GroupApi.md#groupcreate) | **POST** /api/group | Create a group
|
[**groupCreate**](GroupApi.md#groupcreate) | **POST** /api/group | Create a group
|
||||||
[**groupCreateDevicesFromZigbee2Mqtt**](GroupApi.md#groupcreatedevicesfromzigbee2mqtt) | **POST** /api/group/{userId}/fromZigbee | Create groups from provider
|
[**groupCreateDevicesFromZigbee2Mqtt**](GroupApi.md#groupcreatedevicesfromzigbee2mqtt) | **POST** /api/group/{homeId}/fromZigbee | Create groups from provider
|
||||||
[**groupDelete**](GroupApi.md#groupdelete) | **DELETE** /api/group/{groupId}/device/{deviceId} | Delete device from a group
|
[**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
|
[**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
|
[**groupDeleteAllForHome**](GroupApi.md#groupdeleteallforhome) | **DELETE** /api/group/home/{homeId} | Delete all group for a specified home
|
||||||
[**groupGetAll**](GroupApi.md#groupgetall) | **GET** /api/group/{userId} | Get all groups for the specified user
|
[**groupGetAll**](GroupApi.md#groupgetall) | **GET** /api/group/{homeId} | Get all groups for the specified home
|
||||||
[**groupGetDetail**](GroupApi.md#groupgetdetail) | **GET** /api/group/detail/{groupId} | Get detail info of a specified group
|
[**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
|
[**groupGetGroupsByType**](GroupApi.md#groupgetgroupsbytype) | **GET** /api/group/{homeId}/type/{type} | Get list of group from a type
|
||||||
[**groupGetGroupsFromZigbee2Mqtt**](GroupApi.md#groupgetgroupsfromzigbee2mqtt) | **GET** /api/group/zigbee2Mqtt/{userId} | Get all zigbee2Mqtt groups
|
[**groupGetGroupsFromZigbee2Mqtt**](GroupApi.md#groupgetgroupsfromzigbee2mqtt) | **GET** /api/group/zigbee2Mqtt/{homeId} | Get all zigbee2Mqtt groups
|
||||||
[**groupUpdate**](GroupApi.md#groupupdate) | **PUT** /api/group | Update a group
|
[**groupUpdate**](GroupApi.md#groupupdate) | **PUT** /api/group | Update a group
|
||||||
|
|
||||||
|
|
||||||
@ -65,7 +65,7 @@ Name | Type | Description | Notes
|
|||||||
[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md)
|
[[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**
|
# **groupCreateDevicesFromZigbee2Mqtt**
|
||||||
> List<GroupDetailDTO> groupCreateDevicesFromZigbee2Mqtt(userId)
|
> List<GroupDetailDTO> groupCreateDevicesFromZigbee2Mqtt(homeId)
|
||||||
|
|
||||||
Create groups from provider
|
Create groups from provider
|
||||||
|
|
||||||
@ -76,10 +76,10 @@ import 'package:mycoreapi/api.dart';
|
|||||||
//defaultApiClient.getAuthentication<OAuth>('bearer').accessToken = 'YOUR_ACCESS_TOKEN';
|
//defaultApiClient.getAuthentication<OAuth>('bearer').accessToken = 'YOUR_ACCESS_TOKEN';
|
||||||
|
|
||||||
final api_instance = GroupApi();
|
final api_instance = GroupApi();
|
||||||
final userId = userId_example; // String | User Id
|
final homeId = homeId_example; // String | Home Id
|
||||||
|
|
||||||
try {
|
try {
|
||||||
final result = api_instance.groupCreateDevicesFromZigbee2Mqtt(userId);
|
final result = api_instance.groupCreateDevicesFromZigbee2Mqtt(homeId);
|
||||||
print(result);
|
print(result);
|
||||||
} catch (e) {
|
} catch (e) {
|
||||||
print('Exception when calling GroupApi->groupCreateDevicesFromZigbee2Mqtt: $e\n');
|
print('Exception when calling GroupApi->groupCreateDevicesFromZigbee2Mqtt: $e\n');
|
||||||
@ -90,7 +90,7 @@ try {
|
|||||||
|
|
||||||
Name | Type | Description | Notes
|
Name | Type | Description | Notes
|
||||||
------------- | ------------- | ------------- | -------------
|
------------- | ------------- | ------------- | -------------
|
||||||
**userId** | **String**| User Id |
|
**homeId** | **String**| Home Id |
|
||||||
|
|
||||||
### Return type
|
### Return type
|
||||||
|
|
||||||
@ -195,10 +195,10 @@ Name | Type | Description | Notes
|
|||||||
|
|
||||||
[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md)
|
[[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**
|
# **groupDeleteAllForHome**
|
||||||
> String groupDeleteAllForUser(userId)
|
> String groupDeleteAllForHome(homeId)
|
||||||
|
|
||||||
Delete all group for a specified
|
Delete all group for a specified home
|
||||||
|
|
||||||
### Example
|
### Example
|
||||||
```dart
|
```dart
|
||||||
@ -207,13 +207,13 @@ import 'package:mycoreapi/api.dart';
|
|||||||
//defaultApiClient.getAuthentication<OAuth>('bearer').accessToken = 'YOUR_ACCESS_TOKEN';
|
//defaultApiClient.getAuthentication<OAuth>('bearer').accessToken = 'YOUR_ACCESS_TOKEN';
|
||||||
|
|
||||||
final api_instance = GroupApi();
|
final api_instance = GroupApi();
|
||||||
final userId = userId_example; // String | Id of user
|
final homeId = homeId_example; // String | Home Id
|
||||||
|
|
||||||
try {
|
try {
|
||||||
final result = api_instance.groupDeleteAllForUser(userId);
|
final result = api_instance.groupDeleteAllForHome(homeId);
|
||||||
print(result);
|
print(result);
|
||||||
} catch (e) {
|
} catch (e) {
|
||||||
print('Exception when calling GroupApi->groupDeleteAllForUser: $e\n');
|
print('Exception when calling GroupApi->groupDeleteAllForHome: $e\n');
|
||||||
}
|
}
|
||||||
```
|
```
|
||||||
|
|
||||||
@ -221,7 +221,7 @@ try {
|
|||||||
|
|
||||||
Name | Type | Description | Notes
|
Name | Type | Description | Notes
|
||||||
------------- | ------------- | ------------- | -------------
|
------------- | ------------- | ------------- | -------------
|
||||||
**userId** | **String**| Id of user |
|
**homeId** | **String**| Home Id |
|
||||||
|
|
||||||
### Return type
|
### Return type
|
||||||
|
|
||||||
@ -239,9 +239,9 @@ Name | Type | Description | Notes
|
|||||||
[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md)
|
[[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**
|
# **groupGetAll**
|
||||||
> List<GroupSummaryDTO> groupGetAll(userId)
|
> List<GroupSummaryDTO> groupGetAll(homeId)
|
||||||
|
|
||||||
Get all groups for the specified user
|
Get all groups for the specified home
|
||||||
|
|
||||||
### Example
|
### Example
|
||||||
```dart
|
```dart
|
||||||
@ -250,10 +250,10 @@ import 'package:mycoreapi/api.dart';
|
|||||||
//defaultApiClient.getAuthentication<OAuth>('bearer').accessToken = 'YOUR_ACCESS_TOKEN';
|
//defaultApiClient.getAuthentication<OAuth>('bearer').accessToken = 'YOUR_ACCESS_TOKEN';
|
||||||
|
|
||||||
final api_instance = GroupApi();
|
final api_instance = GroupApi();
|
||||||
final userId = userId_example; // String | Id of user
|
final homeId = homeId_example; // String | Home Id
|
||||||
|
|
||||||
try {
|
try {
|
||||||
final result = api_instance.groupGetAll(userId);
|
final result = api_instance.groupGetAll(homeId);
|
||||||
print(result);
|
print(result);
|
||||||
} catch (e) {
|
} catch (e) {
|
||||||
print('Exception when calling GroupApi->groupGetAll: $e\n');
|
print('Exception when calling GroupApi->groupGetAll: $e\n');
|
||||||
@ -264,7 +264,7 @@ try {
|
|||||||
|
|
||||||
Name | Type | Description | Notes
|
Name | Type | Description | Notes
|
||||||
------------- | ------------- | ------------- | -------------
|
------------- | ------------- | ------------- | -------------
|
||||||
**userId** | **String**| Id of user |
|
**homeId** | **String**| Home Id |
|
||||||
|
|
||||||
### Return type
|
### Return type
|
||||||
|
|
||||||
@ -325,7 +325,7 @@ Name | Type | Description | Notes
|
|||||||
[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md)
|
[[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**
|
# **groupGetGroupsByType**
|
||||||
> List<GroupSummaryDTO> groupGetGroupsByType(userId, type)
|
> List<GroupSummaryDTO> groupGetGroupsByType(homeId, type)
|
||||||
|
|
||||||
Get list of group from a type
|
Get list of group from a type
|
||||||
|
|
||||||
@ -336,11 +336,11 @@ import 'package:mycoreapi/api.dart';
|
|||||||
//defaultApiClient.getAuthentication<OAuth>('bearer').accessToken = 'YOUR_ACCESS_TOKEN';
|
//defaultApiClient.getAuthentication<OAuth>('bearer').accessToken = 'YOUR_ACCESS_TOKEN';
|
||||||
|
|
||||||
final api_instance = GroupApi();
|
final api_instance = GroupApi();
|
||||||
final userId = userId_example; // String | user Id
|
final homeId = homeId_example; // String | home Id
|
||||||
final type = type_example; // String | group type
|
final type = type_example; // String | group type
|
||||||
|
|
||||||
try {
|
try {
|
||||||
final result = api_instance.groupGetGroupsByType(userId, type);
|
final result = api_instance.groupGetGroupsByType(homeId, type);
|
||||||
print(result);
|
print(result);
|
||||||
} catch (e) {
|
} catch (e) {
|
||||||
print('Exception when calling GroupApi->groupGetGroupsByType: $e\n');
|
print('Exception when calling GroupApi->groupGetGroupsByType: $e\n');
|
||||||
@ -351,7 +351,7 @@ try {
|
|||||||
|
|
||||||
Name | Type | Description | Notes
|
Name | Type | Description | Notes
|
||||||
------------- | ------------- | ------------- | -------------
|
------------- | ------------- | ------------- | -------------
|
||||||
**userId** | **String**| user Id |
|
**homeId** | **String**| home Id |
|
||||||
**type** | **String**| group type |
|
**type** | **String**| group type |
|
||||||
|
|
||||||
### Return type
|
### Return type
|
||||||
@ -370,7 +370,7 @@ Name | Type | Description | Notes
|
|||||||
[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md)
|
[[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**
|
# **groupGetGroupsFromZigbee2Mqtt**
|
||||||
> List<GroupDetailDTO> groupGetGroupsFromZigbee2Mqtt(userId)
|
> List<GroupDetailDTO> groupGetGroupsFromZigbee2Mqtt(homeId)
|
||||||
|
|
||||||
Get all zigbee2Mqtt groups
|
Get all zigbee2Mqtt groups
|
||||||
|
|
||||||
@ -381,10 +381,10 @@ import 'package:mycoreapi/api.dart';
|
|||||||
//defaultApiClient.getAuthentication<OAuth>('bearer').accessToken = 'YOUR_ACCESS_TOKEN';
|
//defaultApiClient.getAuthentication<OAuth>('bearer').accessToken = 'YOUR_ACCESS_TOKEN';
|
||||||
|
|
||||||
final api_instance = GroupApi();
|
final api_instance = GroupApi();
|
||||||
final userId = userId_example; // String | User Id
|
final homeId = homeId_example; // String | Home Id
|
||||||
|
|
||||||
try {
|
try {
|
||||||
final result = api_instance.groupGetGroupsFromZigbee2Mqtt(userId);
|
final result = api_instance.groupGetGroupsFromZigbee2Mqtt(homeId);
|
||||||
print(result);
|
print(result);
|
||||||
} catch (e) {
|
} catch (e) {
|
||||||
print('Exception when calling GroupApi->groupGetGroupsFromZigbee2Mqtt: $e\n');
|
print('Exception when calling GroupApi->groupGetGroupsFromZigbee2Mqtt: $e\n');
|
||||||
@ -395,7 +395,7 @@ try {
|
|||||||
|
|
||||||
Name | Type | Description | Notes
|
Name | Type | Description | Notes
|
||||||
------------- | ------------- | ------------- | -------------
|
------------- | ------------- | ------------- | -------------
|
||||||
**userId** | **String**| User Id |
|
**homeId** | **String**| Home Id |
|
||||||
|
|
||||||
### Return type
|
### Return type
|
||||||
|
|
||||||
|
|||||||
@ -9,7 +9,7 @@ import 'package:mycoreapi/api.dart';
|
|||||||
Name | Type | Description | Notes
|
Name | Type | Description | Notes
|
||||||
------------ | ------------- | ------------- | -------------
|
------------ | ------------- | ------------- | -------------
|
||||||
**id** | **String** | | [optional]
|
**id** | **String** | | [optional]
|
||||||
**userId** | **String** | | [optional]
|
**homeId** | **String** | | [optional]
|
||||||
**name** | **String** | | [optional]
|
**name** | **String** | | [optional]
|
||||||
**type** | **String** | | [optional]
|
**type** | **String** | | [optional]
|
||||||
**isAlarm** | **bool** | | [optional]
|
**isAlarm** | **bool** | | [optional]
|
||||||
|
|||||||
@ -9,7 +9,7 @@ import 'package:mycoreapi/api.dart';
|
|||||||
Name | Type | Description | Notes
|
Name | Type | Description | Notes
|
||||||
------------ | ------------- | ------------- | -------------
|
------------ | ------------- | ------------- | -------------
|
||||||
**id** | **String** | | [optional]
|
**id** | **String** | | [optional]
|
||||||
**userId** | **String** | | [optional]
|
**homeId** | **String** | | [optional]
|
||||||
**name** | **String** | | [optional]
|
**name** | **String** | | [optional]
|
||||||
**type** | **String** | | [optional]
|
**type** | **String** | | [optional]
|
||||||
**isAlarm** | **bool** | | [optional]
|
**isAlarm** | **bool** | | [optional]
|
||||||
|
|||||||
@ -9,7 +9,7 @@ import 'package:mycoreapi/api.dart';
|
|||||||
Name | Type | Description | Notes
|
Name | Type | Description | Notes
|
||||||
------------ | ------------- | ------------- | -------------
|
------------ | ------------- | ------------- | -------------
|
||||||
**id** | **String** | | [optional]
|
**id** | **String** | | [optional]
|
||||||
**userId** | **String** | | [optional]
|
**homeId** | **String** | | [optional]
|
||||||
**name** | **String** | | [optional]
|
**name** | **String** | | [optional]
|
||||||
**type** | **String** | | [optional]
|
**type** | **String** | | [optional]
|
||||||
**isAlarm** | **bool** | | [optional]
|
**isAlarm** | **bool** | | [optional]
|
||||||
|
|||||||
233
mycore_api/doc/HomeApi.md
Normal file
233
mycore_api/doc/HomeApi.md
Normal file
@ -0,0 +1,233 @@
|
|||||||
|
# mycoreapi.api.HomeApi
|
||||||
|
|
||||||
|
## Load the API package
|
||||||
|
```dart
|
||||||
|
import 'package:mycoreapi/api.dart';
|
||||||
|
```
|
||||||
|
|
||||||
|
All URIs are relative to *http://192.168.31.140*
|
||||||
|
|
||||||
|
Method | HTTP request | Description
|
||||||
|
------------- | ------------- | -------------
|
||||||
|
[**homeCreate**](HomeApi.md#homecreate) | **POST** /api/home | Create a home
|
||||||
|
[**homeDelete**](HomeApi.md#homedelete) | **DELETE** /api/home/{homeId} | Delete a home
|
||||||
|
[**homeGetAll**](HomeApi.md#homegetall) | **GET** /api/home/{userId} | Get all home for specified user
|
||||||
|
[**homeGetDetail**](HomeApi.md#homegetdetail) | **GET** /api/home/detail/{homeId} | Get detail info of a specified home
|
||||||
|
[**homeUpdate**](HomeApi.md#homeupdate) | **PUT** /api/home | Update a home
|
||||||
|
|
||||||
|
|
||||||
|
# **homeCreate**
|
||||||
|
> HomeDTO homeCreate(createOrUpdateHomeDTO)
|
||||||
|
|
||||||
|
Create a home
|
||||||
|
|
||||||
|
### Example
|
||||||
|
```dart
|
||||||
|
import 'package:mycoreapi/api.dart';
|
||||||
|
// TODO Configure OAuth2 access token for authorization: bearer
|
||||||
|
//defaultApiClient.getAuthentication<OAuth>('bearer').accessToken = 'YOUR_ACCESS_TOKEN';
|
||||||
|
|
||||||
|
final api_instance = HomeApi();
|
||||||
|
final createOrUpdateHomeDTO = CreateOrUpdateHomeDTO(); // CreateOrUpdateHomeDTO | Home to create
|
||||||
|
|
||||||
|
try {
|
||||||
|
final result = api_instance.homeCreate(createOrUpdateHomeDTO);
|
||||||
|
print(result);
|
||||||
|
} catch (e) {
|
||||||
|
print('Exception when calling HomeApi->homeCreate: $e\n');
|
||||||
|
}
|
||||||
|
```
|
||||||
|
|
||||||
|
### Parameters
|
||||||
|
|
||||||
|
Name | Type | Description | Notes
|
||||||
|
------------- | ------------- | ------------- | -------------
|
||||||
|
**createOrUpdateHomeDTO** | [**CreateOrUpdateHomeDTO**](CreateOrUpdateHomeDTO.md)| Home to create |
|
||||||
|
|
||||||
|
### Return type
|
||||||
|
|
||||||
|
[**HomeDTO**](HomeDTO.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)
|
||||||
|
|
||||||
|
# **homeDelete**
|
||||||
|
> String homeDelete(homeId)
|
||||||
|
|
||||||
|
Delete a home
|
||||||
|
|
||||||
|
### Example
|
||||||
|
```dart
|
||||||
|
import 'package:mycoreapi/api.dart';
|
||||||
|
// TODO Configure OAuth2 access token for authorization: bearer
|
||||||
|
//defaultApiClient.getAuthentication<OAuth>('bearer').accessToken = 'YOUR_ACCESS_TOKEN';
|
||||||
|
|
||||||
|
final api_instance = HomeApi();
|
||||||
|
final homeId = homeId_example; // String | Id of home to delete
|
||||||
|
|
||||||
|
try {
|
||||||
|
final result = api_instance.homeDelete(homeId);
|
||||||
|
print(result);
|
||||||
|
} catch (e) {
|
||||||
|
print('Exception when calling HomeApi->homeDelete: $e\n');
|
||||||
|
}
|
||||||
|
```
|
||||||
|
|
||||||
|
### Parameters
|
||||||
|
|
||||||
|
Name | Type | Description | Notes
|
||||||
|
------------- | ------------- | ------------- | -------------
|
||||||
|
**homeId** | **String**| Id of home to delete |
|
||||||
|
|
||||||
|
### 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)
|
||||||
|
|
||||||
|
# **homeGetAll**
|
||||||
|
> List<HomeDTO> homeGetAll(userId)
|
||||||
|
|
||||||
|
Get all home for specified user
|
||||||
|
|
||||||
|
### Example
|
||||||
|
```dart
|
||||||
|
import 'package:mycoreapi/api.dart';
|
||||||
|
// TODO Configure OAuth2 access token for authorization: bearer
|
||||||
|
//defaultApiClient.getAuthentication<OAuth>('bearer').accessToken = 'YOUR_ACCESS_TOKEN';
|
||||||
|
|
||||||
|
final api_instance = HomeApi();
|
||||||
|
final userId = userId_example; // String | User Id
|
||||||
|
|
||||||
|
try {
|
||||||
|
final result = api_instance.homeGetAll(userId);
|
||||||
|
print(result);
|
||||||
|
} catch (e) {
|
||||||
|
print('Exception when calling HomeApi->homeGetAll: $e\n');
|
||||||
|
}
|
||||||
|
```
|
||||||
|
|
||||||
|
### Parameters
|
||||||
|
|
||||||
|
Name | Type | Description | Notes
|
||||||
|
------------- | ------------- | ------------- | -------------
|
||||||
|
**userId** | **String**| User Id |
|
||||||
|
|
||||||
|
### Return type
|
||||||
|
|
||||||
|
[**List<HomeDTO>**](HomeDTO.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)
|
||||||
|
|
||||||
|
# **homeGetDetail**
|
||||||
|
> HomeDetailDTO homeGetDetail(homeId)
|
||||||
|
|
||||||
|
Get detail info of a specified home
|
||||||
|
|
||||||
|
### Example
|
||||||
|
```dart
|
||||||
|
import 'package:mycoreapi/api.dart';
|
||||||
|
// TODO Configure OAuth2 access token for authorization: bearer
|
||||||
|
//defaultApiClient.getAuthentication<OAuth>('bearer').accessToken = 'YOUR_ACCESS_TOKEN';
|
||||||
|
|
||||||
|
final api_instance = HomeApi();
|
||||||
|
final homeId = homeId_example; // String | home id
|
||||||
|
|
||||||
|
try {
|
||||||
|
final result = api_instance.homeGetDetail(homeId);
|
||||||
|
print(result);
|
||||||
|
} catch (e) {
|
||||||
|
print('Exception when calling HomeApi->homeGetDetail: $e\n');
|
||||||
|
}
|
||||||
|
```
|
||||||
|
|
||||||
|
### Parameters
|
||||||
|
|
||||||
|
Name | Type | Description | Notes
|
||||||
|
------------- | ------------- | ------------- | -------------
|
||||||
|
**homeId** | **String**| home id |
|
||||||
|
|
||||||
|
### Return type
|
||||||
|
|
||||||
|
[**HomeDetailDTO**](HomeDetailDTO.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)
|
||||||
|
|
||||||
|
# **homeUpdate**
|
||||||
|
> HomeDTO homeUpdate(createOrUpdateHomeDTO)
|
||||||
|
|
||||||
|
Update a home
|
||||||
|
|
||||||
|
### Example
|
||||||
|
```dart
|
||||||
|
import 'package:mycoreapi/api.dart';
|
||||||
|
// TODO Configure OAuth2 access token for authorization: bearer
|
||||||
|
//defaultApiClient.getAuthentication<OAuth>('bearer').accessToken = 'YOUR_ACCESS_TOKEN';
|
||||||
|
|
||||||
|
final api_instance = HomeApi();
|
||||||
|
final createOrUpdateHomeDTO = CreateOrUpdateHomeDTO(); // CreateOrUpdateHomeDTO | Home to update
|
||||||
|
|
||||||
|
try {
|
||||||
|
final result = api_instance.homeUpdate(createOrUpdateHomeDTO);
|
||||||
|
print(result);
|
||||||
|
} catch (e) {
|
||||||
|
print('Exception when calling HomeApi->homeUpdate: $e\n');
|
||||||
|
}
|
||||||
|
```
|
||||||
|
|
||||||
|
### Parameters
|
||||||
|
|
||||||
|
Name | Type | Description | Notes
|
||||||
|
------------- | ------------- | ------------- | -------------
|
||||||
|
**createOrUpdateHomeDTO** | [**CreateOrUpdateHomeDTO**](CreateOrUpdateHomeDTO.md)| Home to update |
|
||||||
|
|
||||||
|
### Return type
|
||||||
|
|
||||||
|
[**HomeDTO**](HomeDTO.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)
|
||||||
|
|
||||||
22
mycore_api/doc/HomeDTO.md
Normal file
22
mycore_api/doc/HomeDTO.md
Normal file
@ -0,0 +1,22 @@
|
|||||||
|
# mycoreapi.model.HomeDTO
|
||||||
|
|
||||||
|
## Load the model package
|
||||||
|
```dart
|
||||||
|
import 'package:mycoreapi/api.dart';
|
||||||
|
```
|
||||||
|
|
||||||
|
## Properties
|
||||||
|
Name | Type | Description | Notes
|
||||||
|
------------ | ------------- | ------------- | -------------
|
||||||
|
**id** | **String** | | [optional]
|
||||||
|
**name** | **String** | | [optional]
|
||||||
|
**isAlarm** | **bool** | | [optional]
|
||||||
|
**isDefault** | **bool** | | [optional]
|
||||||
|
**currentAlarmMode** | [**OneOfAlarmModeDTO**](OneOfAlarmModeDTO.md) | | [optional]
|
||||||
|
**createdDate** | [**DateTime**](DateTime.md) | | [optional]
|
||||||
|
**updatedDate** | [**DateTime**](DateTime.md) | | [optional]
|
||||||
|
**usersIds** | **List<String>** | | [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)
|
||||||
|
|
||||||
|
|
||||||
27
mycore_api/doc/HomeDetailDTO.md
Normal file
27
mycore_api/doc/HomeDetailDTO.md
Normal file
@ -0,0 +1,27 @@
|
|||||||
|
# mycoreapi.model.HomeDetailDTO
|
||||||
|
|
||||||
|
## Load the model package
|
||||||
|
```dart
|
||||||
|
import 'package:mycoreapi/api.dart';
|
||||||
|
```
|
||||||
|
|
||||||
|
## Properties
|
||||||
|
Name | Type | Description | Notes
|
||||||
|
------------ | ------------- | ------------- | -------------
|
||||||
|
**id** | **String** | | [optional]
|
||||||
|
**name** | **String** | | [optional]
|
||||||
|
**isAlarm** | **bool** | | [optional]
|
||||||
|
**isDefault** | **bool** | | [optional]
|
||||||
|
**currentAlarmMode** | [**OneOfAlarmModeDTO**](OneOfAlarmModeDTO.md) | | [optional]
|
||||||
|
**createdDate** | [**DateTime**](DateTime.md) | | [optional]
|
||||||
|
**updatedDate** | [**DateTime**](DateTime.md) | | [optional]
|
||||||
|
**usersIds** | **List<String>** | | [optional] [default to const []]
|
||||||
|
**users** | [**List<UserInfoDetailDTO>**](UserInfoDetailDTO.md) | | [optional] [default to const []]
|
||||||
|
**devices** | [**List<DeviceSummaryDTO>**](DeviceSummaryDTO.md) | | [optional] [default to const []]
|
||||||
|
**automations** | [**List<AutomationDTO>**](AutomationDTO.md) | | [optional] [default to const []]
|
||||||
|
**providers** | [**List<ProviderDTO>**](ProviderDTO.md) | | [optional] [default to const []]
|
||||||
|
**groups** | [**List<GroupSummaryDTO>**](GroupSummaryDTO.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)
|
||||||
|
|
||||||
|
|
||||||
19
mycore_api/doc/HomeDetailDTOAllOf.md
Normal file
19
mycore_api/doc/HomeDetailDTOAllOf.md
Normal file
@ -0,0 +1,19 @@
|
|||||||
|
# mycoreapi.model.HomeDetailDTOAllOf
|
||||||
|
|
||||||
|
## Load the model package
|
||||||
|
```dart
|
||||||
|
import 'package:mycoreapi/api.dart';
|
||||||
|
```
|
||||||
|
|
||||||
|
## Properties
|
||||||
|
Name | Type | Description | Notes
|
||||||
|
------------ | ------------- | ------------- | -------------
|
||||||
|
**users** | [**List<UserInfoDetailDTO>**](UserInfoDetailDTO.md) | | [optional] [default to const []]
|
||||||
|
**devices** | [**List<DeviceSummaryDTO>**](DeviceSummaryDTO.md) | | [optional] [default to const []]
|
||||||
|
**automations** | [**List<AutomationDTO>**](AutomationDTO.md) | | [optional] [default to const []]
|
||||||
|
**providers** | [**List<ProviderDTO>**](ProviderDTO.md) | | [optional] [default to const []]
|
||||||
|
**groups** | [**List<GroupSummaryDTO>**](GroupSummaryDTO.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)
|
||||||
|
|
||||||
|
|
||||||
@ -5,7 +5,7 @@
|
|||||||
import 'package:mycoreapi/api.dart';
|
import 'package:mycoreapi/api.dart';
|
||||||
```
|
```
|
||||||
|
|
||||||
All URIs are relative to *http://localhost:25049*
|
All URIs are relative to *http://192.168.31.140*
|
||||||
|
|
||||||
Method | HTTP request | Description
|
Method | HTTP request | Description
|
||||||
------------- | ------------- | -------------
|
------------- | ------------- | -------------
|
||||||
|
|||||||
@ -5,7 +5,7 @@
|
|||||||
import 'package:mycoreapi/api.dart';
|
import 'package:mycoreapi/api.dart';
|
||||||
```
|
```
|
||||||
|
|
||||||
All URIs are relative to *http://localhost:25049*
|
All URIs are relative to *http://192.168.31.140*
|
||||||
|
|
||||||
Method | HTTP request | Description
|
Method | HTTP request | Description
|
||||||
------------- | ------------- | -------------
|
------------- | ------------- | -------------
|
||||||
|
|||||||
@ -5,7 +5,7 @@
|
|||||||
import 'package:mycoreapi/api.dart';
|
import 'package:mycoreapi/api.dart';
|
||||||
```
|
```
|
||||||
|
|
||||||
All URIs are relative to *http://localhost:25049*
|
All URIs are relative to *http://192.168.31.140*
|
||||||
|
|
||||||
Method | HTTP request | Description
|
Method | HTTP request | Description
|
||||||
------------- | ------------- | -------------
|
------------- | ------------- | -------------
|
||||||
|
|||||||
@ -5,7 +5,7 @@
|
|||||||
import 'package:mycoreapi/api.dart';
|
import 'package:mycoreapi/api.dart';
|
||||||
```
|
```
|
||||||
|
|
||||||
All URIs are relative to *http://localhost:25049*
|
All URIs are relative to *http://192.168.31.140*
|
||||||
|
|
||||||
Method | HTTP request | Description
|
Method | HTTP request | Description
|
||||||
------------- | ------------- | -------------
|
------------- | ------------- | -------------
|
||||||
|
|||||||
21
mycore_api/doc/ProgrammedMode.md
Normal file
21
mycore_api/doc/ProgrammedMode.md
Normal file
@ -0,0 +1,21 @@
|
|||||||
|
# mycoreapi.model.ProgrammedMode
|
||||||
|
|
||||||
|
## Load the model package
|
||||||
|
```dart
|
||||||
|
import 'package:mycoreapi/api.dart';
|
||||||
|
```
|
||||||
|
|
||||||
|
## Properties
|
||||||
|
Name | Type | Description | Notes
|
||||||
|
------------ | ------------- | ------------- | -------------
|
||||||
|
**monday** | [**List<TimePeriodAlarm>**](TimePeriodAlarm.md) | | [optional] [default to const []]
|
||||||
|
**tuesday** | [**List<TimePeriodAlarm>**](TimePeriodAlarm.md) | | [optional] [default to const []]
|
||||||
|
**wednesday** | [**List<TimePeriodAlarm>**](TimePeriodAlarm.md) | | [optional] [default to const []]
|
||||||
|
**thursday** | [**List<TimePeriodAlarm>**](TimePeriodAlarm.md) | | [optional] [default to const []]
|
||||||
|
**friday** | [**List<TimePeriodAlarm>**](TimePeriodAlarm.md) | | [optional] [default to const []]
|
||||||
|
**saturday** | [**List<TimePeriodAlarm>**](TimePeriodAlarm.md) | | [optional] [default to const []]
|
||||||
|
**sunday** | [**List<TimePeriodAlarm>**](TimePeriodAlarm.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)
|
||||||
|
|
||||||
|
|
||||||
@ -5,13 +5,13 @@
|
|||||||
import 'package:mycoreapi/api.dart';
|
import 'package:mycoreapi/api.dart';
|
||||||
```
|
```
|
||||||
|
|
||||||
All URIs are relative to *http://localhost:25049*
|
All URIs are relative to *http://192.168.31.140*
|
||||||
|
|
||||||
Method | HTTP request | Description
|
Method | HTTP request | Description
|
||||||
------------- | ------------- | -------------
|
------------- | ------------- | -------------
|
||||||
[**providerCreate**](ProviderApi.md#providercreate) | **POST** /api/provider | Create a provider
|
[**providerCreate**](ProviderApi.md#providercreate) | **POST** /api/provider | Create a provider
|
||||||
[**providerDelete**](ProviderApi.md#providerdelete) | **DELETE** /api/provider/{providerId} | Delete 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
|
[**providerGetAll**](ProviderApi.md#providergetall) | **GET** /api/provider/{homeId} | Get all home providers
|
||||||
[**providerUpdate**](ProviderApi.md#providerupdate) | **PUT** /api/provider | Update a provider
|
[**providerUpdate**](ProviderApi.md#providerupdate) | **PUT** /api/provider | Update a provider
|
||||||
|
|
||||||
|
|
||||||
@ -102,9 +102,9 @@ Name | Type | Description | Notes
|
|||||||
[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md)
|
[[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**
|
# **providerGetAll**
|
||||||
> List<ProviderDTO> providerGetAll(userId)
|
> List<ProviderDTO> providerGetAll(homeId)
|
||||||
|
|
||||||
Get all user providers
|
Get all home providers
|
||||||
|
|
||||||
### Example
|
### Example
|
||||||
```dart
|
```dart
|
||||||
@ -113,10 +113,10 @@ import 'package:mycoreapi/api.dart';
|
|||||||
//defaultApiClient.getAuthentication<OAuth>('bearer').accessToken = 'YOUR_ACCESS_TOKEN';
|
//defaultApiClient.getAuthentication<OAuth>('bearer').accessToken = 'YOUR_ACCESS_TOKEN';
|
||||||
|
|
||||||
final api_instance = ProviderApi();
|
final api_instance = ProviderApi();
|
||||||
final userId = userId_example; // String | Id of user
|
final homeId = homeId_example; // String | Home Id
|
||||||
|
|
||||||
try {
|
try {
|
||||||
final result = api_instance.providerGetAll(userId);
|
final result = api_instance.providerGetAll(homeId);
|
||||||
print(result);
|
print(result);
|
||||||
} catch (e) {
|
} catch (e) {
|
||||||
print('Exception when calling ProviderApi->providerGetAll: $e\n');
|
print('Exception when calling ProviderApi->providerGetAll: $e\n');
|
||||||
@ -127,7 +127,7 @@ try {
|
|||||||
|
|
||||||
Name | Type | Description | Notes
|
Name | Type | Description | Notes
|
||||||
------------- | ------------- | ------------- | -------------
|
------------- | ------------- | ------------- | -------------
|
||||||
**userId** | **String**| Id of user |
|
**homeId** | **String**| Home Id |
|
||||||
|
|
||||||
### Return type
|
### Return type
|
||||||
|
|
||||||
|
|||||||
@ -10,8 +10,8 @@ Name | Type | Description | Notes
|
|||||||
------------ | ------------- | ------------- | -------------
|
------------ | ------------- | ------------- | -------------
|
||||||
**id** | **String** | | [optional]
|
**id** | **String** | | [optional]
|
||||||
**name** | **String** | | [optional]
|
**name** | **String** | | [optional]
|
||||||
**type** | **String** | | [optional]
|
**type** | [**ProviderType**](ProviderType.md) | | [optional]
|
||||||
**userId** | **String** | | [optional]
|
**homeId** | **String** | | [optional]
|
||||||
**endpoint** | **String** | | [optional]
|
**endpoint** | **String** | | [optional]
|
||||||
**username** | **String** | | [optional]
|
**username** | **String** | | [optional]
|
||||||
**password** | **String** | | [optional]
|
**password** | **String** | | [optional]
|
||||||
|
|||||||
14
mycore_api/doc/ProviderType.md
Normal file
14
mycore_api/doc/ProviderType.md
Normal file
@ -0,0 +1,14 @@
|
|||||||
|
# mycoreapi.model.ProviderType
|
||||||
|
|
||||||
|
## 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)
|
||||||
|
|
||||||
|
|
||||||
@ -5,15 +5,15 @@
|
|||||||
import 'package:mycoreapi/api.dart';
|
import 'package:mycoreapi/api.dart';
|
||||||
```
|
```
|
||||||
|
|
||||||
All URIs are relative to *http://localhost:25049*
|
All URIs are relative to *http://192.168.31.140*
|
||||||
|
|
||||||
Method | HTTP request | Description
|
Method | HTTP request | Description
|
||||||
------------- | ------------- | -------------
|
------------- | ------------- | -------------
|
||||||
[**roomCreate**](RoomApi.md#roomcreate) | **POST** /api/room | Create a room
|
[**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
|
[**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
|
[**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 user
|
[**roomDeleteAllForHome**](RoomApi.md#roomdeleteallforhome) | **DELETE** /api/room/home/{homeId} | Delete all rooms for a specified home
|
||||||
[**roomGetAll**](RoomApi.md#roomgetall) | **GET** /api/room/{userId} | Get all rooms for the specified user
|
[**roomGetAll**](RoomApi.md#roomgetall) | **GET** /api/room/{homeId} | Get all rooms for the specified home
|
||||||
[**roomGetDetail**](RoomApi.md#roomgetdetail) | **GET** /api/room/detail/{roomId} | Get detail info of a specified room
|
[**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
|
[**roomUpdate**](RoomApi.md#roomupdate) | **PUT** /api/room | Update a room
|
||||||
|
|
||||||
@ -149,10 +149,10 @@ Name | Type | Description | Notes
|
|||||||
|
|
||||||
[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md)
|
[[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**
|
# **roomDeleteAllForHome**
|
||||||
> String roomDeleteAllForUser(userId)
|
> String roomDeleteAllForHome(homeId)
|
||||||
|
|
||||||
Delete all room for a specified user
|
Delete all rooms for a specified home
|
||||||
|
|
||||||
### Example
|
### Example
|
||||||
```dart
|
```dart
|
||||||
@ -161,13 +161,13 @@ import 'package:mycoreapi/api.dart';
|
|||||||
//defaultApiClient.getAuthentication<OAuth>('bearer').accessToken = 'YOUR_ACCESS_TOKEN';
|
//defaultApiClient.getAuthentication<OAuth>('bearer').accessToken = 'YOUR_ACCESS_TOKEN';
|
||||||
|
|
||||||
final api_instance = RoomApi();
|
final api_instance = RoomApi();
|
||||||
final userId = userId_example; // String | Id of user
|
final homeId = homeId_example; // String | Home Id
|
||||||
|
|
||||||
try {
|
try {
|
||||||
final result = api_instance.roomDeleteAllForUser(userId);
|
final result = api_instance.roomDeleteAllForHome(homeId);
|
||||||
print(result);
|
print(result);
|
||||||
} catch (e) {
|
} catch (e) {
|
||||||
print('Exception when calling RoomApi->roomDeleteAllForUser: $e\n');
|
print('Exception when calling RoomApi->roomDeleteAllForHome: $e\n');
|
||||||
}
|
}
|
||||||
```
|
```
|
||||||
|
|
||||||
@ -175,7 +175,7 @@ try {
|
|||||||
|
|
||||||
Name | Type | Description | Notes
|
Name | Type | Description | Notes
|
||||||
------------- | ------------- | ------------- | -------------
|
------------- | ------------- | ------------- | -------------
|
||||||
**userId** | **String**| Id of user |
|
**homeId** | **String**| Home Id |
|
||||||
|
|
||||||
### Return type
|
### Return type
|
||||||
|
|
||||||
@ -193,9 +193,9 @@ Name | Type | Description | Notes
|
|||||||
[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md)
|
[[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**
|
# **roomGetAll**
|
||||||
> List<RoomSummaryDTO> roomGetAll(userId)
|
> List<RoomSummaryDTO> roomGetAll(homeId)
|
||||||
|
|
||||||
Get all rooms for the specified user
|
Get all rooms for the specified home
|
||||||
|
|
||||||
### Example
|
### Example
|
||||||
```dart
|
```dart
|
||||||
@ -204,10 +204,10 @@ import 'package:mycoreapi/api.dart';
|
|||||||
//defaultApiClient.getAuthentication<OAuth>('bearer').accessToken = 'YOUR_ACCESS_TOKEN';
|
//defaultApiClient.getAuthentication<OAuth>('bearer').accessToken = 'YOUR_ACCESS_TOKEN';
|
||||||
|
|
||||||
final api_instance = RoomApi();
|
final api_instance = RoomApi();
|
||||||
final userId = userId_example; // String | Id of user
|
final homeId = homeId_example; // String | Home Id
|
||||||
|
|
||||||
try {
|
try {
|
||||||
final result = api_instance.roomGetAll(userId);
|
final result = api_instance.roomGetAll(homeId);
|
||||||
print(result);
|
print(result);
|
||||||
} catch (e) {
|
} catch (e) {
|
||||||
print('Exception when calling RoomApi->roomGetAll: $e\n');
|
print('Exception when calling RoomApi->roomGetAll: $e\n');
|
||||||
@ -218,7 +218,7 @@ try {
|
|||||||
|
|
||||||
Name | Type | Description | Notes
|
Name | Type | Description | Notes
|
||||||
------------- | ------------- | ------------- | -------------
|
------------- | ------------- | ------------- | -------------
|
||||||
**userId** | **String**| Id of user |
|
**homeId** | **String**| Home Id |
|
||||||
|
|
||||||
### Return type
|
### Return type
|
||||||
|
|
||||||
@ -236,7 +236,7 @@ Name | Type | Description | Notes
|
|||||||
[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md)
|
[[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**
|
# **roomGetDetail**
|
||||||
> RoomDetailDTO roomGetDetail(roomId, userId)
|
> RoomDetailDTO roomGetDetail(roomId)
|
||||||
|
|
||||||
Get detail info of a specified room
|
Get detail info of a specified room
|
||||||
|
|
||||||
@ -248,10 +248,9 @@ import 'package:mycoreapi/api.dart';
|
|||||||
|
|
||||||
final api_instance = RoomApi();
|
final api_instance = RoomApi();
|
||||||
final roomId = roomId_example; // String | room id
|
final roomId = roomId_example; // String | room id
|
||||||
final userId = userId_example; // String | user id
|
|
||||||
|
|
||||||
try {
|
try {
|
||||||
final result = api_instance.roomGetDetail(roomId, userId);
|
final result = api_instance.roomGetDetail(roomId);
|
||||||
print(result);
|
print(result);
|
||||||
} catch (e) {
|
} catch (e) {
|
||||||
print('Exception when calling RoomApi->roomGetDetail: $e\n');
|
print('Exception when calling RoomApi->roomGetDetail: $e\n');
|
||||||
@ -263,7 +262,6 @@ try {
|
|||||||
Name | Type | Description | Notes
|
Name | Type | Description | Notes
|
||||||
------------- | ------------- | ------------- | -------------
|
------------- | ------------- | ------------- | -------------
|
||||||
**roomId** | **String**| room id |
|
**roomId** | **String**| room id |
|
||||||
**userId** | **String**| user id | [optional]
|
|
||||||
|
|
||||||
### Return type
|
### Return type
|
||||||
|
|
||||||
|
|||||||
@ -9,7 +9,7 @@ import 'package:mycoreapi/api.dart';
|
|||||||
Name | Type | Description | Notes
|
Name | Type | Description | Notes
|
||||||
------------ | ------------- | ------------- | -------------
|
------------ | ------------- | ------------- | -------------
|
||||||
**id** | **String** | | [optional]
|
**id** | **String** | | [optional]
|
||||||
**userId** | **String** | | [optional]
|
**homeId** | **String** | | [optional]
|
||||||
**name** | **String** | | [optional]
|
**name** | **String** | | [optional]
|
||||||
**deviceIds** | **List<String>** | | [optional] [default to const []]
|
**deviceIds** | **List<String>** | | [optional] [default to const []]
|
||||||
|
|
||||||
|
|||||||
@ -9,7 +9,7 @@ import 'package:mycoreapi/api.dart';
|
|||||||
Name | Type | Description | Notes
|
Name | Type | Description | Notes
|
||||||
------------ | ------------- | ------------- | -------------
|
------------ | ------------- | ------------- | -------------
|
||||||
**id** | **String** | | [optional]
|
**id** | **String** | | [optional]
|
||||||
**userId** | **String** | | [optional]
|
**homeId** | **String** | | [optional]
|
||||||
**name** | **String** | | [optional]
|
**name** | **String** | | [optional]
|
||||||
**createdDate** | [**DateTime**](DateTime.md) | | [optional]
|
**createdDate** | [**DateTime**](DateTime.md) | | [optional]
|
||||||
**updatedDate** | [**DateTime**](DateTime.md) | | [optional]
|
**updatedDate** | [**DateTime**](DateTime.md) | | [optional]
|
||||||
|
|||||||
@ -9,7 +9,7 @@ import 'package:mycoreapi/api.dart';
|
|||||||
Name | Type | Description | Notes
|
Name | Type | Description | Notes
|
||||||
------------ | ------------- | ------------- | -------------
|
------------ | ------------- | ------------- | -------------
|
||||||
**id** | **String** | | [optional]
|
**id** | **String** | | [optional]
|
||||||
**userId** | **String** | | [optional]
|
**homeId** | **String** | | [optional]
|
||||||
**name** | **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)
|
[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md)
|
||||||
|
|||||||
@ -5,7 +5,7 @@
|
|||||||
import 'package:mycoreapi/api.dart';
|
import 'package:mycoreapi/api.dart';
|
||||||
```
|
```
|
||||||
|
|
||||||
All URIs are relative to *http://localhost:25049*
|
All URIs are relative to *http://192.168.31.140*
|
||||||
|
|
||||||
Method | HTTP request | Description
|
Method | HTTP request | Description
|
||||||
------------- | ------------- | -------------
|
------------- | ------------- | -------------
|
||||||
|
|||||||
17
mycore_api/doc/TimePeriodAlarm.md
Normal file
17
mycore_api/doc/TimePeriodAlarm.md
Normal file
@ -0,0 +1,17 @@
|
|||||||
|
# mycoreapi.model.TimePeriodAlarm
|
||||||
|
|
||||||
|
## Load the model package
|
||||||
|
```dart
|
||||||
|
import 'package:mycoreapi/api.dart';
|
||||||
|
```
|
||||||
|
|
||||||
|
## Properties
|
||||||
|
Name | Type | Description | Notes
|
||||||
|
------------ | ------------- | ------------- | -------------
|
||||||
|
**start** | **String** | | [optional]
|
||||||
|
**end** | **String** | | [optional]
|
||||||
|
**alarmMode** | [**OneOfAlarmMode**](OneOfAlarmMode.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)
|
||||||
|
|
||||||
|
|
||||||
@ -5,7 +5,7 @@
|
|||||||
import 'package:mycoreapi/api.dart';
|
import 'package:mycoreapi/api.dart';
|
||||||
```
|
```
|
||||||
|
|
||||||
All URIs are relative to *http://localhost:25049*
|
All URIs are relative to *http://192.168.31.140*
|
||||||
|
|
||||||
Method | HTTP request | Description
|
Method | HTTP request | Description
|
||||||
------------- | ------------- | -------------
|
------------- | ------------- | -------------
|
||||||
|
|||||||
@ -5,7 +5,7 @@
|
|||||||
import 'package:mycoreapi/api.dart';
|
import 'package:mycoreapi/api.dart';
|
||||||
```
|
```
|
||||||
|
|
||||||
All URIs are relative to *http://localhost:25049*
|
All URIs are relative to *http://192.168.31.140*
|
||||||
|
|
||||||
Method | HTTP request | Description
|
Method | HTTP request | Description
|
||||||
------------- | ------------- | -------------
|
------------- | ------------- | -------------
|
||||||
|
|||||||
@ -5,7 +5,7 @@
|
|||||||
import 'package:mycoreapi/api.dart';
|
import 'package:mycoreapi/api.dart';
|
||||||
```
|
```
|
||||||
|
|
||||||
All URIs are relative to *http://localhost:25049*
|
All URIs are relative to *http://192.168.31.140*
|
||||||
|
|
||||||
Method | HTTP request | Description
|
Method | HTTP request | Description
|
||||||
------------- | ------------- | -------------
|
------------- | ------------- | -------------
|
||||||
|
|||||||
@ -16,6 +16,7 @@ Name | Type | Description | Notes
|
|||||||
**lastName** | **String** | | [optional]
|
**lastName** | **String** | | [optional]
|
||||||
**token** | **String** | | [optional]
|
**token** | **String** | | [optional]
|
||||||
**birthday** | [**DateTime**](DateTime.md) | | [optional]
|
**birthday** | [**DateTime**](DateTime.md) | | [optional]
|
||||||
|
**homeIds** | **List<String>** | | [optional] [default to const []]
|
||||||
**dateCreation** | [**DateTime**](DateTime.md) | | [optional]
|
**dateCreation** | [**DateTime**](DateTime.md) | | [optional]
|
||||||
**address** | **String** | | [optional]
|
**address** | **String** | | [optional]
|
||||||
**city** | **String** | | [optional]
|
**city** | **String** | | [optional]
|
||||||
@ -24,12 +25,6 @@ Name | Type | Description | Notes
|
|||||||
**language** | **String** | | [optional]
|
**language** | **String** | | [optional]
|
||||||
**timeZone** | **String** | | [optional]
|
**timeZone** | **String** | | [optional]
|
||||||
**postalCode** | **int** | | [optional]
|
**postalCode** | **int** | | [optional]
|
||||||
**automations** | [**List<Automation>**](Automation.md) | | [optional] [default to const []]
|
|
||||||
**devices** | [**List<Device>**](Device.md) | | [optional] [default to const []]
|
|
||||||
**providers** | [**List<Provider>**](Provider.md) | | [optional] [default to const []]
|
|
||||||
**groups** | [**List<Group>**](Group.md) | | [optional] [default to const []]
|
|
||||||
**screenConfigurationIds** | [**List<ScreenConfiguration>**](ScreenConfiguration.md) | | [optional] [default to const []]
|
|
||||||
**deviceIds** | [**List<ScreenDevice>**](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)
|
[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md)
|
||||||
|
|
||||||
|
|||||||
@ -5,7 +5,7 @@
|
|||||||
import 'package:mycoreapi/api.dart';
|
import 'package:mycoreapi/api.dart';
|
||||||
```
|
```
|
||||||
|
|
||||||
All URIs are relative to *http://localhost:25049*
|
All URIs are relative to *http://192.168.31.140*
|
||||||
|
|
||||||
Method | HTTP request | Description
|
Method | HTTP request | Description
|
||||||
------------- | ------------- | -------------
|
------------- | ------------- | -------------
|
||||||
|
|||||||
@ -27,15 +27,18 @@ part 'auth/oauth.dart';
|
|||||||
part 'auth/http_basic_auth.dart';
|
part 'auth/http_basic_auth.dart';
|
||||||
part 'auth/http_bearer_auth.dart';
|
part 'auth/http_bearer_auth.dart';
|
||||||
|
|
||||||
|
part 'api/alarm_api.dart';
|
||||||
part 'api/authentication_api.dart';
|
part 'api/authentication_api.dart';
|
||||||
part 'api/automation_api.dart';
|
part 'api/automation_api.dart';
|
||||||
part 'api/azure_api.dart';
|
part 'api/azure_api.dart';
|
||||||
part 'api/books_api.dart';
|
part 'api/books_api.dart';
|
||||||
part 'api/device_api.dart';
|
part 'api/device_api.dart';
|
||||||
part 'api/energy_api.dart';
|
part 'api/energy_api.dart';
|
||||||
|
part 'api/event_api.dart';
|
||||||
part 'api/facebook_api.dart';
|
part 'api/facebook_api.dart';
|
||||||
part 'api/google_api.dart';
|
part 'api/google_api.dart';
|
||||||
part 'api/group_api.dart';
|
part 'api/group_api.dart';
|
||||||
|
part 'api/home_api.dart';
|
||||||
part 'api/iot_api.dart';
|
part 'api/iot_api.dart';
|
||||||
part 'api/layout_api.dart';
|
part 'api/layout_api.dart';
|
||||||
part 'api/mqtt_api.dart';
|
part 'api/mqtt_api.dart';
|
||||||
@ -50,33 +53,48 @@ part 'api/values_api.dart';
|
|||||||
|
|
||||||
part 'model/action.dart';
|
part 'model/action.dart';
|
||||||
part 'model/action_type.dart';
|
part 'model/action_type.dart';
|
||||||
part 'model/automation.dart';
|
part 'model/alarm_mode.dart';
|
||||||
part 'model/automation_create_or_update_detail_dto.dart';
|
part 'model/alarm_mode_create_or_update_detail_dto.dart';
|
||||||
part 'model/automation_create_or_update_detail_dto_all_of.dart';
|
part 'model/alarm_mode_create_or_update_detail_dto_all_of.dart';
|
||||||
|
part 'model/alarm_mode_dto.dart';
|
||||||
|
part 'model/alarm_mode_detail_dto.dart';
|
||||||
|
part 'model/alarm_mode_detail_dto_all_of.dart';
|
||||||
|
part 'model/alarm_triggered.dart';
|
||||||
|
part 'model/alarm_type.dart';
|
||||||
part 'model/automation_dto.dart';
|
part 'model/automation_dto.dart';
|
||||||
part 'model/automation_detail_dto.dart';
|
part 'model/automation_detail_dto.dart';
|
||||||
part 'model/automation_detail_dto_all_of.dart';
|
part 'model/automation_detail_dto_all_of.dart';
|
||||||
part 'model/automation_state.dart';
|
part 'model/automation_state.dart';
|
||||||
|
part 'model/automation_triggered.dart';
|
||||||
part 'model/azure_ad_auth_model.dart';
|
part 'model/azure_ad_auth_model.dart';
|
||||||
part 'model/book.dart';
|
part 'model/book.dart';
|
||||||
part 'model/condition.dart';
|
part 'model/condition.dart';
|
||||||
part 'model/condition_type.dart';
|
part 'model/condition_type.dart';
|
||||||
part 'model/condition_value.dart';
|
part 'model/condition_value.dart';
|
||||||
part 'model/connection_status.dart';
|
part 'model/connection_status.dart';
|
||||||
part 'model/device.dart';
|
part 'model/create_or_update_home_dto.dart';
|
||||||
|
part 'model/create_or_update_home_dto_all_of.dart';
|
||||||
part 'model/device_detail_dto.dart';
|
part 'model/device_detail_dto.dart';
|
||||||
part 'model/device_detail_dto_all_of.dart';
|
part 'model/device_detail_dto_all_of.dart';
|
||||||
|
part 'model/device_state.dart';
|
||||||
part 'model/device_summary_dto.dart';
|
part 'model/device_summary_dto.dart';
|
||||||
part 'model/device_type.dart';
|
part 'model/device_type.dart';
|
||||||
part 'model/electricity_production.dart';
|
part 'model/electricity_production.dart';
|
||||||
|
part 'model/event_dto.dart';
|
||||||
|
part 'model/event_detail_dto.dart';
|
||||||
|
part 'model/event_detail_dto_all_of.dart';
|
||||||
|
part 'model/event_type.dart';
|
||||||
part 'model/facebook_auth_model.dart';
|
part 'model/facebook_auth_model.dart';
|
||||||
|
part 'model/geolocalized_mode.dart';
|
||||||
part 'model/google_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.dart';
|
||||||
part 'model/group_create_or_update_detail_dto_all_of.dart';
|
part 'model/group_create_or_update_detail_dto_all_of.dart';
|
||||||
part 'model/group_detail_dto.dart';
|
part 'model/group_detail_dto.dart';
|
||||||
part 'model/group_detail_dto_all_of.dart';
|
part 'model/group_detail_dto_all_of.dart';
|
||||||
part 'model/group_summary_dto.dart';
|
part 'model/group_summary_dto.dart';
|
||||||
|
part 'model/home_dto.dart';
|
||||||
|
part 'model/home_detail_dto.dart';
|
||||||
|
part 'model/home_detail_dto_all_of.dart';
|
||||||
part 'model/login_dto.dart';
|
part 'model/login_dto.dart';
|
||||||
part 'model/means_of_communication.dart';
|
part 'model/means_of_communication.dart';
|
||||||
part 'model/mqtt_message_dto.dart';
|
part 'model/mqtt_message_dto.dart';
|
||||||
@ -84,17 +102,17 @@ part 'model/odd_nice.dart';
|
|||||||
part 'model/odd_object.dart';
|
part 'model/odd_object.dart';
|
||||||
part 'model/panel_menu_item.dart';
|
part 'model/panel_menu_item.dart';
|
||||||
part 'model/panel_section.dart';
|
part 'model/panel_section.dart';
|
||||||
part 'model/place_dto.dart';
|
part 'model/programmed_mode.dart';
|
||||||
part 'model/provider.dart';
|
|
||||||
part 'model/provider_dto.dart';
|
part 'model/provider_dto.dart';
|
||||||
|
part 'model/provider_type.dart';
|
||||||
part 'model/room_create_or_update_detail_dto.dart';
|
part 'model/room_create_or_update_detail_dto.dart';
|
||||||
part 'model/room_detail_dto.dart';
|
part 'model/room_detail_dto.dart';
|
||||||
part 'model/room_summary_dto.dart';
|
part 'model/room_summary_dto.dart';
|
||||||
part 'model/screen_configuration.dart';
|
|
||||||
part 'model/screen_device.dart';
|
part 'model/screen_device.dart';
|
||||||
part 'model/screen_widget.dart';
|
part 'model/screen_widget.dart';
|
||||||
part 'model/smart_garden_message.dart';
|
part 'model/smart_garden_message.dart';
|
||||||
part 'model/smart_printer_message.dart';
|
part 'model/smart_printer_message.dart';
|
||||||
|
part 'model/time_period_alarm.dart';
|
||||||
part 'model/token_dto.dart';
|
part 'model/token_dto.dart';
|
||||||
part 'model/trigger.dart';
|
part 'model/trigger.dart';
|
||||||
part 'model/trigger_type.dart';
|
part 'model/trigger_type.dart';
|
||||||
|
|||||||
593
mycore_api/lib/api/alarm_api.dart
Normal file
593
mycore_api/lib/api/alarm_api.dart
Normal file
@ -0,0 +1,593 @@
|
|||||||
|
//
|
||||||
|
// 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 AlarmApi {
|
||||||
|
AlarmApi([ApiClient apiClient]) : apiClient = apiClient ?? defaultApiClient;
|
||||||
|
|
||||||
|
final ApiClient apiClient;
|
||||||
|
|
||||||
|
/// Activate current alarm mode
|
||||||
|
///
|
||||||
|
/// Note: This method returns the HTTP [Response].
|
||||||
|
///
|
||||||
|
/// Parameters:
|
||||||
|
///
|
||||||
|
/// * [String] alarmModeId (required):
|
||||||
|
/// Alarm mode to activate
|
||||||
|
Future<Response> alarmActivateWithHttpInfo(String alarmModeId) async {
|
||||||
|
// Verify required params are set.
|
||||||
|
if (alarmModeId == null) {
|
||||||
|
throw ApiException(HttpStatus.badRequest, 'Missing required param: alarmModeId');
|
||||||
|
}
|
||||||
|
|
||||||
|
final path = r'/api/alarm/activate/{alarmModeId}'
|
||||||
|
.replaceAll('{' + 'alarmModeId' + '}', alarmModeId.toString());
|
||||||
|
|
||||||
|
Object postBody;
|
||||||
|
|
||||||
|
final queryParams = <QueryParam>[];
|
||||||
|
final headerParams = <String, String>{};
|
||||||
|
final formParams = <String, String>{};
|
||||||
|
|
||||||
|
final contentTypes = <String>[];
|
||||||
|
final nullableContentType = contentTypes.isNotEmpty ? contentTypes[0] : null;
|
||||||
|
final authNames = <String>['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,
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
|
/// Activate current alarm mode
|
||||||
|
///
|
||||||
|
/// Parameters:
|
||||||
|
///
|
||||||
|
/// * [String] alarmModeId (required):
|
||||||
|
/// Alarm mode to activate
|
||||||
|
Future<String> alarmActivate(String alarmModeId) async {
|
||||||
|
final response = await alarmActivateWithHttpInfo(alarmModeId);
|
||||||
|
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<String>.value(null);
|
||||||
|
}
|
||||||
|
|
||||||
|
/// Create an alarm mode
|
||||||
|
///
|
||||||
|
/// Note: This method returns the HTTP [Response].
|
||||||
|
///
|
||||||
|
/// Parameters:
|
||||||
|
///
|
||||||
|
/// * [AlarmModeCreateOrUpdateDetailDTO] alarmModeCreateOrUpdateDetailDTO (required):
|
||||||
|
/// Alarm mode to create
|
||||||
|
Future<Response> alarmCreateWithHttpInfo(AlarmModeCreateOrUpdateDetailDTO alarmModeCreateOrUpdateDetailDTO) async {
|
||||||
|
// Verify required params are set.
|
||||||
|
if (alarmModeCreateOrUpdateDetailDTO == null) {
|
||||||
|
throw ApiException(HttpStatus.badRequest, 'Missing required param: alarmModeCreateOrUpdateDetailDTO');
|
||||||
|
}
|
||||||
|
|
||||||
|
final path = r'/api/alarm';
|
||||||
|
|
||||||
|
Object postBody = alarmModeCreateOrUpdateDetailDTO;
|
||||||
|
|
||||||
|
final queryParams = <QueryParam>[];
|
||||||
|
final headerParams = <String, String>{};
|
||||||
|
final formParams = <String, String>{};
|
||||||
|
|
||||||
|
final contentTypes = <String>['application/json'];
|
||||||
|
final nullableContentType = contentTypes.isNotEmpty ? contentTypes[0] : null;
|
||||||
|
final authNames = <String>['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 an alarm mode
|
||||||
|
///
|
||||||
|
/// Parameters:
|
||||||
|
///
|
||||||
|
/// * [AlarmModeCreateOrUpdateDetailDTO] alarmModeCreateOrUpdateDetailDTO (required):
|
||||||
|
/// Alarm mode to create
|
||||||
|
Future<AlarmModeDetailDTO> alarmCreate(AlarmModeCreateOrUpdateDetailDTO alarmModeCreateOrUpdateDetailDTO) async {
|
||||||
|
final response = await alarmCreateWithHttpInfo(alarmModeCreateOrUpdateDetailDTO);
|
||||||
|
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), 'AlarmModeDetailDTO') as AlarmModeDetailDTO;
|
||||||
|
}
|
||||||
|
return Future<AlarmModeDetailDTO>.value(null);
|
||||||
|
}
|
||||||
|
|
||||||
|
/// Create default alarm modes
|
||||||
|
///
|
||||||
|
/// Note: This method returns the HTTP [Response].
|
||||||
|
///
|
||||||
|
/// Parameters:
|
||||||
|
///
|
||||||
|
/// * [String] homeId (required):
|
||||||
|
/// Home Id
|
||||||
|
Future<Response> alarmCreateDefaultAlarmsWithHttpInfo(String homeId) async {
|
||||||
|
// Verify required params are set.
|
||||||
|
if (homeId == null) {
|
||||||
|
throw ApiException(HttpStatus.badRequest, 'Missing required param: homeId');
|
||||||
|
}
|
||||||
|
|
||||||
|
final path = r'/api/alarm/defaults/{homeId}'
|
||||||
|
.replaceAll('{' + 'homeId' + '}', homeId.toString());
|
||||||
|
|
||||||
|
Object postBody;
|
||||||
|
|
||||||
|
final queryParams = <QueryParam>[];
|
||||||
|
final headerParams = <String, String>{};
|
||||||
|
final formParams = <String, String>{};
|
||||||
|
|
||||||
|
final contentTypes = <String>[];
|
||||||
|
final nullableContentType = contentTypes.isNotEmpty ? contentTypes[0] : null;
|
||||||
|
final authNames = <String>['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 default alarm modes
|
||||||
|
///
|
||||||
|
/// Parameters:
|
||||||
|
///
|
||||||
|
/// * [String] homeId (required):
|
||||||
|
/// Home Id
|
||||||
|
Future<bool> alarmCreateDefaultAlarms(String homeId) async {
|
||||||
|
final response = await alarmCreateDefaultAlarmsWithHttpInfo(homeId);
|
||||||
|
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<bool>.value(null);
|
||||||
|
}
|
||||||
|
|
||||||
|
/// Delete an alarm mode
|
||||||
|
///
|
||||||
|
/// Note: This method returns the HTTP [Response].
|
||||||
|
///
|
||||||
|
/// Parameters:
|
||||||
|
///
|
||||||
|
/// * [String] alarmModeId (required):
|
||||||
|
/// Id of alarm mode to delete
|
||||||
|
Future<Response> alarmDeleteWithHttpInfo(String alarmModeId) async {
|
||||||
|
// Verify required params are set.
|
||||||
|
if (alarmModeId == null) {
|
||||||
|
throw ApiException(HttpStatus.badRequest, 'Missing required param: alarmModeId');
|
||||||
|
}
|
||||||
|
|
||||||
|
final path = r'/api/alarm/{alarmModeId}'
|
||||||
|
.replaceAll('{' + 'alarmModeId' + '}', alarmModeId.toString());
|
||||||
|
|
||||||
|
Object postBody;
|
||||||
|
|
||||||
|
final queryParams = <QueryParam>[];
|
||||||
|
final headerParams = <String, String>{};
|
||||||
|
final formParams = <String, String>{};
|
||||||
|
|
||||||
|
final contentTypes = <String>[];
|
||||||
|
final nullableContentType = contentTypes.isNotEmpty ? contentTypes[0] : null;
|
||||||
|
final authNames = <String>['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 alarm mode
|
||||||
|
///
|
||||||
|
/// Parameters:
|
||||||
|
///
|
||||||
|
/// * [String] alarmModeId (required):
|
||||||
|
/// Id of alarm mode to delete
|
||||||
|
Future<String> alarmDelete(String alarmModeId) async {
|
||||||
|
final response = await alarmDeleteWithHttpInfo(alarmModeId);
|
||||||
|
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<String>.value(null);
|
||||||
|
}
|
||||||
|
|
||||||
|
/// Delete all alarm mode for a specified home
|
||||||
|
///
|
||||||
|
/// Note: This method returns the HTTP [Response].
|
||||||
|
///
|
||||||
|
/// Parameters:
|
||||||
|
///
|
||||||
|
/// * [String] homeId (required):
|
||||||
|
/// Home Id
|
||||||
|
Future<Response> alarmDeleteAllForHomeWithHttpInfo(String homeId) async {
|
||||||
|
// Verify required params are set.
|
||||||
|
if (homeId == null) {
|
||||||
|
throw ApiException(HttpStatus.badRequest, 'Missing required param: homeId');
|
||||||
|
}
|
||||||
|
|
||||||
|
final path = r'/api/alarm/home/{homeId}'
|
||||||
|
.replaceAll('{' + 'homeId' + '}', homeId.toString());
|
||||||
|
|
||||||
|
Object postBody;
|
||||||
|
|
||||||
|
final queryParams = <QueryParam>[];
|
||||||
|
final headerParams = <String, String>{};
|
||||||
|
final formParams = <String, String>{};
|
||||||
|
|
||||||
|
final contentTypes = <String>[];
|
||||||
|
final nullableContentType = contentTypes.isNotEmpty ? contentTypes[0] : null;
|
||||||
|
final authNames = <String>['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 alarm mode for a specified home
|
||||||
|
///
|
||||||
|
/// Parameters:
|
||||||
|
///
|
||||||
|
/// * [String] homeId (required):
|
||||||
|
/// Home Id
|
||||||
|
Future<String> alarmDeleteAllForHome(String homeId) async {
|
||||||
|
final response = await alarmDeleteAllForHomeWithHttpInfo(homeId);
|
||||||
|
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<String>.value(null);
|
||||||
|
}
|
||||||
|
|
||||||
|
/// Get all alarm modes for the specified home
|
||||||
|
///
|
||||||
|
/// Note: This method returns the HTTP [Response].
|
||||||
|
///
|
||||||
|
/// Parameters:
|
||||||
|
///
|
||||||
|
/// * [String] homeId (required):
|
||||||
|
/// Home Id
|
||||||
|
Future<Response> alarmGetAllWithHttpInfo(String homeId) async {
|
||||||
|
// Verify required params are set.
|
||||||
|
if (homeId == null) {
|
||||||
|
throw ApiException(HttpStatus.badRequest, 'Missing required param: homeId');
|
||||||
|
}
|
||||||
|
|
||||||
|
final path = r'/api/alarm/{homeId}'
|
||||||
|
.replaceAll('{' + 'homeId' + '}', homeId.toString());
|
||||||
|
|
||||||
|
Object postBody;
|
||||||
|
|
||||||
|
final queryParams = <QueryParam>[];
|
||||||
|
final headerParams = <String, String>{};
|
||||||
|
final formParams = <String, String>{};
|
||||||
|
|
||||||
|
final contentTypes = <String>[];
|
||||||
|
final nullableContentType = contentTypes.isNotEmpty ? contentTypes[0] : null;
|
||||||
|
final authNames = <String>['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 alarm modes for the specified home
|
||||||
|
///
|
||||||
|
/// Parameters:
|
||||||
|
///
|
||||||
|
/// * [String] homeId (required):
|
||||||
|
/// Home Id
|
||||||
|
Future<List<AlarmModeDTO>> alarmGetAll(String homeId) async {
|
||||||
|
final response = await alarmGetAllWithHttpInfo(homeId);
|
||||||
|
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<AlarmModeDTO>') as List)
|
||||||
|
.cast<AlarmModeDTO>()
|
||||||
|
.toList(growable: false);
|
||||||
|
}
|
||||||
|
return Future<List<AlarmModeDTO>>.value(null);
|
||||||
|
}
|
||||||
|
|
||||||
|
/// Get detail info of a specified alarm mode
|
||||||
|
///
|
||||||
|
/// Note: This method returns the HTTP [Response].
|
||||||
|
///
|
||||||
|
/// Parameters:
|
||||||
|
///
|
||||||
|
/// * [String] alarmId (required):
|
||||||
|
///
|
||||||
|
/// * [String] alarmModeId:
|
||||||
|
/// alarm id
|
||||||
|
Future<Response> alarmGetDetailWithHttpInfo(String alarmId, { String alarmModeId }) async {
|
||||||
|
// Verify required params are set.
|
||||||
|
if (alarmId == null) {
|
||||||
|
throw ApiException(HttpStatus.badRequest, 'Missing required param: alarmId');
|
||||||
|
}
|
||||||
|
|
||||||
|
final path = r'/api/alarm/detail/{alarmId}'
|
||||||
|
.replaceAll('{' + 'alarmId' + '}', alarmId.toString());
|
||||||
|
|
||||||
|
Object postBody;
|
||||||
|
|
||||||
|
final queryParams = <QueryParam>[];
|
||||||
|
final headerParams = <String, String>{};
|
||||||
|
final formParams = <String, String>{};
|
||||||
|
|
||||||
|
if (alarmModeId != null) {
|
||||||
|
queryParams.addAll(_convertParametersForCollectionFormat('', 'alarmModeId', alarmModeId));
|
||||||
|
}
|
||||||
|
|
||||||
|
final contentTypes = <String>[];
|
||||||
|
final nullableContentType = contentTypes.isNotEmpty ? contentTypes[0] : null;
|
||||||
|
final authNames = <String>['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 alarm mode
|
||||||
|
///
|
||||||
|
/// Parameters:
|
||||||
|
///
|
||||||
|
/// * [String] alarmId (required):
|
||||||
|
///
|
||||||
|
/// * [String] alarmModeId:
|
||||||
|
/// alarm id
|
||||||
|
Future<AlarmModeDetailDTO> alarmGetDetail(String alarmId, { String alarmModeId }) async {
|
||||||
|
final response = await alarmGetDetailWithHttpInfo(alarmId, alarmModeId: alarmModeId );
|
||||||
|
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), 'AlarmModeDetailDTO') as AlarmModeDetailDTO;
|
||||||
|
}
|
||||||
|
return Future<AlarmModeDetailDTO>.value(null);
|
||||||
|
}
|
||||||
|
|
||||||
|
/// Update an alarm mode
|
||||||
|
///
|
||||||
|
/// Note: This method returns the HTTP [Response].
|
||||||
|
///
|
||||||
|
/// Parameters:
|
||||||
|
///
|
||||||
|
/// * [AlarmModeCreateOrUpdateDetailDTO] alarmModeCreateOrUpdateDetailDTO (required):
|
||||||
|
/// alarm mode to update
|
||||||
|
Future<Response> alarmUpdateWithHttpInfo(AlarmModeCreateOrUpdateDetailDTO alarmModeCreateOrUpdateDetailDTO) async {
|
||||||
|
// Verify required params are set.
|
||||||
|
if (alarmModeCreateOrUpdateDetailDTO == null) {
|
||||||
|
throw ApiException(HttpStatus.badRequest, 'Missing required param: alarmModeCreateOrUpdateDetailDTO');
|
||||||
|
}
|
||||||
|
|
||||||
|
final path = r'/api/alarm';
|
||||||
|
|
||||||
|
Object postBody = alarmModeCreateOrUpdateDetailDTO;
|
||||||
|
|
||||||
|
final queryParams = <QueryParam>[];
|
||||||
|
final headerParams = <String, String>{};
|
||||||
|
final formParams = <String, String>{};
|
||||||
|
|
||||||
|
final contentTypes = <String>['application/json'];
|
||||||
|
final nullableContentType = contentTypes.isNotEmpty ? contentTypes[0] : null;
|
||||||
|
final authNames = <String>['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 alarm mode
|
||||||
|
///
|
||||||
|
/// Parameters:
|
||||||
|
///
|
||||||
|
/// * [AlarmModeCreateOrUpdateDetailDTO] alarmModeCreateOrUpdateDetailDTO (required):
|
||||||
|
/// alarm mode to update
|
||||||
|
Future<AlarmModeDetailDTO> alarmUpdate(AlarmModeCreateOrUpdateDetailDTO alarmModeCreateOrUpdateDetailDTO) async {
|
||||||
|
final response = await alarmUpdateWithHttpInfo(alarmModeCreateOrUpdateDetailDTO);
|
||||||
|
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), 'AlarmModeDetailDTO') as AlarmModeDetailDTO;
|
||||||
|
}
|
||||||
|
return Future<AlarmModeDetailDTO>.value(null);
|
||||||
|
}
|
||||||
|
}
|
||||||
@ -21,17 +21,17 @@ class AutomationApi {
|
|||||||
///
|
///
|
||||||
/// Parameters:
|
/// Parameters:
|
||||||
///
|
///
|
||||||
/// * [AutomationCreateOrUpdateDetailDTO] automationCreateOrUpdateDetailDTO (required):
|
/// * [AutomationDetailDTO] automationDetailDTO (required):
|
||||||
/// Automation to create
|
/// Automation to create
|
||||||
Future<Response> automationCreateWithHttpInfo(AutomationCreateOrUpdateDetailDTO automationCreateOrUpdateDetailDTO) async {
|
Future<Response> automationCreateWithHttpInfo(AutomationDetailDTO automationDetailDTO) async {
|
||||||
// Verify required params are set.
|
// Verify required params are set.
|
||||||
if (automationCreateOrUpdateDetailDTO == null) {
|
if (automationDetailDTO == null) {
|
||||||
throw ApiException(HttpStatus.badRequest, 'Missing required param: automationCreateOrUpdateDetailDTO');
|
throw ApiException(HttpStatus.badRequest, 'Missing required param: automationDetailDTO');
|
||||||
}
|
}
|
||||||
|
|
||||||
final path = r'/api/automation';
|
final path = r'/api/automation';
|
||||||
|
|
||||||
Object postBody = automationCreateOrUpdateDetailDTO;
|
Object postBody = automationDetailDTO;
|
||||||
|
|
||||||
final queryParams = <QueryParam>[];
|
final queryParams = <QueryParam>[];
|
||||||
final headerParams = <String, String>{};
|
final headerParams = <String, String>{};
|
||||||
@ -69,10 +69,10 @@ class AutomationApi {
|
|||||||
///
|
///
|
||||||
/// Parameters:
|
/// Parameters:
|
||||||
///
|
///
|
||||||
/// * [AutomationCreateOrUpdateDetailDTO] automationCreateOrUpdateDetailDTO (required):
|
/// * [AutomationDetailDTO] automationDetailDTO (required):
|
||||||
/// Automation to create
|
/// Automation to create
|
||||||
Future<AutomationDTO> automationCreate(AutomationCreateOrUpdateDetailDTO automationCreateOrUpdateDetailDTO) async {
|
Future<AutomationDTO> automationCreate(AutomationDetailDTO automationDetailDTO) async {
|
||||||
final response = await automationCreateWithHttpInfo(automationCreateOrUpdateDetailDTO);
|
final response = await automationCreateWithHttpInfo(automationDetailDTO);
|
||||||
if (response.statusCode >= HttpStatus.badRequest) {
|
if (response.statusCode >= HttpStatus.badRequest) {
|
||||||
throw ApiException(response.statusCode, _decodeBodyBytes(response));
|
throw ApiException(response.statusCode, _decodeBodyBytes(response));
|
||||||
}
|
}
|
||||||
@ -156,22 +156,22 @@ class AutomationApi {
|
|||||||
return Future<String>.value(null);
|
return Future<String>.value(null);
|
||||||
}
|
}
|
||||||
|
|
||||||
/// Delete all automation for a specified
|
/// Delete all automation for a specified home
|
||||||
///
|
///
|
||||||
/// Note: This method returns the HTTP [Response].
|
/// Note: This method returns the HTTP [Response].
|
||||||
///
|
///
|
||||||
/// Parameters:
|
/// Parameters:
|
||||||
///
|
///
|
||||||
/// * [String] userId (required):
|
/// * [String] homeId (required):
|
||||||
/// Id of user
|
/// Home Id
|
||||||
Future<Response> automationDeleteAllForUserWithHttpInfo(String userId) async {
|
Future<Response> automationDeleteAllForHomeWithHttpInfo(String homeId) async {
|
||||||
// Verify required params are set.
|
// Verify required params are set.
|
||||||
if (userId == null) {
|
if (homeId == null) {
|
||||||
throw ApiException(HttpStatus.badRequest, 'Missing required param: userId');
|
throw ApiException(HttpStatus.badRequest, 'Missing required param: homeId');
|
||||||
}
|
}
|
||||||
|
|
||||||
final path = r'/api/automation/user/{userId}'
|
final path = r'/api/automation/home/{homeId}'
|
||||||
.replaceAll('{' + 'userId' + '}', userId.toString());
|
.replaceAll('{' + 'homeId' + '}', homeId.toString());
|
||||||
|
|
||||||
Object postBody;
|
Object postBody;
|
||||||
|
|
||||||
@ -207,14 +207,14 @@ class AutomationApi {
|
|||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
/// Delete all automation for a specified
|
/// Delete all automation for a specified home
|
||||||
///
|
///
|
||||||
/// Parameters:
|
/// Parameters:
|
||||||
///
|
///
|
||||||
/// * [String] userId (required):
|
/// * [String] homeId (required):
|
||||||
/// Id of user
|
/// Home Id
|
||||||
Future<String> automationDeleteAllForUser(String userId) async {
|
Future<String> automationDeleteAllForHome(String homeId) async {
|
||||||
final response = await automationDeleteAllForUserWithHttpInfo(userId);
|
final response = await automationDeleteAllForHomeWithHttpInfo(homeId);
|
||||||
if (response.statusCode >= HttpStatus.badRequest) {
|
if (response.statusCode >= HttpStatus.badRequest) {
|
||||||
throw ApiException(response.statusCode, _decodeBodyBytes(response));
|
throw ApiException(response.statusCode, _decodeBodyBytes(response));
|
||||||
}
|
}
|
||||||
@ -227,22 +227,22 @@ class AutomationApi {
|
|||||||
return Future<String>.value(null);
|
return Future<String>.value(null);
|
||||||
}
|
}
|
||||||
|
|
||||||
/// Get all automations for the specified user
|
/// Get all automations for the specified home
|
||||||
///
|
///
|
||||||
/// Note: This method returns the HTTP [Response].
|
/// Note: This method returns the HTTP [Response].
|
||||||
///
|
///
|
||||||
/// Parameters:
|
/// Parameters:
|
||||||
///
|
///
|
||||||
/// * [String] userId (required):
|
/// * [String] homeId (required):
|
||||||
/// Id of user
|
/// Home Id
|
||||||
Future<Response> automationGetAllWithHttpInfo(String userId) async {
|
Future<Response> automationGetAllWithHttpInfo(String homeId) async {
|
||||||
// Verify required params are set.
|
// Verify required params are set.
|
||||||
if (userId == null) {
|
if (homeId == null) {
|
||||||
throw ApiException(HttpStatus.badRequest, 'Missing required param: userId');
|
throw ApiException(HttpStatus.badRequest, 'Missing required param: homeId');
|
||||||
}
|
}
|
||||||
|
|
||||||
final path = r'/api/automation/{userId}'
|
final path = r'/api/automation/{homeId}'
|
||||||
.replaceAll('{' + 'userId' + '}', userId.toString());
|
.replaceAll('{' + 'homeId' + '}', homeId.toString());
|
||||||
|
|
||||||
Object postBody;
|
Object postBody;
|
||||||
|
|
||||||
@ -278,14 +278,14 @@ class AutomationApi {
|
|||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
/// Get all automations for the specified user
|
/// Get all automations for the specified home
|
||||||
///
|
///
|
||||||
/// Parameters:
|
/// Parameters:
|
||||||
///
|
///
|
||||||
/// * [String] userId (required):
|
/// * [String] homeId (required):
|
||||||
/// Id of user
|
/// Home Id
|
||||||
Future<List<AutomationDTO>> automationGetAll(String userId) async {
|
Future<List<AutomationDTO>> automationGetAll(String homeId) async {
|
||||||
final response = await automationGetAllWithHttpInfo(userId);
|
final response = await automationGetAllWithHttpInfo(homeId);
|
||||||
if (response.statusCode >= HttpStatus.badRequest) {
|
if (response.statusCode >= HttpStatus.badRequest) {
|
||||||
throw ApiException(response.statusCode, _decodeBodyBytes(response));
|
throw ApiException(response.statusCode, _decodeBodyBytes(response));
|
||||||
}
|
}
|
||||||
@ -377,17 +377,17 @@ class AutomationApi {
|
|||||||
///
|
///
|
||||||
/// Parameters:
|
/// Parameters:
|
||||||
///
|
///
|
||||||
/// * [AutomationCreateOrUpdateDetailDTO] automationCreateOrUpdateDetailDTO (required):
|
/// * [AutomationDetailDTO] automationDetailDTO (required):
|
||||||
/// automation to update
|
/// automation to update
|
||||||
Future<Response> automationUpdateWithHttpInfo(AutomationCreateOrUpdateDetailDTO automationCreateOrUpdateDetailDTO) async {
|
Future<Response> automationUpdateWithHttpInfo(AutomationDetailDTO automationDetailDTO) async {
|
||||||
// Verify required params are set.
|
// Verify required params are set.
|
||||||
if (automationCreateOrUpdateDetailDTO == null) {
|
if (automationDetailDTO == null) {
|
||||||
throw ApiException(HttpStatus.badRequest, 'Missing required param: automationCreateOrUpdateDetailDTO');
|
throw ApiException(HttpStatus.badRequest, 'Missing required param: automationDetailDTO');
|
||||||
}
|
}
|
||||||
|
|
||||||
final path = r'/api/automation';
|
final path = r'/api/automation';
|
||||||
|
|
||||||
Object postBody = automationCreateOrUpdateDetailDTO;
|
Object postBody = automationDetailDTO;
|
||||||
|
|
||||||
final queryParams = <QueryParam>[];
|
final queryParams = <QueryParam>[];
|
||||||
final headerParams = <String, String>{};
|
final headerParams = <String, String>{};
|
||||||
@ -425,10 +425,10 @@ class AutomationApi {
|
|||||||
///
|
///
|
||||||
/// Parameters:
|
/// Parameters:
|
||||||
///
|
///
|
||||||
/// * [AutomationCreateOrUpdateDetailDTO] automationCreateOrUpdateDetailDTO (required):
|
/// * [AutomationDetailDTO] automationDetailDTO (required):
|
||||||
/// automation to update
|
/// automation to update
|
||||||
Future<AutomationCreateOrUpdateDetailDTO> automationUpdate(AutomationCreateOrUpdateDetailDTO automationCreateOrUpdateDetailDTO) async {
|
Future<AutomationDetailDTO> automationUpdate(AutomationDetailDTO automationDetailDTO) async {
|
||||||
final response = await automationUpdateWithHttpInfo(automationCreateOrUpdateDetailDTO);
|
final response = await automationUpdateWithHttpInfo(automationDetailDTO);
|
||||||
if (response.statusCode >= HttpStatus.badRequest) {
|
if (response.statusCode >= HttpStatus.badRequest) {
|
||||||
throw ApiException(response.statusCode, _decodeBodyBytes(response));
|
throw ApiException(response.statusCode, _decodeBodyBytes(response));
|
||||||
}
|
}
|
||||||
@ -436,8 +436,8 @@ class AutomationApi {
|
|||||||
// At the time of writing this, `dart:convert` will throw an "Unexpected end of input"
|
// At the time of writing this, `dart:convert` will throw an "Unexpected end of input"
|
||||||
// FormatException when trying to decode an empty string.
|
// FormatException when trying to decode an empty string.
|
||||||
if (response.body != null && response.statusCode != HttpStatus.noContent) {
|
if (response.body != null && response.statusCode != HttpStatus.noContent) {
|
||||||
return apiClient.deserialize(_decodeBodyBytes(response), 'AutomationCreateOrUpdateDetailDTO') as AutomationCreateOrUpdateDetailDTO;
|
return apiClient.deserialize(_decodeBodyBytes(response), 'AutomationDetailDTO') as AutomationDetailDTO;
|
||||||
}
|
}
|
||||||
return Future<AutomationCreateOrUpdateDetailDTO>.value(null);
|
return Future<AutomationDetailDTO>.value(null);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@ -91,22 +91,22 @@ class DeviceApi {
|
|||||||
///
|
///
|
||||||
/// Parameters:
|
/// Parameters:
|
||||||
///
|
///
|
||||||
/// * [String] userId (required):
|
/// * [String] homeId (required):
|
||||||
/// User Id
|
/// Home Id
|
||||||
///
|
///
|
||||||
/// * [String] providerId (required):
|
/// * [String] providerId (required):
|
||||||
/// Id of Provider
|
/// Id of Provider
|
||||||
Future<Response> deviceCreateDevicesFromProviderWithHttpInfo(String userId, String providerId) async {
|
Future<Response> deviceCreateDevicesFromProviderWithHttpInfo(String homeId, String providerId) async {
|
||||||
// Verify required params are set.
|
// Verify required params are set.
|
||||||
if (userId == null) {
|
if (homeId == null) {
|
||||||
throw ApiException(HttpStatus.badRequest, 'Missing required param: userId');
|
throw ApiException(HttpStatus.badRequest, 'Missing required param: homeId');
|
||||||
}
|
}
|
||||||
if (providerId == null) {
|
if (providerId == null) {
|
||||||
throw ApiException(HttpStatus.badRequest, 'Missing required param: providerId');
|
throw ApiException(HttpStatus.badRequest, 'Missing required param: providerId');
|
||||||
}
|
}
|
||||||
|
|
||||||
final path = r'/api/device/{userId}/fromProvider/{providerId}'
|
final path = r'/api/device/{homeId}/fromProvider/{providerId}'
|
||||||
.replaceAll('{' + 'userId' + '}', userId.toString())
|
.replaceAll('{' + 'homeId' + '}', homeId.toString())
|
||||||
.replaceAll('{' + 'providerId' + '}', providerId.toString());
|
.replaceAll('{' + 'providerId' + '}', providerId.toString());
|
||||||
|
|
||||||
Object postBody;
|
Object postBody;
|
||||||
@ -147,13 +147,13 @@ class DeviceApi {
|
|||||||
///
|
///
|
||||||
/// Parameters:
|
/// Parameters:
|
||||||
///
|
///
|
||||||
/// * [String] userId (required):
|
/// * [String] homeId (required):
|
||||||
/// User Id
|
/// Home Id
|
||||||
///
|
///
|
||||||
/// * [String] providerId (required):
|
/// * [String] providerId (required):
|
||||||
/// Id of Provider
|
/// Id of Provider
|
||||||
Future<List<DeviceDetailDTO>> deviceCreateDevicesFromProvider(String userId, String providerId) async {
|
Future<List<DeviceDetailDTO>> deviceCreateDevicesFromProvider(String homeId, String providerId) async {
|
||||||
final response = await deviceCreateDevicesFromProviderWithHttpInfo(userId, providerId);
|
final response = await deviceCreateDevicesFromProviderWithHttpInfo(homeId, providerId);
|
||||||
if (response.statusCode >= HttpStatus.badRequest) {
|
if (response.statusCode >= HttpStatus.badRequest) {
|
||||||
throw ApiException(response.statusCode, _decodeBodyBytes(response));
|
throw ApiException(response.statusCode, _decodeBodyBytes(response));
|
||||||
}
|
}
|
||||||
@ -239,22 +239,22 @@ class DeviceApi {
|
|||||||
return Future<String>.value(null);
|
return Future<String>.value(null);
|
||||||
}
|
}
|
||||||
|
|
||||||
/// Delete all device for a specified user
|
/// Delete all device for a specified home
|
||||||
///
|
///
|
||||||
/// Note: This method returns the HTTP [Response].
|
/// Note: This method returns the HTTP [Response].
|
||||||
///
|
///
|
||||||
/// Parameters:
|
/// Parameters:
|
||||||
///
|
///
|
||||||
/// * [String] userId (required):
|
/// * [String] homeId (required):
|
||||||
/// Id of user
|
/// Id of home
|
||||||
Future<Response> deviceDeleteAllForUserWithHttpInfo(String userId) async {
|
Future<Response> deviceDeleteAllForHomeWithHttpInfo(String homeId) async {
|
||||||
// Verify required params are set.
|
// Verify required params are set.
|
||||||
if (userId == null) {
|
if (homeId == null) {
|
||||||
throw ApiException(HttpStatus.badRequest, 'Missing required param: userId');
|
throw ApiException(HttpStatus.badRequest, 'Missing required param: homeId');
|
||||||
}
|
}
|
||||||
|
|
||||||
final path = r'/api/device/user/{userId}'
|
final path = r'/api/device/home/{homeId}'
|
||||||
.replaceAll('{' + 'userId' + '}', userId.toString());
|
.replaceAll('{' + 'homeId' + '}', homeId.toString());
|
||||||
|
|
||||||
Object postBody;
|
Object postBody;
|
||||||
|
|
||||||
@ -290,14 +290,14 @@ class DeviceApi {
|
|||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
/// Delete all device for a specified user
|
/// Delete all device for a specified home
|
||||||
///
|
///
|
||||||
/// Parameters:
|
/// Parameters:
|
||||||
///
|
///
|
||||||
/// * [String] userId (required):
|
/// * [String] homeId (required):
|
||||||
/// Id of user
|
/// Id of home
|
||||||
Future<String> deviceDeleteAllForUser(String userId) async {
|
Future<String> deviceDeleteAllForHome(String homeId) async {
|
||||||
final response = await deviceDeleteAllForUserWithHttpInfo(userId);
|
final response = await deviceDeleteAllForHomeWithHttpInfo(homeId);
|
||||||
if (response.statusCode >= HttpStatus.badRequest) {
|
if (response.statusCode >= HttpStatus.badRequest) {
|
||||||
throw ApiException(response.statusCode, _decodeBodyBytes(response));
|
throw ApiException(response.statusCode, _decodeBodyBytes(response));
|
||||||
}
|
}
|
||||||
@ -316,22 +316,22 @@ class DeviceApi {
|
|||||||
///
|
///
|
||||||
/// Parameters:
|
/// Parameters:
|
||||||
///
|
///
|
||||||
/// * [String] userId (required):
|
/// * [String] homeId (required):
|
||||||
/// User Id
|
/// Home Id
|
||||||
///
|
///
|
||||||
/// * [String] providerId (required):
|
/// * [String] providerId (required):
|
||||||
/// Id of Provider
|
/// Id of Provider
|
||||||
Future<Response> deviceDeleteDevicesFromProviderWithHttpInfo(String userId, String providerId) async {
|
Future<Response> deviceDeleteDevicesFromProviderWithHttpInfo(String homeId, String providerId) async {
|
||||||
// Verify required params are set.
|
// Verify required params are set.
|
||||||
if (userId == null) {
|
if (homeId == null) {
|
||||||
throw ApiException(HttpStatus.badRequest, 'Missing required param: userId');
|
throw ApiException(HttpStatus.badRequest, 'Missing required param: homeId');
|
||||||
}
|
}
|
||||||
if (providerId == null) {
|
if (providerId == null) {
|
||||||
throw ApiException(HttpStatus.badRequest, 'Missing required param: providerId');
|
throw ApiException(HttpStatus.badRequest, 'Missing required param: providerId');
|
||||||
}
|
}
|
||||||
|
|
||||||
final path = r'/api/device/{userId}/fromProvider/{providerId}'
|
final path = r'/api/device/{homeId}/fromProvider/{providerId}'
|
||||||
.replaceAll('{' + 'userId' + '}', userId.toString())
|
.replaceAll('{' + 'homeId' + '}', homeId.toString())
|
||||||
.replaceAll('{' + 'providerId' + '}', providerId.toString());
|
.replaceAll('{' + 'providerId' + '}', providerId.toString());
|
||||||
|
|
||||||
Object postBody;
|
Object postBody;
|
||||||
@ -372,13 +372,13 @@ class DeviceApi {
|
|||||||
///
|
///
|
||||||
/// Parameters:
|
/// Parameters:
|
||||||
///
|
///
|
||||||
/// * [String] userId (required):
|
/// * [String] homeId (required):
|
||||||
/// User Id
|
/// Home Id
|
||||||
///
|
///
|
||||||
/// * [String] providerId (required):
|
/// * [String] providerId (required):
|
||||||
/// Id of Provider
|
/// Id of Provider
|
||||||
Future<String> deviceDeleteDevicesFromProvider(String userId, String providerId) async {
|
Future<String> deviceDeleteDevicesFromProvider(String homeId, String providerId) async {
|
||||||
final response = await deviceDeleteDevicesFromProviderWithHttpInfo(userId, providerId);
|
final response = await deviceDeleteDevicesFromProviderWithHttpInfo(homeId, providerId);
|
||||||
if (response.statusCode >= HttpStatus.badRequest) {
|
if (response.statusCode >= HttpStatus.badRequest) {
|
||||||
throw ApiException(response.statusCode, _decodeBodyBytes(response));
|
throw ApiException(response.statusCode, _decodeBodyBytes(response));
|
||||||
}
|
}
|
||||||
@ -397,16 +397,16 @@ class DeviceApi {
|
|||||||
///
|
///
|
||||||
/// Parameters:
|
/// Parameters:
|
||||||
///
|
///
|
||||||
/// * [String] userId (required):
|
/// * [String] homeId (required):
|
||||||
/// Id of user
|
/// Home Id
|
||||||
Future<Response> deviceGetAllWithHttpInfo(String userId) async {
|
Future<Response> deviceGetAllWithHttpInfo(String homeId) async {
|
||||||
// Verify required params are set.
|
// Verify required params are set.
|
||||||
if (userId == null) {
|
if (homeId == null) {
|
||||||
throw ApiException(HttpStatus.badRequest, 'Missing required param: userId');
|
throw ApiException(HttpStatus.badRequest, 'Missing required param: homeId');
|
||||||
}
|
}
|
||||||
|
|
||||||
final path = r'/api/device/{userId}'
|
final path = r'/api/device/{homeId}'
|
||||||
.replaceAll('{' + 'userId' + '}', userId.toString());
|
.replaceAll('{' + 'homeId' + '}', homeId.toString());
|
||||||
|
|
||||||
Object postBody;
|
Object postBody;
|
||||||
|
|
||||||
@ -446,10 +446,10 @@ class DeviceApi {
|
|||||||
///
|
///
|
||||||
/// Parameters:
|
/// Parameters:
|
||||||
///
|
///
|
||||||
/// * [String] userId (required):
|
/// * [String] homeId (required):
|
||||||
/// Id of user
|
/// Home Id
|
||||||
Future<List<DeviceSummaryDTO>> deviceGetAll(String userId) async {
|
Future<List<DeviceSummaryDTO>> deviceGetAll(String homeId) async {
|
||||||
final response = await deviceGetAllWithHttpInfo(userId);
|
final response = await deviceGetAllWithHttpInfo(homeId);
|
||||||
if (response.statusCode >= HttpStatus.badRequest) {
|
if (response.statusCode >= HttpStatus.badRequest) {
|
||||||
throw ApiException(response.statusCode, _decodeBodyBytes(response));
|
throw ApiException(response.statusCode, _decodeBodyBytes(response));
|
||||||
}
|
}
|
||||||
@ -541,22 +541,22 @@ class DeviceApi {
|
|||||||
///
|
///
|
||||||
/// Parameters:
|
/// Parameters:
|
||||||
///
|
///
|
||||||
/// * [String] userId (required):
|
/// * [String] homeId (required):
|
||||||
/// user Id
|
/// Home Id
|
||||||
///
|
///
|
||||||
/// * [DeviceType] type (required):
|
/// * [DeviceType] type (required):
|
||||||
/// device type
|
/// device type
|
||||||
Future<Response> deviceGetDevicesByTypeWithHttpInfo(String userId, DeviceType type) async {
|
Future<Response> deviceGetDevicesByTypeWithHttpInfo(String homeId, DeviceType type) async {
|
||||||
// Verify required params are set.
|
// Verify required params are set.
|
||||||
if (userId == null) {
|
if (homeId == null) {
|
||||||
throw ApiException(HttpStatus.badRequest, 'Missing required param: userId');
|
throw ApiException(HttpStatus.badRequest, 'Missing required param: homeId');
|
||||||
}
|
}
|
||||||
if (type == null) {
|
if (type == null) {
|
||||||
throw ApiException(HttpStatus.badRequest, 'Missing required param: type');
|
throw ApiException(HttpStatus.badRequest, 'Missing required param: type');
|
||||||
}
|
}
|
||||||
|
|
||||||
final path = r'/api/device/{userId}/type/{type}'
|
final path = r'/api/device/{homeId}/type/{type}'
|
||||||
.replaceAll('{' + 'userId' + '}', userId.toString())
|
.replaceAll('{' + 'homeId' + '}', homeId.toString())
|
||||||
.replaceAll('{' + 'type' + '}', type.toString());
|
.replaceAll('{' + 'type' + '}', type.toString());
|
||||||
|
|
||||||
Object postBody;
|
Object postBody;
|
||||||
@ -597,13 +597,13 @@ class DeviceApi {
|
|||||||
///
|
///
|
||||||
/// Parameters:
|
/// Parameters:
|
||||||
///
|
///
|
||||||
/// * [String] userId (required):
|
/// * [String] homeId (required):
|
||||||
/// user Id
|
/// Home Id
|
||||||
///
|
///
|
||||||
/// * [DeviceType] type (required):
|
/// * [DeviceType] type (required):
|
||||||
/// device type
|
/// device type
|
||||||
Future<List<DeviceDetailDTO>> deviceGetDevicesByType(String userId, DeviceType type) async {
|
Future<List<DeviceDetailDTO>> deviceGetDevicesByType(String homeId, DeviceType type) async {
|
||||||
final response = await deviceGetDevicesByTypeWithHttpInfo(userId, type);
|
final response = await deviceGetDevicesByTypeWithHttpInfo(homeId, type);
|
||||||
if (response.statusCode >= HttpStatus.badRequest) {
|
if (response.statusCode >= HttpStatus.badRequest) {
|
||||||
throw ApiException(response.statusCode, _decodeBodyBytes(response));
|
throw ApiException(response.statusCode, _decodeBodyBytes(response));
|
||||||
}
|
}
|
||||||
@ -624,22 +624,22 @@ class DeviceApi {
|
|||||||
///
|
///
|
||||||
/// Parameters:
|
/// Parameters:
|
||||||
///
|
///
|
||||||
/// * [String] userId (required):
|
/// * [String] homeId (required):
|
||||||
/// User Id
|
/// Home Id
|
||||||
///
|
///
|
||||||
/// * [String] providerId (required):
|
/// * [String] providerId (required):
|
||||||
/// Id of Provider
|
/// Id of Provider
|
||||||
Future<Response> deviceGetDevicesFromProviderWithHttpInfo(String userId, String providerId) async {
|
Future<Response> deviceGetDevicesFromProviderWithHttpInfo(String homeId, String providerId) async {
|
||||||
// Verify required params are set.
|
// Verify required params are set.
|
||||||
if (userId == null) {
|
if (homeId == null) {
|
||||||
throw ApiException(HttpStatus.badRequest, 'Missing required param: userId');
|
throw ApiException(HttpStatus.badRequest, 'Missing required param: homeId');
|
||||||
}
|
}
|
||||||
if (providerId == null) {
|
if (providerId == null) {
|
||||||
throw ApiException(HttpStatus.badRequest, 'Missing required param: providerId');
|
throw ApiException(HttpStatus.badRequest, 'Missing required param: providerId');
|
||||||
}
|
}
|
||||||
|
|
||||||
final path = r'/api/device/{userId}/fromProvider/{providerId}'
|
final path = r'/api/device/{homeId}/fromProvider/{providerId}'
|
||||||
.replaceAll('{' + 'userId' + '}', userId.toString())
|
.replaceAll('{' + 'homeId' + '}', homeId.toString())
|
||||||
.replaceAll('{' + 'providerId' + '}', providerId.toString());
|
.replaceAll('{' + 'providerId' + '}', providerId.toString());
|
||||||
|
|
||||||
Object postBody;
|
Object postBody;
|
||||||
@ -680,13 +680,13 @@ class DeviceApi {
|
|||||||
///
|
///
|
||||||
/// Parameters:
|
/// Parameters:
|
||||||
///
|
///
|
||||||
/// * [String] userId (required):
|
/// * [String] homeId (required):
|
||||||
/// User Id
|
/// Home Id
|
||||||
///
|
///
|
||||||
/// * [String] providerId (required):
|
/// * [String] providerId (required):
|
||||||
/// Id of Provider
|
/// Id of Provider
|
||||||
Future<List<DeviceDetailDTO>> deviceGetDevicesFromProvider(String userId, String providerId) async {
|
Future<List<DeviceDetailDTO>> deviceGetDevicesFromProvider(String homeId, String providerId) async {
|
||||||
final response = await deviceGetDevicesFromProviderWithHttpInfo(userId, providerId);
|
final response = await deviceGetDevicesFromProviderWithHttpInfo(homeId, providerId);
|
||||||
if (response.statusCode >= HttpStatus.badRequest) {
|
if (response.statusCode >= HttpStatus.badRequest) {
|
||||||
throw ApiException(response.statusCode, _decodeBodyBytes(response));
|
throw ApiException(response.statusCode, _decodeBodyBytes(response));
|
||||||
}
|
}
|
||||||
@ -707,16 +707,16 @@ class DeviceApi {
|
|||||||
///
|
///
|
||||||
/// Parameters:
|
/// Parameters:
|
||||||
///
|
///
|
||||||
/// * [String] userId (required):
|
/// * [String] homeId (required):
|
||||||
/// User Id
|
/// Home Id
|
||||||
Future<Response> deviceGetDevicesFromZigbee2MqttWithHttpInfo(String userId) async {
|
Future<Response> deviceGetDevicesFromZigbee2MqttWithHttpInfo(String homeId) async {
|
||||||
// Verify required params are set.
|
// Verify required params are set.
|
||||||
if (userId == null) {
|
if (homeId == null) {
|
||||||
throw ApiException(HttpStatus.badRequest, 'Missing required param: userId');
|
throw ApiException(HttpStatus.badRequest, 'Missing required param: homeId');
|
||||||
}
|
}
|
||||||
|
|
||||||
final path = r'/api/device/zigbee2Mqtt/{userId}'
|
final path = r'/api/device/zigbee2Mqtt/{homeId}'
|
||||||
.replaceAll('{' + 'userId' + '}', userId.toString());
|
.replaceAll('{' + 'homeId' + '}', homeId.toString());
|
||||||
|
|
||||||
Object postBody;
|
Object postBody;
|
||||||
|
|
||||||
@ -756,10 +756,10 @@ class DeviceApi {
|
|||||||
///
|
///
|
||||||
/// Parameters:
|
/// Parameters:
|
||||||
///
|
///
|
||||||
/// * [String] userId (required):
|
/// * [String] homeId (required):
|
||||||
/// User Id
|
/// Home Id
|
||||||
Future<List<DeviceDetailDTO>> deviceGetDevicesFromZigbee2Mqtt(String userId) async {
|
Future<List<DeviceDetailDTO>> deviceGetDevicesFromZigbee2Mqtt(String homeId) async {
|
||||||
final response = await deviceGetDevicesFromZigbee2MqttWithHttpInfo(userId);
|
final response = await deviceGetDevicesFromZigbee2MqttWithHttpInfo(homeId);
|
||||||
if (response.statusCode >= HttpStatus.badRequest) {
|
if (response.statusCode >= HttpStatus.badRequest) {
|
||||||
throw ApiException(response.statusCode, _decodeBodyBytes(response));
|
throw ApiException(response.statusCode, _decodeBodyBytes(response));
|
||||||
}
|
}
|
||||||
|
|||||||
@ -21,10 +21,10 @@ class EnergyApi {
|
|||||||
///
|
///
|
||||||
/// Parameters:
|
/// Parameters:
|
||||||
///
|
///
|
||||||
/// * [String] userId:
|
/// * [String] homeId:
|
||||||
///
|
///
|
||||||
/// * [ViewBy] viewBy:
|
/// * [ViewBy] viewBy:
|
||||||
Future<Response> energyGetElectricityProductionWithHttpInfo({ String userId, ViewBy viewBy }) async {
|
Future<Response> energyGetElectricityProductionWithHttpInfo({ String homeId, ViewBy viewBy }) async {
|
||||||
// Verify required params are set.
|
// Verify required params are set.
|
||||||
|
|
||||||
final path = r'/api/energy/electricity';
|
final path = r'/api/energy/electricity';
|
||||||
@ -35,8 +35,8 @@ class EnergyApi {
|
|||||||
final headerParams = <String, String>{};
|
final headerParams = <String, String>{};
|
||||||
final formParams = <String, String>{};
|
final formParams = <String, String>{};
|
||||||
|
|
||||||
if (userId != null) {
|
if (homeId != null) {
|
||||||
queryParams.addAll(_convertParametersForCollectionFormat('', 'userId', userId));
|
queryParams.addAll(_convertParametersForCollectionFormat('', 'homeId', homeId));
|
||||||
}
|
}
|
||||||
if (viewBy != null) {
|
if (viewBy != null) {
|
||||||
queryParams.addAll(_convertParametersForCollectionFormat('', 'viewBy', viewBy));
|
queryParams.addAll(_convertParametersForCollectionFormat('', 'viewBy', viewBy));
|
||||||
@ -74,11 +74,11 @@ class EnergyApi {
|
|||||||
///
|
///
|
||||||
/// Parameters:
|
/// Parameters:
|
||||||
///
|
///
|
||||||
/// * [String] userId:
|
/// * [String] homeId:
|
||||||
///
|
///
|
||||||
/// * [ViewBy] viewBy:
|
/// * [ViewBy] viewBy:
|
||||||
Future<List<ElectricityProduction>> energyGetElectricityProduction({ String userId, ViewBy viewBy }) async {
|
Future<List<ElectricityProduction>> energyGetElectricityProduction({ String homeId, ViewBy viewBy }) async {
|
||||||
final response = await energyGetElectricityProductionWithHttpInfo( userId: userId, viewBy: viewBy );
|
final response = await energyGetElectricityProductionWithHttpInfo( homeId: homeId, viewBy: viewBy );
|
||||||
if (response.statusCode >= HttpStatus.badRequest) {
|
if (response.statusCode >= HttpStatus.badRequest) {
|
||||||
throw ApiException(response.statusCode, _decodeBodyBytes(response));
|
throw ApiException(response.statusCode, _decodeBodyBytes(response));
|
||||||
}
|
}
|
||||||
|
|||||||
360
mycore_api/lib/api/event_api.dart
Normal file
360
mycore_api/lib/api/event_api.dart
Normal file
@ -0,0 +1,360 @@
|
|||||||
|
//
|
||||||
|
// 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 EventApi {
|
||||||
|
EventApi([ApiClient apiClient]) : apiClient = apiClient ?? defaultApiClient;
|
||||||
|
|
||||||
|
final ApiClient apiClient;
|
||||||
|
|
||||||
|
/// Delete an event
|
||||||
|
///
|
||||||
|
/// Note: This method returns the HTTP [Response].
|
||||||
|
///
|
||||||
|
/// Parameters:
|
||||||
|
///
|
||||||
|
/// * [String] eventId (required):
|
||||||
|
/// Id of event to delete
|
||||||
|
Future<Response> eventDeleteWithHttpInfo(String eventId) async {
|
||||||
|
// Verify required params are set.
|
||||||
|
if (eventId == null) {
|
||||||
|
throw ApiException(HttpStatus.badRequest, 'Missing required param: eventId');
|
||||||
|
}
|
||||||
|
|
||||||
|
final path = r'/api/event/{eventId}'
|
||||||
|
.replaceAll('{' + 'eventId' + '}', eventId.toString());
|
||||||
|
|
||||||
|
Object postBody;
|
||||||
|
|
||||||
|
final queryParams = <QueryParam>[];
|
||||||
|
final headerParams = <String, String>{};
|
||||||
|
final formParams = <String, String>{};
|
||||||
|
|
||||||
|
final contentTypes = <String>[];
|
||||||
|
final nullableContentType = contentTypes.isNotEmpty ? contentTypes[0] : null;
|
||||||
|
final authNames = <String>['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 event
|
||||||
|
///
|
||||||
|
/// Parameters:
|
||||||
|
///
|
||||||
|
/// * [String] eventId (required):
|
||||||
|
/// Id of event to delete
|
||||||
|
Future<String> eventDelete(String eventId) async {
|
||||||
|
final response = await eventDeleteWithHttpInfo(eventId);
|
||||||
|
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<String>.value(null);
|
||||||
|
}
|
||||||
|
|
||||||
|
/// Delete all events for a specified home
|
||||||
|
///
|
||||||
|
/// Note: This method returns the HTTP [Response].
|
||||||
|
///
|
||||||
|
/// Parameters:
|
||||||
|
///
|
||||||
|
/// * [String] homeId (required):
|
||||||
|
/// Home Id
|
||||||
|
Future<Response> eventDeleteAllForHomeWithHttpInfo(String homeId) async {
|
||||||
|
// Verify required params are set.
|
||||||
|
if (homeId == null) {
|
||||||
|
throw ApiException(HttpStatus.badRequest, 'Missing required param: homeId');
|
||||||
|
}
|
||||||
|
|
||||||
|
final path = r'/api/event/home/{homeId}'
|
||||||
|
.replaceAll('{' + 'homeId' + '}', homeId.toString());
|
||||||
|
|
||||||
|
Object postBody;
|
||||||
|
|
||||||
|
final queryParams = <QueryParam>[];
|
||||||
|
final headerParams = <String, String>{};
|
||||||
|
final formParams = <String, String>{};
|
||||||
|
|
||||||
|
final contentTypes = <String>[];
|
||||||
|
final nullableContentType = contentTypes.isNotEmpty ? contentTypes[0] : null;
|
||||||
|
final authNames = <String>['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 events for a specified home
|
||||||
|
///
|
||||||
|
/// Parameters:
|
||||||
|
///
|
||||||
|
/// * [String] homeId (required):
|
||||||
|
/// Home Id
|
||||||
|
Future<String> eventDeleteAllForHome(String homeId) async {
|
||||||
|
final response = await eventDeleteAllForHomeWithHttpInfo(homeId);
|
||||||
|
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<String>.value(null);
|
||||||
|
}
|
||||||
|
|
||||||
|
/// Get events for the specified home
|
||||||
|
///
|
||||||
|
/// Note: This method returns the HTTP [Response].
|
||||||
|
///
|
||||||
|
/// Parameters:
|
||||||
|
///
|
||||||
|
/// * [String] homeId (required):
|
||||||
|
/// Home Id
|
||||||
|
///
|
||||||
|
/// * [String] deviceId:
|
||||||
|
///
|
||||||
|
/// * [String] roomId:
|
||||||
|
///
|
||||||
|
/// * [int] startIndex:
|
||||||
|
///
|
||||||
|
/// * [int] count:
|
||||||
|
///
|
||||||
|
/// * [DateTime] dateStart:
|
||||||
|
///
|
||||||
|
/// * [DateTime] dateEnd:
|
||||||
|
///
|
||||||
|
/// * [OneOfEventType] eventType:
|
||||||
|
///
|
||||||
|
/// * [OneOfDeviceType] deviceType:
|
||||||
|
Future<Response> eventGetWithHttpInfo(String homeId, { String deviceId, String roomId, int startIndex, int count, DateTime dateStart, DateTime dateEnd, EventType eventType, DeviceType deviceType }) async {
|
||||||
|
// Verify required params are set.
|
||||||
|
if (homeId == null) {
|
||||||
|
throw ApiException(HttpStatus.badRequest, 'Missing required param: homeId');
|
||||||
|
}
|
||||||
|
|
||||||
|
final path = r'/api/event/{homeId}'
|
||||||
|
.replaceAll('{' + 'homeId' + '}', homeId.toString());
|
||||||
|
|
||||||
|
Object postBody;
|
||||||
|
|
||||||
|
final queryParams = <QueryParam>[];
|
||||||
|
final headerParams = <String, String>{};
|
||||||
|
final formParams = <String, String>{};
|
||||||
|
|
||||||
|
if (deviceId != null) {
|
||||||
|
queryParams.addAll(_convertParametersForCollectionFormat('', 'DeviceId', deviceId));
|
||||||
|
}
|
||||||
|
if (roomId != null) {
|
||||||
|
queryParams.addAll(_convertParametersForCollectionFormat('', 'RoomId', roomId));
|
||||||
|
}
|
||||||
|
if (startIndex != null) {
|
||||||
|
queryParams.addAll(_convertParametersForCollectionFormat('', 'StartIndex', startIndex));
|
||||||
|
}
|
||||||
|
if (count != null) {
|
||||||
|
queryParams.addAll(_convertParametersForCollectionFormat('', 'Count', count));
|
||||||
|
}
|
||||||
|
if (dateStart != null) {
|
||||||
|
queryParams.addAll(_convertParametersForCollectionFormat('', 'DateStart', dateStart));
|
||||||
|
}
|
||||||
|
if (dateEnd != null) {
|
||||||
|
queryParams.addAll(_convertParametersForCollectionFormat('', 'DateEnd', dateEnd));
|
||||||
|
}
|
||||||
|
if (eventType != null) {
|
||||||
|
queryParams.addAll(_convertParametersForCollectionFormat('', 'EventType', eventType));
|
||||||
|
}
|
||||||
|
if (deviceType != null) {
|
||||||
|
queryParams.addAll(_convertParametersForCollectionFormat('', 'DeviceType', deviceType));
|
||||||
|
}
|
||||||
|
|
||||||
|
final contentTypes = <String>[];
|
||||||
|
final nullableContentType = contentTypes.isNotEmpty ? contentTypes[0] : null;
|
||||||
|
final authNames = <String>['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 events for the specified home
|
||||||
|
///
|
||||||
|
/// Parameters:
|
||||||
|
///
|
||||||
|
/// * [String] homeId (required):
|
||||||
|
/// Home Id
|
||||||
|
///
|
||||||
|
/// * [String] deviceId:
|
||||||
|
///
|
||||||
|
/// * [String] roomId:
|
||||||
|
///
|
||||||
|
/// * [int] startIndex:
|
||||||
|
///
|
||||||
|
/// * [int] count:
|
||||||
|
///
|
||||||
|
/// * [DateTime] dateStart:
|
||||||
|
///
|
||||||
|
/// * [DateTime] dateEnd:
|
||||||
|
///
|
||||||
|
/// * [OneOfEventType] eventType:
|
||||||
|
///
|
||||||
|
/// * [OneOfDeviceType] deviceType:
|
||||||
|
Future<List<EventDetailDTO>> eventGet(String homeId, { String deviceId, String roomId, int startIndex, int count, DateTime dateStart, DateTime dateEnd, EventType eventType, DeviceType deviceType }) async {
|
||||||
|
final response = await eventGetWithHttpInfo(homeId, deviceId: deviceId, roomId: roomId, startIndex: startIndex, count: count, dateStart: dateStart, dateEnd: dateEnd, eventType: eventType, deviceType: deviceType );
|
||||||
|
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<EventDetailDTO>') as List)
|
||||||
|
.cast<EventDetailDTO>()
|
||||||
|
.toList(growable: false);
|
||||||
|
}
|
||||||
|
return Future<List<EventDetailDTO>>.value(null);
|
||||||
|
}
|
||||||
|
|
||||||
|
/// Get detail info of a specified event
|
||||||
|
///
|
||||||
|
/// Note: This method returns the HTTP [Response].
|
||||||
|
///
|
||||||
|
/// Parameters:
|
||||||
|
///
|
||||||
|
/// * [String] eventId (required):
|
||||||
|
/// event id
|
||||||
|
Future<Response> eventGetDetailWithHttpInfo(String eventId) async {
|
||||||
|
// Verify required params are set.
|
||||||
|
if (eventId == null) {
|
||||||
|
throw ApiException(HttpStatus.badRequest, 'Missing required param: eventId');
|
||||||
|
}
|
||||||
|
|
||||||
|
final path = r'/api/event/detail/{eventId}'
|
||||||
|
.replaceAll('{' + 'eventId' + '}', eventId.toString());
|
||||||
|
|
||||||
|
Object postBody;
|
||||||
|
|
||||||
|
final queryParams = <QueryParam>[];
|
||||||
|
final headerParams = <String, String>{};
|
||||||
|
final formParams = <String, String>{};
|
||||||
|
|
||||||
|
final contentTypes = <String>[];
|
||||||
|
final nullableContentType = contentTypes.isNotEmpty ? contentTypes[0] : null;
|
||||||
|
final authNames = <String>['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 event
|
||||||
|
///
|
||||||
|
/// Parameters:
|
||||||
|
///
|
||||||
|
/// * [String] eventId (required):
|
||||||
|
/// event id
|
||||||
|
Future<EventDetailDTO> eventGetDetail(String eventId) async {
|
||||||
|
final response = await eventGetDetailWithHttpInfo(eventId);
|
||||||
|
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), 'EventDetailDTO') as EventDetailDTO;
|
||||||
|
}
|
||||||
|
return Future<EventDetailDTO>.value(null);
|
||||||
|
}
|
||||||
|
}
|
||||||
@ -91,16 +91,16 @@ class GroupApi {
|
|||||||
///
|
///
|
||||||
/// Parameters:
|
/// Parameters:
|
||||||
///
|
///
|
||||||
/// * [String] userId (required):
|
/// * [String] homeId (required):
|
||||||
/// User Id
|
/// Home Id
|
||||||
Future<Response> groupCreateDevicesFromZigbee2MqttWithHttpInfo(String userId) async {
|
Future<Response> groupCreateDevicesFromZigbee2MqttWithHttpInfo(String homeId) async {
|
||||||
// Verify required params are set.
|
// Verify required params are set.
|
||||||
if (userId == null) {
|
if (homeId == null) {
|
||||||
throw ApiException(HttpStatus.badRequest, 'Missing required param: userId');
|
throw ApiException(HttpStatus.badRequest, 'Missing required param: homeId');
|
||||||
}
|
}
|
||||||
|
|
||||||
final path = r'/api/group/{userId}/fromZigbee'
|
final path = r'/api/group/{homeId}/fromZigbee'
|
||||||
.replaceAll('{' + 'userId' + '}', userId.toString());
|
.replaceAll('{' + 'homeId' + '}', homeId.toString());
|
||||||
|
|
||||||
Object postBody;
|
Object postBody;
|
||||||
|
|
||||||
@ -140,10 +140,10 @@ class GroupApi {
|
|||||||
///
|
///
|
||||||
/// Parameters:
|
/// Parameters:
|
||||||
///
|
///
|
||||||
/// * [String] userId (required):
|
/// * [String] homeId (required):
|
||||||
/// User Id
|
/// Home Id
|
||||||
Future<List<GroupDetailDTO>> groupCreateDevicesFromZigbee2Mqtt(String userId) async {
|
Future<List<GroupDetailDTO>> groupCreateDevicesFromZigbee2Mqtt(String homeId) async {
|
||||||
final response = await groupCreateDevicesFromZigbee2MqttWithHttpInfo(userId);
|
final response = await groupCreateDevicesFromZigbee2MqttWithHttpInfo(homeId);
|
||||||
if (response.statusCode >= HttpStatus.badRequest) {
|
if (response.statusCode >= HttpStatus.badRequest) {
|
||||||
throw ApiException(response.statusCode, _decodeBodyBytes(response));
|
throw ApiException(response.statusCode, _decodeBodyBytes(response));
|
||||||
}
|
}
|
||||||
@ -310,22 +310,22 @@ class GroupApi {
|
|||||||
return Future<String>.value(null);
|
return Future<String>.value(null);
|
||||||
}
|
}
|
||||||
|
|
||||||
/// Delete all group for a specified
|
/// Delete all group for a specified home
|
||||||
///
|
///
|
||||||
/// Note: This method returns the HTTP [Response].
|
/// Note: This method returns the HTTP [Response].
|
||||||
///
|
///
|
||||||
/// Parameters:
|
/// Parameters:
|
||||||
///
|
///
|
||||||
/// * [String] userId (required):
|
/// * [String] homeId (required):
|
||||||
/// Id of user
|
/// Home Id
|
||||||
Future<Response> groupDeleteAllForUserWithHttpInfo(String userId) async {
|
Future<Response> groupDeleteAllForHomeWithHttpInfo(String homeId) async {
|
||||||
// Verify required params are set.
|
// Verify required params are set.
|
||||||
if (userId == null) {
|
if (homeId == null) {
|
||||||
throw ApiException(HttpStatus.badRequest, 'Missing required param: userId');
|
throw ApiException(HttpStatus.badRequest, 'Missing required param: homeId');
|
||||||
}
|
}
|
||||||
|
|
||||||
final path = r'/api/group/user/{userId}'
|
final path = r'/api/group/home/{homeId}'
|
||||||
.replaceAll('{' + 'userId' + '}', userId.toString());
|
.replaceAll('{' + 'homeId' + '}', homeId.toString());
|
||||||
|
|
||||||
Object postBody;
|
Object postBody;
|
||||||
|
|
||||||
@ -361,14 +361,14 @@ class GroupApi {
|
|||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
/// Delete all group for a specified
|
/// Delete all group for a specified home
|
||||||
///
|
///
|
||||||
/// Parameters:
|
/// Parameters:
|
||||||
///
|
///
|
||||||
/// * [String] userId (required):
|
/// * [String] homeId (required):
|
||||||
/// Id of user
|
/// Home Id
|
||||||
Future<String> groupDeleteAllForUser(String userId) async {
|
Future<String> groupDeleteAllForHome(String homeId) async {
|
||||||
final response = await groupDeleteAllForUserWithHttpInfo(userId);
|
final response = await groupDeleteAllForHomeWithHttpInfo(homeId);
|
||||||
if (response.statusCode >= HttpStatus.badRequest) {
|
if (response.statusCode >= HttpStatus.badRequest) {
|
||||||
throw ApiException(response.statusCode, _decodeBodyBytes(response));
|
throw ApiException(response.statusCode, _decodeBodyBytes(response));
|
||||||
}
|
}
|
||||||
@ -381,22 +381,22 @@ class GroupApi {
|
|||||||
return Future<String>.value(null);
|
return Future<String>.value(null);
|
||||||
}
|
}
|
||||||
|
|
||||||
/// Get all groups for the specified user
|
/// Get all groups for the specified home
|
||||||
///
|
///
|
||||||
/// Note: This method returns the HTTP [Response].
|
/// Note: This method returns the HTTP [Response].
|
||||||
///
|
///
|
||||||
/// Parameters:
|
/// Parameters:
|
||||||
///
|
///
|
||||||
/// * [String] userId (required):
|
/// * [String] homeId (required):
|
||||||
/// Id of user
|
/// Home Id
|
||||||
Future<Response> groupGetAllWithHttpInfo(String userId) async {
|
Future<Response> groupGetAllWithHttpInfo(String homeId) async {
|
||||||
// Verify required params are set.
|
// Verify required params are set.
|
||||||
if (userId == null) {
|
if (homeId == null) {
|
||||||
throw ApiException(HttpStatus.badRequest, 'Missing required param: userId');
|
throw ApiException(HttpStatus.badRequest, 'Missing required param: homeId');
|
||||||
}
|
}
|
||||||
|
|
||||||
final path = r'/api/group/{userId}'
|
final path = r'/api/group/{homeId}'
|
||||||
.replaceAll('{' + 'userId' + '}', userId.toString());
|
.replaceAll('{' + 'homeId' + '}', homeId.toString());
|
||||||
|
|
||||||
Object postBody;
|
Object postBody;
|
||||||
|
|
||||||
@ -432,14 +432,14 @@ class GroupApi {
|
|||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
/// Get all groups for the specified user
|
/// Get all groups for the specified home
|
||||||
///
|
///
|
||||||
/// Parameters:
|
/// Parameters:
|
||||||
///
|
///
|
||||||
/// * [String] userId (required):
|
/// * [String] homeId (required):
|
||||||
/// Id of user
|
/// Home Id
|
||||||
Future<List<GroupSummaryDTO>> groupGetAll(String userId) async {
|
Future<List<GroupSummaryDTO>> groupGetAll(String homeId) async {
|
||||||
final response = await groupGetAllWithHttpInfo(userId);
|
final response = await groupGetAllWithHttpInfo(homeId);
|
||||||
if (response.statusCode >= HttpStatus.badRequest) {
|
if (response.statusCode >= HttpStatus.badRequest) {
|
||||||
throw ApiException(response.statusCode, _decodeBodyBytes(response));
|
throw ApiException(response.statusCode, _decodeBodyBytes(response));
|
||||||
}
|
}
|
||||||
@ -531,22 +531,22 @@ class GroupApi {
|
|||||||
///
|
///
|
||||||
/// Parameters:
|
/// Parameters:
|
||||||
///
|
///
|
||||||
/// * [String] userId (required):
|
/// * [String] homeId (required):
|
||||||
/// user Id
|
/// home Id
|
||||||
///
|
///
|
||||||
/// * [String] type (required):
|
/// * [String] type (required):
|
||||||
/// group type
|
/// group type
|
||||||
Future<Response> groupGetGroupsByTypeWithHttpInfo(String userId, String type) async {
|
Future<Response> groupGetGroupsByTypeWithHttpInfo(String homeId, String type) async {
|
||||||
// Verify required params are set.
|
// Verify required params are set.
|
||||||
if (userId == null) {
|
if (homeId == null) {
|
||||||
throw ApiException(HttpStatus.badRequest, 'Missing required param: userId');
|
throw ApiException(HttpStatus.badRequest, 'Missing required param: homeId');
|
||||||
}
|
}
|
||||||
if (type == null) {
|
if (type == null) {
|
||||||
throw ApiException(HttpStatus.badRequest, 'Missing required param: type');
|
throw ApiException(HttpStatus.badRequest, 'Missing required param: type');
|
||||||
}
|
}
|
||||||
|
|
||||||
final path = r'/api/group/{userId}/type/{type}'
|
final path = r'/api/group/{homeId}/type/{type}'
|
||||||
.replaceAll('{' + 'userId' + '}', userId.toString())
|
.replaceAll('{' + 'homeId' + '}', homeId.toString())
|
||||||
.replaceAll('{' + 'type' + '}', type.toString());
|
.replaceAll('{' + 'type' + '}', type.toString());
|
||||||
|
|
||||||
Object postBody;
|
Object postBody;
|
||||||
@ -587,13 +587,13 @@ class GroupApi {
|
|||||||
///
|
///
|
||||||
/// Parameters:
|
/// Parameters:
|
||||||
///
|
///
|
||||||
/// * [String] userId (required):
|
/// * [String] homeId (required):
|
||||||
/// user Id
|
/// home Id
|
||||||
///
|
///
|
||||||
/// * [String] type (required):
|
/// * [String] type (required):
|
||||||
/// group type
|
/// group type
|
||||||
Future<List<GroupSummaryDTO>> groupGetGroupsByType(String userId, String type) async {
|
Future<List<GroupSummaryDTO>> groupGetGroupsByType(String homeId, String type) async {
|
||||||
final response = await groupGetGroupsByTypeWithHttpInfo(userId, type);
|
final response = await groupGetGroupsByTypeWithHttpInfo(homeId, type);
|
||||||
if (response.statusCode >= HttpStatus.badRequest) {
|
if (response.statusCode >= HttpStatus.badRequest) {
|
||||||
throw ApiException(response.statusCode, _decodeBodyBytes(response));
|
throw ApiException(response.statusCode, _decodeBodyBytes(response));
|
||||||
}
|
}
|
||||||
@ -614,16 +614,16 @@ class GroupApi {
|
|||||||
///
|
///
|
||||||
/// Parameters:
|
/// Parameters:
|
||||||
///
|
///
|
||||||
/// * [String] userId (required):
|
/// * [String] homeId (required):
|
||||||
/// User Id
|
/// Home Id
|
||||||
Future<Response> groupGetGroupsFromZigbee2MqttWithHttpInfo(String userId) async {
|
Future<Response> groupGetGroupsFromZigbee2MqttWithHttpInfo(String homeId) async {
|
||||||
// Verify required params are set.
|
// Verify required params are set.
|
||||||
if (userId == null) {
|
if (homeId == null) {
|
||||||
throw ApiException(HttpStatus.badRequest, 'Missing required param: userId');
|
throw ApiException(HttpStatus.badRequest, 'Missing required param: homeId');
|
||||||
}
|
}
|
||||||
|
|
||||||
final path = r'/api/group/zigbee2Mqtt/{userId}'
|
final path = r'/api/group/zigbee2Mqtt/{homeId}'
|
||||||
.replaceAll('{' + 'userId' + '}', userId.toString());
|
.replaceAll('{' + 'homeId' + '}', homeId.toString());
|
||||||
|
|
||||||
Object postBody;
|
Object postBody;
|
||||||
|
|
||||||
@ -663,10 +663,10 @@ class GroupApi {
|
|||||||
///
|
///
|
||||||
/// Parameters:
|
/// Parameters:
|
||||||
///
|
///
|
||||||
/// * [String] userId (required):
|
/// * [String] homeId (required):
|
||||||
/// User Id
|
/// Home Id
|
||||||
Future<List<GroupDetailDTO>> groupGetGroupsFromZigbee2Mqtt(String userId) async {
|
Future<List<GroupDetailDTO>> groupGetGroupsFromZigbee2Mqtt(String homeId) async {
|
||||||
final response = await groupGetGroupsFromZigbee2MqttWithHttpInfo(userId);
|
final response = await groupGetGroupsFromZigbee2MqttWithHttpInfo(homeId);
|
||||||
if (response.statusCode >= HttpStatus.badRequest) {
|
if (response.statusCode >= HttpStatus.badRequest) {
|
||||||
throw ApiException(response.statusCode, _decodeBodyBytes(response));
|
throw ApiException(response.statusCode, _decodeBodyBytes(response));
|
||||||
}
|
}
|
||||||
|
|||||||
372
mycore_api/lib/api/home_api.dart
Normal file
372
mycore_api/lib/api/home_api.dart
Normal file
@ -0,0 +1,372 @@
|
|||||||
|
//
|
||||||
|
// 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 HomeApi {
|
||||||
|
HomeApi([ApiClient apiClient]) : apiClient = apiClient ?? defaultApiClient;
|
||||||
|
|
||||||
|
final ApiClient apiClient;
|
||||||
|
|
||||||
|
/// Create a home
|
||||||
|
///
|
||||||
|
/// Note: This method returns the HTTP [Response].
|
||||||
|
///
|
||||||
|
/// Parameters:
|
||||||
|
///
|
||||||
|
/// * [CreateOrUpdateHomeDTO] createOrUpdateHomeDTO (required):
|
||||||
|
/// Home to create
|
||||||
|
Future<Response> homeCreateWithHttpInfo(CreateOrUpdateHomeDTO createOrUpdateHomeDTO) async {
|
||||||
|
// Verify required params are set.
|
||||||
|
if (createOrUpdateHomeDTO == null) {
|
||||||
|
throw ApiException(HttpStatus.badRequest, 'Missing required param: createOrUpdateHomeDTO');
|
||||||
|
}
|
||||||
|
|
||||||
|
final path = r'/api/home';
|
||||||
|
|
||||||
|
Object postBody = createOrUpdateHomeDTO;
|
||||||
|
|
||||||
|
final queryParams = <QueryParam>[];
|
||||||
|
final headerParams = <String, String>{};
|
||||||
|
final formParams = <String, String>{};
|
||||||
|
|
||||||
|
final contentTypes = <String>['application/json'];
|
||||||
|
final nullableContentType = contentTypes.isNotEmpty ? contentTypes[0] : null;
|
||||||
|
final authNames = <String>['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 home
|
||||||
|
///
|
||||||
|
/// Parameters:
|
||||||
|
///
|
||||||
|
/// * [CreateOrUpdateHomeDTO] createOrUpdateHomeDTO (required):
|
||||||
|
/// Home to create
|
||||||
|
Future<HomeDTO> homeCreate(CreateOrUpdateHomeDTO createOrUpdateHomeDTO) async {
|
||||||
|
final response = await homeCreateWithHttpInfo(createOrUpdateHomeDTO);
|
||||||
|
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), 'HomeDTO') as HomeDTO;
|
||||||
|
}
|
||||||
|
return Future<HomeDTO>.value(null);
|
||||||
|
}
|
||||||
|
|
||||||
|
/// Delete a home
|
||||||
|
///
|
||||||
|
/// Note: This method returns the HTTP [Response].
|
||||||
|
///
|
||||||
|
/// Parameters:
|
||||||
|
///
|
||||||
|
/// * [String] homeId (required):
|
||||||
|
/// Id of home to delete
|
||||||
|
Future<Response> homeDeleteWithHttpInfo(String homeId) async {
|
||||||
|
// Verify required params are set.
|
||||||
|
if (homeId == null) {
|
||||||
|
throw ApiException(HttpStatus.badRequest, 'Missing required param: homeId');
|
||||||
|
}
|
||||||
|
|
||||||
|
final path = r'/api/home/{homeId}'
|
||||||
|
.replaceAll('{' + 'homeId' + '}', homeId.toString());
|
||||||
|
|
||||||
|
Object postBody;
|
||||||
|
|
||||||
|
final queryParams = <QueryParam>[];
|
||||||
|
final headerParams = <String, String>{};
|
||||||
|
final formParams = <String, String>{};
|
||||||
|
|
||||||
|
final contentTypes = <String>[];
|
||||||
|
final nullableContentType = contentTypes.isNotEmpty ? contentTypes[0] : null;
|
||||||
|
final authNames = <String>['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 home
|
||||||
|
///
|
||||||
|
/// Parameters:
|
||||||
|
///
|
||||||
|
/// * [String] homeId (required):
|
||||||
|
/// Id of home to delete
|
||||||
|
Future<String> homeDelete(String homeId) async {
|
||||||
|
final response = await homeDeleteWithHttpInfo(homeId);
|
||||||
|
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<String>.value(null);
|
||||||
|
}
|
||||||
|
|
||||||
|
/// Get all home for specified user
|
||||||
|
///
|
||||||
|
/// Note: This method returns the HTTP [Response].
|
||||||
|
///
|
||||||
|
/// Parameters:
|
||||||
|
///
|
||||||
|
/// * [String] userId (required):
|
||||||
|
/// User Id
|
||||||
|
Future<Response> homeGetAllWithHttpInfo(String userId) async {
|
||||||
|
// Verify required params are set.
|
||||||
|
if (userId == null) {
|
||||||
|
throw ApiException(HttpStatus.badRequest, 'Missing required param: userId');
|
||||||
|
}
|
||||||
|
|
||||||
|
final path = r'/api/home/{userId}'
|
||||||
|
.replaceAll('{' + 'userId' + '}', userId.toString());
|
||||||
|
|
||||||
|
Object postBody;
|
||||||
|
|
||||||
|
final queryParams = <QueryParam>[];
|
||||||
|
final headerParams = <String, String>{};
|
||||||
|
final formParams = <String, String>{};
|
||||||
|
|
||||||
|
final contentTypes = <String>[];
|
||||||
|
final nullableContentType = contentTypes.isNotEmpty ? contentTypes[0] : null;
|
||||||
|
final authNames = <String>['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 home for specified user
|
||||||
|
///
|
||||||
|
/// Parameters:
|
||||||
|
///
|
||||||
|
/// * [String] userId (required):
|
||||||
|
/// User Id
|
||||||
|
Future<List<HomeDTO>> homeGetAll(String userId) async {
|
||||||
|
final response = await homeGetAllWithHttpInfo(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<HomeDTO>') as List)
|
||||||
|
.cast<HomeDTO>()
|
||||||
|
.toList(growable: false);
|
||||||
|
}
|
||||||
|
return Future<List<HomeDTO>>.value(null);
|
||||||
|
}
|
||||||
|
|
||||||
|
/// Get detail info of a specified home
|
||||||
|
///
|
||||||
|
/// Note: This method returns the HTTP [Response].
|
||||||
|
///
|
||||||
|
/// Parameters:
|
||||||
|
///
|
||||||
|
/// * [String] homeId (required):
|
||||||
|
/// home id
|
||||||
|
Future<Response> homeGetDetailWithHttpInfo(String homeId) async {
|
||||||
|
// Verify required params are set.
|
||||||
|
if (homeId == null) {
|
||||||
|
throw ApiException(HttpStatus.badRequest, 'Missing required param: homeId');
|
||||||
|
}
|
||||||
|
|
||||||
|
final path = r'/api/home/detail/{homeId}'
|
||||||
|
.replaceAll('{' + 'homeId' + '}', homeId.toString());
|
||||||
|
|
||||||
|
Object postBody;
|
||||||
|
|
||||||
|
final queryParams = <QueryParam>[];
|
||||||
|
final headerParams = <String, String>{};
|
||||||
|
final formParams = <String, String>{};
|
||||||
|
|
||||||
|
final contentTypes = <String>[];
|
||||||
|
final nullableContentType = contentTypes.isNotEmpty ? contentTypes[0] : null;
|
||||||
|
final authNames = <String>['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 home
|
||||||
|
///
|
||||||
|
/// Parameters:
|
||||||
|
///
|
||||||
|
/// * [String] homeId (required):
|
||||||
|
/// home id
|
||||||
|
Future<HomeDetailDTO> homeGetDetail(String homeId) async {
|
||||||
|
final response = await homeGetDetailWithHttpInfo(homeId);
|
||||||
|
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), 'HomeDetailDTO') as HomeDetailDTO;
|
||||||
|
}
|
||||||
|
return Future<HomeDetailDTO>.value(null);
|
||||||
|
}
|
||||||
|
|
||||||
|
/// Update a home
|
||||||
|
///
|
||||||
|
/// Note: This method returns the HTTP [Response].
|
||||||
|
///
|
||||||
|
/// Parameters:
|
||||||
|
///
|
||||||
|
/// * [CreateOrUpdateHomeDTO] createOrUpdateHomeDTO (required):
|
||||||
|
/// Home to update
|
||||||
|
Future<Response> homeUpdateWithHttpInfo(CreateOrUpdateHomeDTO createOrUpdateHomeDTO) async {
|
||||||
|
// Verify required params are set.
|
||||||
|
if (createOrUpdateHomeDTO == null) {
|
||||||
|
throw ApiException(HttpStatus.badRequest, 'Missing required param: createOrUpdateHomeDTO');
|
||||||
|
}
|
||||||
|
|
||||||
|
final path = r'/api/home';
|
||||||
|
|
||||||
|
Object postBody = createOrUpdateHomeDTO;
|
||||||
|
|
||||||
|
final queryParams = <QueryParam>[];
|
||||||
|
final headerParams = <String, String>{};
|
||||||
|
final formParams = <String, String>{};
|
||||||
|
|
||||||
|
final contentTypes = <String>['application/json'];
|
||||||
|
final nullableContentType = contentTypes.isNotEmpty ? contentTypes[0] : null;
|
||||||
|
final authNames = <String>['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 home
|
||||||
|
///
|
||||||
|
/// Parameters:
|
||||||
|
///
|
||||||
|
/// * [CreateOrUpdateHomeDTO] createOrUpdateHomeDTO (required):
|
||||||
|
/// Home to update
|
||||||
|
Future<HomeDTO> homeUpdate(CreateOrUpdateHomeDTO createOrUpdateHomeDTO) async {
|
||||||
|
final response = await homeUpdateWithHttpInfo(createOrUpdateHomeDTO);
|
||||||
|
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), 'HomeDTO') as HomeDTO;
|
||||||
|
}
|
||||||
|
return Future<HomeDTO>.value(null);
|
||||||
|
}
|
||||||
|
}
|
||||||
@ -156,22 +156,22 @@ class ProviderApi {
|
|||||||
return Future<String>.value(null);
|
return Future<String>.value(null);
|
||||||
}
|
}
|
||||||
|
|
||||||
/// Get all user providers
|
/// Get all home providers
|
||||||
///
|
///
|
||||||
/// Note: This method returns the HTTP [Response].
|
/// Note: This method returns the HTTP [Response].
|
||||||
///
|
///
|
||||||
/// Parameters:
|
/// Parameters:
|
||||||
///
|
///
|
||||||
/// * [String] userId (required):
|
/// * [String] homeId (required):
|
||||||
/// Id of user
|
/// Home Id
|
||||||
Future<Response> providerGetAllWithHttpInfo(String userId) async {
|
Future<Response> providerGetAllWithHttpInfo(String homeId) async {
|
||||||
// Verify required params are set.
|
// Verify required params are set.
|
||||||
if (userId == null) {
|
if (homeId == null) {
|
||||||
throw ApiException(HttpStatus.badRequest, 'Missing required param: userId');
|
throw ApiException(HttpStatus.badRequest, 'Missing required param: homeId');
|
||||||
}
|
}
|
||||||
|
|
||||||
final path = r'/api/provider/{userId}'
|
final path = r'/api/provider/{homeId}'
|
||||||
.replaceAll('{' + 'userId' + '}', userId.toString());
|
.replaceAll('{' + 'homeId' + '}', homeId.toString());
|
||||||
|
|
||||||
Object postBody;
|
Object postBody;
|
||||||
|
|
||||||
@ -207,14 +207,14 @@ class ProviderApi {
|
|||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
/// Get all user providers
|
/// Get all home providers
|
||||||
///
|
///
|
||||||
/// Parameters:
|
/// Parameters:
|
||||||
///
|
///
|
||||||
/// * [String] userId (required):
|
/// * [String] homeId (required):
|
||||||
/// Id of user
|
/// Home Id
|
||||||
Future<List<ProviderDTO>> providerGetAll(String userId) async {
|
Future<List<ProviderDTO>> providerGetAll(String homeId) async {
|
||||||
final response = await providerGetAllWithHttpInfo(userId);
|
final response = await providerGetAllWithHttpInfo(homeId);
|
||||||
if (response.statusCode >= HttpStatus.badRequest) {
|
if (response.statusCode >= HttpStatus.badRequest) {
|
||||||
throw ApiException(response.statusCode, _decodeBodyBytes(response));
|
throw ApiException(response.statusCode, _decodeBodyBytes(response));
|
||||||
}
|
}
|
||||||
|
|||||||
@ -237,22 +237,22 @@ class RoomApi {
|
|||||||
return Future<String>.value(null);
|
return Future<String>.value(null);
|
||||||
}
|
}
|
||||||
|
|
||||||
/// Delete all room for a specified user
|
/// Delete all rooms for a specified home
|
||||||
///
|
///
|
||||||
/// Note: This method returns the HTTP [Response].
|
/// Note: This method returns the HTTP [Response].
|
||||||
///
|
///
|
||||||
/// Parameters:
|
/// Parameters:
|
||||||
///
|
///
|
||||||
/// * [String] userId (required):
|
/// * [String] homeId (required):
|
||||||
/// Id of user
|
/// Home Id
|
||||||
Future<Response> roomDeleteAllForUserWithHttpInfo(String userId) async {
|
Future<Response> roomDeleteAllForHomeWithHttpInfo(String homeId) async {
|
||||||
// Verify required params are set.
|
// Verify required params are set.
|
||||||
if (userId == null) {
|
if (homeId == null) {
|
||||||
throw ApiException(HttpStatus.badRequest, 'Missing required param: userId');
|
throw ApiException(HttpStatus.badRequest, 'Missing required param: homeId');
|
||||||
}
|
}
|
||||||
|
|
||||||
final path = r'/api/room/user/{userId}'
|
final path = r'/api/room/home/{homeId}'
|
||||||
.replaceAll('{' + 'userId' + '}', userId.toString());
|
.replaceAll('{' + 'homeId' + '}', homeId.toString());
|
||||||
|
|
||||||
Object postBody;
|
Object postBody;
|
||||||
|
|
||||||
@ -288,14 +288,14 @@ class RoomApi {
|
|||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
/// Delete all room for a specified user
|
/// Delete all rooms for a specified home
|
||||||
///
|
///
|
||||||
/// Parameters:
|
/// Parameters:
|
||||||
///
|
///
|
||||||
/// * [String] userId (required):
|
/// * [String] homeId (required):
|
||||||
/// Id of user
|
/// Home Id
|
||||||
Future<String> roomDeleteAllForUser(String userId) async {
|
Future<String> roomDeleteAllForHome(String homeId) async {
|
||||||
final response = await roomDeleteAllForUserWithHttpInfo(userId);
|
final response = await roomDeleteAllForHomeWithHttpInfo(homeId);
|
||||||
if (response.statusCode >= HttpStatus.badRequest) {
|
if (response.statusCode >= HttpStatus.badRequest) {
|
||||||
throw ApiException(response.statusCode, _decodeBodyBytes(response));
|
throw ApiException(response.statusCode, _decodeBodyBytes(response));
|
||||||
}
|
}
|
||||||
@ -308,22 +308,22 @@ class RoomApi {
|
|||||||
return Future<String>.value(null);
|
return Future<String>.value(null);
|
||||||
}
|
}
|
||||||
|
|
||||||
/// Get all rooms for the specified user
|
/// Get all rooms for the specified home
|
||||||
///
|
///
|
||||||
/// Note: This method returns the HTTP [Response].
|
/// Note: This method returns the HTTP [Response].
|
||||||
///
|
///
|
||||||
/// Parameters:
|
/// Parameters:
|
||||||
///
|
///
|
||||||
/// * [String] userId (required):
|
/// * [String] homeId (required):
|
||||||
/// Id of user
|
/// Home Id
|
||||||
Future<Response> roomGetAllWithHttpInfo(String userId) async {
|
Future<Response> roomGetAllWithHttpInfo(String homeId) async {
|
||||||
// Verify required params are set.
|
// Verify required params are set.
|
||||||
if (userId == null) {
|
if (homeId == null) {
|
||||||
throw ApiException(HttpStatus.badRequest, 'Missing required param: userId');
|
throw ApiException(HttpStatus.badRequest, 'Missing required param: homeId');
|
||||||
}
|
}
|
||||||
|
|
||||||
final path = r'/api/room/{userId}'
|
final path = r'/api/room/{homeId}'
|
||||||
.replaceAll('{' + 'userId' + '}', userId.toString());
|
.replaceAll('{' + 'homeId' + '}', homeId.toString());
|
||||||
|
|
||||||
Object postBody;
|
Object postBody;
|
||||||
|
|
||||||
@ -359,14 +359,14 @@ class RoomApi {
|
|||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
/// Get all rooms for the specified user
|
/// Get all rooms for the specified home
|
||||||
///
|
///
|
||||||
/// Parameters:
|
/// Parameters:
|
||||||
///
|
///
|
||||||
/// * [String] userId (required):
|
/// * [String] homeId (required):
|
||||||
/// Id of user
|
/// Home Id
|
||||||
Future<List<RoomSummaryDTO>> roomGetAll(String userId) async {
|
Future<List<RoomSummaryDTO>> roomGetAll(String homeId) async {
|
||||||
final response = await roomGetAllWithHttpInfo(userId);
|
final response = await roomGetAllWithHttpInfo(homeId);
|
||||||
if (response.statusCode >= HttpStatus.badRequest) {
|
if (response.statusCode >= HttpStatus.badRequest) {
|
||||||
throw ApiException(response.statusCode, _decodeBodyBytes(response));
|
throw ApiException(response.statusCode, _decodeBodyBytes(response));
|
||||||
}
|
}
|
||||||
@ -389,10 +389,7 @@ class RoomApi {
|
|||||||
///
|
///
|
||||||
/// * [String] roomId (required):
|
/// * [String] roomId (required):
|
||||||
/// room id
|
/// room id
|
||||||
///
|
Future<Response> roomGetDetailWithHttpInfo(String roomId) async {
|
||||||
/// * [String] userId:
|
|
||||||
/// user id
|
|
||||||
Future<Response> roomGetDetailWithHttpInfo(String roomId, { String userId }) async {
|
|
||||||
// Verify required params are set.
|
// Verify required params are set.
|
||||||
if (roomId == null) {
|
if (roomId == null) {
|
||||||
throw ApiException(HttpStatus.badRequest, 'Missing required param: roomId');
|
throw ApiException(HttpStatus.badRequest, 'Missing required param: roomId');
|
||||||
@ -407,10 +404,6 @@ class RoomApi {
|
|||||||
final headerParams = <String, String>{};
|
final headerParams = <String, String>{};
|
||||||
final formParams = <String, String>{};
|
final formParams = <String, String>{};
|
||||||
|
|
||||||
if (userId != null) {
|
|
||||||
queryParams.addAll(_convertParametersForCollectionFormat('', 'userId', userId));
|
|
||||||
}
|
|
||||||
|
|
||||||
final contentTypes = <String>[];
|
final contentTypes = <String>[];
|
||||||
final nullableContentType = contentTypes.isNotEmpty ? contentTypes[0] : null;
|
final nullableContentType = contentTypes.isNotEmpty ? contentTypes[0] : null;
|
||||||
final authNames = <String>['bearer'];
|
final authNames = <String>['bearer'];
|
||||||
@ -445,11 +438,8 @@ class RoomApi {
|
|||||||
///
|
///
|
||||||
/// * [String] roomId (required):
|
/// * [String] roomId (required):
|
||||||
/// room id
|
/// room id
|
||||||
///
|
Future<RoomDetailDTO> roomGetDetail(String roomId) async {
|
||||||
/// * [String] userId:
|
final response = await roomGetDetailWithHttpInfo(roomId);
|
||||||
/// user id
|
|
||||||
Future<RoomDetailDTO> roomGetDetail(String roomId, { String userId }) async {
|
|
||||||
final response = await roomGetDetailWithHttpInfo(roomId, userId: userId );
|
|
||||||
if (response.statusCode >= HttpStatus.badRequest) {
|
if (response.statusCode >= HttpStatus.badRequest) {
|
||||||
throw ApiException(response.statusCode, _decodeBodyBytes(response));
|
throw ApiException(response.statusCode, _decodeBodyBytes(response));
|
||||||
}
|
}
|
||||||
|
|||||||
@ -10,7 +10,7 @@
|
|||||||
part of openapi.api;
|
part of openapi.api;
|
||||||
|
|
||||||
class ApiClient {
|
class ApiClient {
|
||||||
ApiClient({this.basePath = 'http://localhost:25049'}) {
|
ApiClient({this.basePath = 'http://192.168.31.140'}) {
|
||||||
// Setup authentications (key: authentication name, value: authentication).
|
// Setup authentications (key: authentication name, value: authentication).
|
||||||
_authentications[r'bearer'] = OAuth();
|
_authentications[r'bearer'] = OAuth();
|
||||||
}
|
}
|
||||||
@ -161,12 +161,23 @@ class ApiClient {
|
|||||||
case 'ActionType':
|
case 'ActionType':
|
||||||
return ActionTypeTypeTransformer().decode(value);
|
return ActionTypeTypeTransformer().decode(value);
|
||||||
|
|
||||||
case 'Automation':
|
case 'AlarmMode':
|
||||||
return Automation.fromJson(value);
|
return AlarmMode.fromJson(value);
|
||||||
case 'AutomationCreateOrUpdateDetailDTO':
|
case 'AlarmModeCreateOrUpdateDetailDTO':
|
||||||
return AutomationCreateOrUpdateDetailDTO.fromJson(value);
|
return AlarmModeCreateOrUpdateDetailDTO.fromJson(value);
|
||||||
case 'AutomationCreateOrUpdateDetailDTOAllOf':
|
case 'AlarmModeCreateOrUpdateDetailDTOAllOf':
|
||||||
return AutomationCreateOrUpdateDetailDTOAllOf.fromJson(value);
|
return AlarmModeCreateOrUpdateDetailDTOAllOf.fromJson(value);
|
||||||
|
case 'AlarmModeDTO':
|
||||||
|
return AlarmModeDTO.fromJson(value);
|
||||||
|
case 'AlarmModeDetailDTO':
|
||||||
|
return AlarmModeDetailDTO.fromJson(value);
|
||||||
|
case 'AlarmModeDetailDTOAllOf':
|
||||||
|
return AlarmModeDetailDTOAllOf.fromJson(value);
|
||||||
|
case 'AlarmTriggered':
|
||||||
|
return AlarmTriggered.fromJson(value);
|
||||||
|
case 'AlarmType':
|
||||||
|
return AlarmTypeTypeTransformer().decode(value);
|
||||||
|
|
||||||
case 'AutomationDTO':
|
case 'AutomationDTO':
|
||||||
return AutomationDTO.fromJson(value);
|
return AutomationDTO.fromJson(value);
|
||||||
case 'AutomationDetailDTO':
|
case 'AutomationDetailDTO':
|
||||||
@ -175,6 +186,8 @@ class ApiClient {
|
|||||||
return AutomationDetailDTOAllOf.fromJson(value);
|
return AutomationDetailDTOAllOf.fromJson(value);
|
||||||
case 'AutomationState':
|
case 'AutomationState':
|
||||||
return AutomationState.fromJson(value);
|
return AutomationState.fromJson(value);
|
||||||
|
case 'AutomationTriggered':
|
||||||
|
return AutomationTriggered.fromJson(value);
|
||||||
case 'AzureADAuthModel':
|
case 'AzureADAuthModel':
|
||||||
return AzureADAuthModel.fromJson(value);
|
return AzureADAuthModel.fromJson(value);
|
||||||
case 'Book':
|
case 'Book':
|
||||||
@ -190,12 +203,16 @@ class ApiClient {
|
|||||||
case 'ConnectionStatus':
|
case 'ConnectionStatus':
|
||||||
return ConnectionStatusTypeTransformer().decode(value);
|
return ConnectionStatusTypeTransformer().decode(value);
|
||||||
|
|
||||||
case 'Device':
|
case 'CreateOrUpdateHomeDTO':
|
||||||
return Device.fromJson(value);
|
return CreateOrUpdateHomeDTO.fromJson(value);
|
||||||
|
case 'CreateOrUpdateHomeDTOAllOf':
|
||||||
|
return CreateOrUpdateHomeDTOAllOf.fromJson(value);
|
||||||
case 'DeviceDetailDTO':
|
case 'DeviceDetailDTO':
|
||||||
return DeviceDetailDTO.fromJson(value);
|
return DeviceDetailDTO.fromJson(value);
|
||||||
case 'DeviceDetailDTOAllOf':
|
case 'DeviceDetailDTOAllOf':
|
||||||
return DeviceDetailDTOAllOf.fromJson(value);
|
return DeviceDetailDTOAllOf.fromJson(value);
|
||||||
|
case 'DeviceState':
|
||||||
|
return DeviceState.fromJson(value);
|
||||||
case 'DeviceSummaryDTO':
|
case 'DeviceSummaryDTO':
|
||||||
return DeviceSummaryDTO.fromJson(value);
|
return DeviceSummaryDTO.fromJson(value);
|
||||||
case 'DeviceType':
|
case 'DeviceType':
|
||||||
@ -203,12 +220,21 @@ class ApiClient {
|
|||||||
|
|
||||||
case 'ElectricityProduction':
|
case 'ElectricityProduction':
|
||||||
return ElectricityProduction.fromJson(value);
|
return ElectricityProduction.fromJson(value);
|
||||||
|
case 'EventDTO':
|
||||||
|
return EventDTO.fromJson(value);
|
||||||
|
case 'EventDetailDTO':
|
||||||
|
return EventDetailDTO.fromJson(value);
|
||||||
|
case 'EventDetailDTOAllOf':
|
||||||
|
return EventDetailDTOAllOf.fromJson(value);
|
||||||
|
case 'EventType':
|
||||||
|
return EventTypeTypeTransformer().decode(value);
|
||||||
|
|
||||||
case 'FacebookAuthModel':
|
case 'FacebookAuthModel':
|
||||||
return FacebookAuthModel.fromJson(value);
|
return FacebookAuthModel.fromJson(value);
|
||||||
|
case 'GeolocalizedMode':
|
||||||
|
return GeolocalizedMode.fromJson(value);
|
||||||
case 'GoogleAuthModel':
|
case 'GoogleAuthModel':
|
||||||
return GoogleAuthModel.fromJson(value);
|
return GoogleAuthModel.fromJson(value);
|
||||||
case 'Group':
|
|
||||||
return Group.fromJson(value);
|
|
||||||
case 'GroupCreateOrUpdateDetailDTO':
|
case 'GroupCreateOrUpdateDetailDTO':
|
||||||
return GroupCreateOrUpdateDetailDTO.fromJson(value);
|
return GroupCreateOrUpdateDetailDTO.fromJson(value);
|
||||||
case 'GroupCreateOrUpdateDetailDTOAllOf':
|
case 'GroupCreateOrUpdateDetailDTOAllOf':
|
||||||
@ -219,6 +245,12 @@ class ApiClient {
|
|||||||
return GroupDetailDTOAllOf.fromJson(value);
|
return GroupDetailDTOAllOf.fromJson(value);
|
||||||
case 'GroupSummaryDTO':
|
case 'GroupSummaryDTO':
|
||||||
return GroupSummaryDTO.fromJson(value);
|
return GroupSummaryDTO.fromJson(value);
|
||||||
|
case 'HomeDTO':
|
||||||
|
return HomeDTO.fromJson(value);
|
||||||
|
case 'HomeDetailDTO':
|
||||||
|
return HomeDetailDTO.fromJson(value);
|
||||||
|
case 'HomeDetailDTOAllOf':
|
||||||
|
return HomeDetailDTOAllOf.fromJson(value);
|
||||||
case 'LoginDTO':
|
case 'LoginDTO':
|
||||||
return LoginDTO.fromJson(value);
|
return LoginDTO.fromJson(value);
|
||||||
case 'MeansOfCommunication':
|
case 'MeansOfCommunication':
|
||||||
@ -234,28 +266,27 @@ class ApiClient {
|
|||||||
return PanelMenuItem.fromJson(value);
|
return PanelMenuItem.fromJson(value);
|
||||||
case 'PanelSection':
|
case 'PanelSection':
|
||||||
return PanelSection.fromJson(value);
|
return PanelSection.fromJson(value);
|
||||||
case 'PlaceDTO':
|
case 'ProgrammedMode':
|
||||||
return PlaceDTO.fromJson(value);
|
return ProgrammedMode.fromJson(value);
|
||||||
case 'Provider':
|
|
||||||
return Provider.fromJson(value);
|
|
||||||
case 'ProviderDTO':
|
case 'ProviderDTO':
|
||||||
return ProviderDTO.fromJson(value);
|
return ProviderDTO.fromJson(value);
|
||||||
|
case 'ProviderType':
|
||||||
|
return ProviderTypeTypeTransformer().decode(value);
|
||||||
|
|
||||||
case 'RoomCreateOrUpdateDetailDTO':
|
case 'RoomCreateOrUpdateDetailDTO':
|
||||||
return RoomCreateOrUpdateDetailDTO.fromJson(value);
|
return RoomCreateOrUpdateDetailDTO.fromJson(value);
|
||||||
case 'RoomDetailDTO':
|
case 'RoomDetailDTO':
|
||||||
return RoomDetailDTO.fromJson(value);
|
return RoomDetailDTO.fromJson(value);
|
||||||
case 'RoomSummaryDTO':
|
case 'RoomSummaryDTO':
|
||||||
return RoomSummaryDTO.fromJson(value);
|
return RoomSummaryDTO.fromJson(value);
|
||||||
case 'ScreenConfiguration':
|
|
||||||
return ScreenConfiguration.fromJson(value);
|
|
||||||
case 'ScreenDevice':
|
case 'ScreenDevice':
|
||||||
return ScreenDevice.fromJson(value);
|
return ScreenDevice.fromJson(value);
|
||||||
case 'ScreenWidget':
|
|
||||||
return ScreenWidget.fromJson(value);
|
|
||||||
case 'SmartGardenMessage':
|
case 'SmartGardenMessage':
|
||||||
return SmartGardenMessage.fromJson(value);
|
return SmartGardenMessage.fromJson(value);
|
||||||
case 'SmartPrinterMessage':
|
case 'SmartPrinterMessage':
|
||||||
return SmartPrinterMessage.fromJson(value);
|
return SmartPrinterMessage.fromJson(value);
|
||||||
|
case 'TimePeriodAlarm':
|
||||||
|
return TimePeriodAlarm.fromJson(value);
|
||||||
case 'TokenDTO':
|
case 'TokenDTO':
|
||||||
return TokenDTO.fromJson(value);
|
return TokenDTO.fromJson(value);
|
||||||
case 'Trigger':
|
case 'Trigger':
|
||||||
|
|||||||
@ -61,6 +61,9 @@ String parameterToString(dynamic value) {
|
|||||||
if (value is ActionType) {
|
if (value is ActionType) {
|
||||||
return ActionTypeTypeTransformer().encode(value).toString();
|
return ActionTypeTypeTransformer().encode(value).toString();
|
||||||
}
|
}
|
||||||
|
if (value is AlarmType) {
|
||||||
|
return AlarmTypeTypeTransformer().encode(value).toString();
|
||||||
|
}
|
||||||
if (value is ConditionType) {
|
if (value is ConditionType) {
|
||||||
return ConditionTypeTypeTransformer().encode(value).toString();
|
return ConditionTypeTypeTransformer().encode(value).toString();
|
||||||
}
|
}
|
||||||
@ -73,9 +76,15 @@ String parameterToString(dynamic value) {
|
|||||||
if (value is DeviceType) {
|
if (value is DeviceType) {
|
||||||
return DeviceTypeTypeTransformer().encode(value).toString();
|
return DeviceTypeTypeTransformer().encode(value).toString();
|
||||||
}
|
}
|
||||||
|
if (value is EventType) {
|
||||||
|
return EventTypeTypeTransformer().encode(value).toString();
|
||||||
|
}
|
||||||
if (value is MeansOfCommunication) {
|
if (value is MeansOfCommunication) {
|
||||||
return MeansOfCommunicationTypeTransformer().encode(value).toString();
|
return MeansOfCommunicationTypeTransformer().encode(value).toString();
|
||||||
}
|
}
|
||||||
|
if (value is ProviderType) {
|
||||||
|
return ProviderTypeTypeTransformer().encode(value).toString();
|
||||||
|
}
|
||||||
if (value is TriggerType) {
|
if (value is TriggerType) {
|
||||||
return TriggerTypeTypeTransformer().encode(value).toString();
|
return TriggerTypeTypeTransformer().encode(value).toString();
|
||||||
}
|
}
|
||||||
|
|||||||
@ -18,6 +18,7 @@ class Action {
|
|||||||
this.rawRequest,
|
this.rawRequest,
|
||||||
this.providerId,
|
this.providerId,
|
||||||
this.type,
|
this.type,
|
||||||
|
this.isForce,
|
||||||
});
|
});
|
||||||
|
|
||||||
String groupId;
|
String groupId;
|
||||||
@ -32,6 +33,8 @@ class Action {
|
|||||||
|
|
||||||
ActionType type;
|
ActionType type;
|
||||||
|
|
||||||
|
bool isForce;
|
||||||
|
|
||||||
@override
|
@override
|
||||||
bool operator ==(Object other) => identical(this, other) || other is Action &&
|
bool operator ==(Object other) => identical(this, other) || other is Action &&
|
||||||
other.groupId == groupId &&
|
other.groupId == groupId &&
|
||||||
@ -39,7 +42,8 @@ class Action {
|
|||||||
other.states == states &&
|
other.states == states &&
|
||||||
other.rawRequest == rawRequest &&
|
other.rawRequest == rawRequest &&
|
||||||
other.providerId == providerId &&
|
other.providerId == providerId &&
|
||||||
other.type == type;
|
other.type == type &&
|
||||||
|
other.isForce == isForce;
|
||||||
|
|
||||||
@override
|
@override
|
||||||
int get hashCode =>
|
int get hashCode =>
|
||||||
@ -48,10 +52,11 @@ class Action {
|
|||||||
(states == null ? 0 : states.hashCode) +
|
(states == null ? 0 : states.hashCode) +
|
||||||
(rawRequest == null ? 0 : rawRequest.hashCode) +
|
(rawRequest == null ? 0 : rawRequest.hashCode) +
|
||||||
(providerId == null ? 0 : providerId.hashCode) +
|
(providerId == null ? 0 : providerId.hashCode) +
|
||||||
(type == null ? 0 : type.hashCode);
|
(type == null ? 0 : type.hashCode) +
|
||||||
|
(isForce == null ? 0 : isForce.hashCode);
|
||||||
|
|
||||||
@override
|
@override
|
||||||
String toString() => 'Action[groupId=$groupId, deviceId=$deviceId, states=$states, rawRequest=$rawRequest, providerId=$providerId, type=$type]';
|
String toString() => 'Action[groupId=$groupId, deviceId=$deviceId, states=$states, rawRequest=$rawRequest, providerId=$providerId, type=$type, isForce=$isForce]';
|
||||||
|
|
||||||
Map<String, dynamic> toJson() {
|
Map<String, dynamic> toJson() {
|
||||||
final json = <String, dynamic>{};
|
final json = <String, dynamic>{};
|
||||||
@ -73,6 +78,9 @@ class Action {
|
|||||||
if (type != null) {
|
if (type != null) {
|
||||||
json[r'type'] = type;
|
json[r'type'] = type;
|
||||||
}
|
}
|
||||||
|
if (isForce != null) {
|
||||||
|
json[r'isForce'] = isForce;
|
||||||
|
}
|
||||||
return json;
|
return json;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -87,6 +95,7 @@ class Action {
|
|||||||
rawRequest: json[r'rawRequest'],
|
rawRequest: json[r'rawRequest'],
|
||||||
providerId: json[r'providerId'],
|
providerId: json[r'providerId'],
|
||||||
type: ActionType.fromJson(json[r'type']),
|
type: ActionType.fromJson(json[r'type']),
|
||||||
|
isForce: json[r'isForce'],
|
||||||
);
|
);
|
||||||
|
|
||||||
static List<Action> listFromJson(List<dynamic> json, {bool emptyIsNull, bool growable,}) =>
|
static List<Action> listFromJson(List<dynamic> json, {bool emptyIsNull, bool growable,}) =>
|
||||||
|
|||||||
194
mycore_api/lib/model/alarm_mode.dart
Normal file
194
mycore_api/lib/model/alarm_mode.dart
Normal file
@ -0,0 +1,194 @@
|
|||||||
|
//
|
||||||
|
// 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 AlarmMode {
|
||||||
|
/// Returns a new [AlarmMode] instance.
|
||||||
|
AlarmMode({
|
||||||
|
this.id,
|
||||||
|
this.homeId,
|
||||||
|
this.name,
|
||||||
|
this.activated,
|
||||||
|
this.isDefault,
|
||||||
|
this.notification,
|
||||||
|
this.createdDate,
|
||||||
|
this.updatedDate,
|
||||||
|
this.type,
|
||||||
|
this.programmedMode,
|
||||||
|
this.geolocalizedMode,
|
||||||
|
this.triggers,
|
||||||
|
this.actions,
|
||||||
|
this.devicesIds,
|
||||||
|
});
|
||||||
|
|
||||||
|
String id;
|
||||||
|
|
||||||
|
String homeId;
|
||||||
|
|
||||||
|
String name;
|
||||||
|
|
||||||
|
bool activated;
|
||||||
|
|
||||||
|
bool isDefault;
|
||||||
|
|
||||||
|
bool notification;
|
||||||
|
|
||||||
|
DateTime createdDate;
|
||||||
|
|
||||||
|
DateTime updatedDate;
|
||||||
|
|
||||||
|
AlarmType type;
|
||||||
|
|
||||||
|
ProgrammedMode programmedMode;
|
||||||
|
|
||||||
|
GeolocalizedMode geolocalizedMode;
|
||||||
|
|
||||||
|
List<Trigger> triggers;
|
||||||
|
|
||||||
|
List<Action> actions;
|
||||||
|
|
||||||
|
List<String> devicesIds;
|
||||||
|
|
||||||
|
@override
|
||||||
|
bool operator ==(Object other) => identical(this, other) || other is AlarmMode &&
|
||||||
|
other.id == id &&
|
||||||
|
other.homeId == homeId &&
|
||||||
|
other.name == name &&
|
||||||
|
other.activated == activated &&
|
||||||
|
other.isDefault == isDefault &&
|
||||||
|
other.notification == notification &&
|
||||||
|
other.createdDate == createdDate &&
|
||||||
|
other.updatedDate == updatedDate &&
|
||||||
|
other.type == type &&
|
||||||
|
other.programmedMode == programmedMode &&
|
||||||
|
other.geolocalizedMode == geolocalizedMode &&
|
||||||
|
other.triggers == triggers &&
|
||||||
|
other.actions == actions &&
|
||||||
|
other.devicesIds == devicesIds;
|
||||||
|
|
||||||
|
@override
|
||||||
|
int get hashCode =>
|
||||||
|
(id == null ? 0 : id.hashCode) +
|
||||||
|
(homeId == null ? 0 : homeId.hashCode) +
|
||||||
|
(name == null ? 0 : name.hashCode) +
|
||||||
|
(activated == null ? 0 : activated.hashCode) +
|
||||||
|
(isDefault == null ? 0 : isDefault.hashCode) +
|
||||||
|
(notification == null ? 0 : notification.hashCode) +
|
||||||
|
(createdDate == null ? 0 : createdDate.hashCode) +
|
||||||
|
(updatedDate == null ? 0 : updatedDate.hashCode) +
|
||||||
|
(type == null ? 0 : type.hashCode) +
|
||||||
|
(programmedMode == null ? 0 : programmedMode.hashCode) +
|
||||||
|
(geolocalizedMode == null ? 0 : geolocalizedMode.hashCode) +
|
||||||
|
(triggers == null ? 0 : triggers.hashCode) +
|
||||||
|
(actions == null ? 0 : actions.hashCode) +
|
||||||
|
(devicesIds == null ? 0 : devicesIds.hashCode);
|
||||||
|
|
||||||
|
@override
|
||||||
|
String toString() => 'AlarmMode[id=$id, homeId=$homeId, name=$name, activated=$activated, isDefault=$isDefault, notification=$notification, createdDate=$createdDate, updatedDate=$updatedDate, type=$type, programmedMode=$programmedMode, geolocalizedMode=$geolocalizedMode, triggers=$triggers, actions=$actions, devicesIds=$devicesIds]';
|
||||||
|
|
||||||
|
Map<String, dynamic> toJson() {
|
||||||
|
final json = <String, dynamic>{};
|
||||||
|
if (id != null) {
|
||||||
|
json[r'id'] = id;
|
||||||
|
}
|
||||||
|
if (homeId != null) {
|
||||||
|
json[r'homeId'] = homeId;
|
||||||
|
}
|
||||||
|
if (name != null) {
|
||||||
|
json[r'name'] = name;
|
||||||
|
}
|
||||||
|
if (activated != null) {
|
||||||
|
json[r'activated'] = activated;
|
||||||
|
}
|
||||||
|
if (isDefault != null) {
|
||||||
|
json[r'isDefault'] = isDefault;
|
||||||
|
}
|
||||||
|
if (notification != null) {
|
||||||
|
json[r'notification'] = notification;
|
||||||
|
}
|
||||||
|
if (createdDate != null) {
|
||||||
|
json[r'createdDate'] = createdDate.toUtc().toIso8601String();
|
||||||
|
}
|
||||||
|
if (updatedDate != null) {
|
||||||
|
json[r'updatedDate'] = updatedDate.toUtc().toIso8601String();
|
||||||
|
}
|
||||||
|
if (type != null) {
|
||||||
|
json[r'type'] = type;
|
||||||
|
}
|
||||||
|
if (programmedMode != null) {
|
||||||
|
json[r'programmedMode'] = programmedMode;
|
||||||
|
}
|
||||||
|
if (geolocalizedMode != null) {
|
||||||
|
json[r'geolocalizedMode'] = geolocalizedMode;
|
||||||
|
}
|
||||||
|
if (triggers != null) {
|
||||||
|
json[r'triggers'] = triggers;
|
||||||
|
}
|
||||||
|
if (actions != null) {
|
||||||
|
json[r'actions'] = actions;
|
||||||
|
}
|
||||||
|
if (devicesIds != null) {
|
||||||
|
json[r'devicesIds'] = devicesIds;
|
||||||
|
}
|
||||||
|
return json;
|
||||||
|
}
|
||||||
|
|
||||||
|
/// Returns a new [AlarmMode] instance and imports its values from
|
||||||
|
/// [json] if it's non-null, null if [json] is null.
|
||||||
|
static AlarmMode fromJson(Map<String, dynamic> json) => json == null
|
||||||
|
? null
|
||||||
|
: AlarmMode(
|
||||||
|
id: json[r'id'],
|
||||||
|
homeId: json[r'homeId'],
|
||||||
|
name: json[r'name'],
|
||||||
|
activated: json[r'activated'],
|
||||||
|
isDefault: json[r'isDefault'],
|
||||||
|
notification: json[r'notification'],
|
||||||
|
createdDate: json[r'createdDate'] == null
|
||||||
|
? null
|
||||||
|
: DateTime.parse(json[r'createdDate']),
|
||||||
|
updatedDate: json[r'updatedDate'] == null
|
||||||
|
? null
|
||||||
|
: DateTime.parse(json[r'updatedDate']),
|
||||||
|
type: AlarmType.fromJson(json[r'type']),
|
||||||
|
programmedMode: ProgrammedMode.fromJson(json[r'programmedMode']),
|
||||||
|
geolocalizedMode: GeolocalizedMode.fromJson(json[r'geolocalizedMode']),
|
||||||
|
triggers: Trigger.listFromJson(json[r'triggers']),
|
||||||
|
actions: Action.listFromJson(json[r'actions']),
|
||||||
|
devicesIds: json[r'devicesIds'] == null
|
||||||
|
? null
|
||||||
|
: (json[r'devicesIds'] as List).cast<String>(),
|
||||||
|
);
|
||||||
|
|
||||||
|
static List<AlarmMode> listFromJson(List<dynamic> json, {bool emptyIsNull, bool growable,}) =>
|
||||||
|
json == null || json.isEmpty
|
||||||
|
? true == emptyIsNull ? null : <AlarmMode>[]
|
||||||
|
: json.map((v) => AlarmMode.fromJson(v)).toList(growable: true == growable);
|
||||||
|
|
||||||
|
static Map<String, AlarmMode> mapFromJson(Map<String, dynamic> json) {
|
||||||
|
final map = <String, AlarmMode>{};
|
||||||
|
if (json != null && json.isNotEmpty) {
|
||||||
|
json.forEach((String key, dynamic v) => map[key] = AlarmMode.fromJson(v));
|
||||||
|
}
|
||||||
|
return map;
|
||||||
|
}
|
||||||
|
|
||||||
|
// maps a json object with a list of AlarmMode-objects as value to a dart map
|
||||||
|
static Map<String, List<AlarmMode>> mapListFromJson(Map<String, dynamic> json, {bool emptyIsNull, bool growable,}) {
|
||||||
|
final map = <String, List<AlarmMode>>{};
|
||||||
|
if (json != null && json.isNotEmpty) {
|
||||||
|
json.forEach((String key, dynamic v) {
|
||||||
|
map[key] = AlarmMode.listFromJson(v, emptyIsNull: emptyIsNull, growable: growable);
|
||||||
|
});
|
||||||
|
}
|
||||||
|
return map;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
183
mycore_api/lib/model/alarm_mode_create_or_update_detail_dto.dart
Normal file
183
mycore_api/lib/model/alarm_mode_create_or_update_detail_dto.dart
Normal file
@ -0,0 +1,183 @@
|
|||||||
|
//
|
||||||
|
// 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 AlarmModeCreateOrUpdateDetailDTO {
|
||||||
|
/// Returns a new [AlarmModeCreateOrUpdateDetailDTO] instance.
|
||||||
|
AlarmModeCreateOrUpdateDetailDTO({
|
||||||
|
this.id,
|
||||||
|
this.homeId,
|
||||||
|
this.name,
|
||||||
|
this.type,
|
||||||
|
this.activated,
|
||||||
|
this.isDefault,
|
||||||
|
this.notification,
|
||||||
|
this.createdDate,
|
||||||
|
this.updatedDate,
|
||||||
|
this.triggers,
|
||||||
|
this.actions,
|
||||||
|
this.programmedMode,
|
||||||
|
this.geolocalizedMode,
|
||||||
|
});
|
||||||
|
|
||||||
|
String id;
|
||||||
|
|
||||||
|
String homeId;
|
||||||
|
|
||||||
|
String name;
|
||||||
|
|
||||||
|
AlarmType type;
|
||||||
|
|
||||||
|
bool activated;
|
||||||
|
|
||||||
|
bool isDefault;
|
||||||
|
|
||||||
|
bool notification;
|
||||||
|
|
||||||
|
DateTime createdDate;
|
||||||
|
|
||||||
|
DateTime updatedDate;
|
||||||
|
|
||||||
|
List<Trigger> triggers;
|
||||||
|
|
||||||
|
List<Action> actions;
|
||||||
|
|
||||||
|
ProgrammedMode programmedMode;
|
||||||
|
|
||||||
|
GeolocalizedMode geolocalizedMode;
|
||||||
|
|
||||||
|
@override
|
||||||
|
bool operator ==(Object other) => identical(this, other) || other is AlarmModeCreateOrUpdateDetailDTO &&
|
||||||
|
other.id == id &&
|
||||||
|
other.homeId == homeId &&
|
||||||
|
other.name == name &&
|
||||||
|
other.type == type &&
|
||||||
|
other.activated == activated &&
|
||||||
|
other.isDefault == isDefault &&
|
||||||
|
other.notification == notification &&
|
||||||
|
other.createdDate == createdDate &&
|
||||||
|
other.updatedDate == updatedDate &&
|
||||||
|
other.triggers == triggers &&
|
||||||
|
other.actions == actions &&
|
||||||
|
other.programmedMode == programmedMode &&
|
||||||
|
other.geolocalizedMode == geolocalizedMode;
|
||||||
|
|
||||||
|
@override
|
||||||
|
int get hashCode =>
|
||||||
|
(id == null ? 0 : id.hashCode) +
|
||||||
|
(homeId == null ? 0 : homeId.hashCode) +
|
||||||
|
(name == null ? 0 : name.hashCode) +
|
||||||
|
(type == null ? 0 : type.hashCode) +
|
||||||
|
(activated == null ? 0 : activated.hashCode) +
|
||||||
|
(isDefault == null ? 0 : isDefault.hashCode) +
|
||||||
|
(notification == null ? 0 : notification.hashCode) +
|
||||||
|
(createdDate == null ? 0 : createdDate.hashCode) +
|
||||||
|
(updatedDate == null ? 0 : updatedDate.hashCode) +
|
||||||
|
(triggers == null ? 0 : triggers.hashCode) +
|
||||||
|
(actions == null ? 0 : actions.hashCode) +
|
||||||
|
(programmedMode == null ? 0 : programmedMode.hashCode) +
|
||||||
|
(geolocalizedMode == null ? 0 : geolocalizedMode.hashCode);
|
||||||
|
|
||||||
|
@override
|
||||||
|
String toString() => 'AlarmModeCreateOrUpdateDetailDTO[id=$id, homeId=$homeId, name=$name, type=$type, activated=$activated, isDefault=$isDefault, notification=$notification, createdDate=$createdDate, updatedDate=$updatedDate, triggers=$triggers, actions=$actions, programmedMode=$programmedMode, geolocalizedMode=$geolocalizedMode]';
|
||||||
|
|
||||||
|
Map<String, dynamic> toJson() {
|
||||||
|
final json = <String, dynamic>{};
|
||||||
|
if (id != null) {
|
||||||
|
json[r'id'] = id;
|
||||||
|
}
|
||||||
|
if (homeId != null) {
|
||||||
|
json[r'homeId'] = homeId;
|
||||||
|
}
|
||||||
|
if (name != null) {
|
||||||
|
json[r'name'] = name;
|
||||||
|
}
|
||||||
|
if (type != null) {
|
||||||
|
json[r'type'] = type;
|
||||||
|
}
|
||||||
|
if (activated != null) {
|
||||||
|
json[r'activated'] = activated;
|
||||||
|
}
|
||||||
|
if (isDefault != null) {
|
||||||
|
json[r'isDefault'] = isDefault;
|
||||||
|
}
|
||||||
|
if (notification != null) {
|
||||||
|
json[r'notification'] = notification;
|
||||||
|
}
|
||||||
|
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 (actions != null) {
|
||||||
|
json[r'actions'] = actions;
|
||||||
|
}
|
||||||
|
if (programmedMode != null) {
|
||||||
|
json[r'programmedMode'] = programmedMode;
|
||||||
|
}
|
||||||
|
if (geolocalizedMode != null) {
|
||||||
|
json[r'geolocalizedMode'] = geolocalizedMode;
|
||||||
|
}
|
||||||
|
return json;
|
||||||
|
}
|
||||||
|
|
||||||
|
/// Returns a new [AlarmModeCreateOrUpdateDetailDTO] instance and imports its values from
|
||||||
|
/// [json] if it's non-null, null if [json] is null.
|
||||||
|
static AlarmModeCreateOrUpdateDetailDTO fromJson(Map<String, dynamic> json) => json == null
|
||||||
|
? null
|
||||||
|
: AlarmModeCreateOrUpdateDetailDTO(
|
||||||
|
id: json[r'id'],
|
||||||
|
homeId: json[r'homeId'],
|
||||||
|
name: json[r'name'],
|
||||||
|
type: AlarmType.fromJson(json[r'type']),
|
||||||
|
activated: json[r'activated'],
|
||||||
|
isDefault: json[r'isDefault'],
|
||||||
|
notification: json[r'notification'],
|
||||||
|
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']),
|
||||||
|
actions: Action.listFromJson(json[r'actions']),
|
||||||
|
programmedMode: ProgrammedMode.fromJson(json[r'programmedMode']),
|
||||||
|
geolocalizedMode: GeolocalizedMode.fromJson(json[r'geolocalizedMode']),
|
||||||
|
);
|
||||||
|
|
||||||
|
static List<AlarmModeCreateOrUpdateDetailDTO> listFromJson(List<dynamic> json, {bool emptyIsNull, bool growable,}) =>
|
||||||
|
json == null || json.isEmpty
|
||||||
|
? true == emptyIsNull ? null : <AlarmModeCreateOrUpdateDetailDTO>[]
|
||||||
|
: json.map((v) => AlarmModeCreateOrUpdateDetailDTO.fromJson(v)).toList(growable: true == growable);
|
||||||
|
|
||||||
|
static Map<String, AlarmModeCreateOrUpdateDetailDTO> mapFromJson(Map<String, dynamic> json) {
|
||||||
|
final map = <String, AlarmModeCreateOrUpdateDetailDTO>{};
|
||||||
|
if (json != null && json.isNotEmpty) {
|
||||||
|
json.forEach((String key, dynamic v) => map[key] = AlarmModeCreateOrUpdateDetailDTO.fromJson(v));
|
||||||
|
}
|
||||||
|
return map;
|
||||||
|
}
|
||||||
|
|
||||||
|
// maps a json object with a list of AlarmModeCreateOrUpdateDetailDTO-objects as value to a dart map
|
||||||
|
static Map<String, List<AlarmModeCreateOrUpdateDetailDTO>> mapListFromJson(Map<String, dynamic> json, {bool emptyIsNull, bool growable,}) {
|
||||||
|
final map = <String, List<AlarmModeCreateOrUpdateDetailDTO>>{};
|
||||||
|
if (json != null && json.isNotEmpty) {
|
||||||
|
json.forEach((String key, dynamic v) {
|
||||||
|
map[key] = AlarmModeCreateOrUpdateDetailDTO.listFromJson(v, emptyIsNull: emptyIsNull, growable: growable);
|
||||||
|
});
|
||||||
|
}
|
||||||
|
return map;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
@ -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 AlarmModeCreateOrUpdateDetailDTOAllOf {
|
||||||
|
/// Returns a new [AlarmModeCreateOrUpdateDetailDTOAllOf] instance.
|
||||||
|
AlarmModeCreateOrUpdateDetailDTOAllOf({
|
||||||
|
this.triggers,
|
||||||
|
this.actions,
|
||||||
|
this.programmedMode,
|
||||||
|
this.geolocalizedMode,
|
||||||
|
});
|
||||||
|
|
||||||
|
List<Trigger> triggers;
|
||||||
|
|
||||||
|
List<Action> actions;
|
||||||
|
|
||||||
|
ProgrammedMode programmedMode;
|
||||||
|
|
||||||
|
GeolocalizedMode geolocalizedMode;
|
||||||
|
|
||||||
|
@override
|
||||||
|
bool operator ==(Object other) => identical(this, other) || other is AlarmModeCreateOrUpdateDetailDTOAllOf &&
|
||||||
|
other.triggers == triggers &&
|
||||||
|
other.actions == actions &&
|
||||||
|
other.programmedMode == programmedMode &&
|
||||||
|
other.geolocalizedMode == geolocalizedMode;
|
||||||
|
|
||||||
|
@override
|
||||||
|
int get hashCode =>
|
||||||
|
(triggers == null ? 0 : triggers.hashCode) +
|
||||||
|
(actions == null ? 0 : actions.hashCode) +
|
||||||
|
(programmedMode == null ? 0 : programmedMode.hashCode) +
|
||||||
|
(geolocalizedMode == null ? 0 : geolocalizedMode.hashCode);
|
||||||
|
|
||||||
|
@override
|
||||||
|
String toString() => 'AlarmModeCreateOrUpdateDetailDTOAllOf[triggers=$triggers, actions=$actions, programmedMode=$programmedMode, geolocalizedMode=$geolocalizedMode]';
|
||||||
|
|
||||||
|
Map<String, dynamic> toJson() {
|
||||||
|
final json = <String, dynamic>{};
|
||||||
|
if (triggers != null) {
|
||||||
|
json[r'triggers'] = triggers;
|
||||||
|
}
|
||||||
|
if (actions != null) {
|
||||||
|
json[r'actions'] = actions;
|
||||||
|
}
|
||||||
|
if (programmedMode != null) {
|
||||||
|
json[r'programmedMode'] = programmedMode;
|
||||||
|
}
|
||||||
|
if (geolocalizedMode != null) {
|
||||||
|
json[r'geolocalizedMode'] = geolocalizedMode;
|
||||||
|
}
|
||||||
|
return json;
|
||||||
|
}
|
||||||
|
|
||||||
|
/// Returns a new [AlarmModeCreateOrUpdateDetailDTOAllOf] instance and imports its values from
|
||||||
|
/// [json] if it's non-null, null if [json] is null.
|
||||||
|
static AlarmModeCreateOrUpdateDetailDTOAllOf fromJson(Map<String, dynamic> json) => json == null
|
||||||
|
? null
|
||||||
|
: AlarmModeCreateOrUpdateDetailDTOAllOf(
|
||||||
|
triggers: Trigger.listFromJson(json[r'triggers']),
|
||||||
|
actions: Action.listFromJson(json[r'actions']),
|
||||||
|
programmedMode: ProgrammedMode.fromJson(json[r'programmedMode']),
|
||||||
|
geolocalizedMode: GeolocalizedMode.fromJson(json[r'geolocalizedMode']),
|
||||||
|
);
|
||||||
|
|
||||||
|
static List<AlarmModeCreateOrUpdateDetailDTOAllOf> listFromJson(List<dynamic> json, {bool emptyIsNull, bool growable,}) =>
|
||||||
|
json == null || json.isEmpty
|
||||||
|
? true == emptyIsNull ? null : <AlarmModeCreateOrUpdateDetailDTOAllOf>[]
|
||||||
|
: json.map((v) => AlarmModeCreateOrUpdateDetailDTOAllOf.fromJson(v)).toList(growable: true == growable);
|
||||||
|
|
||||||
|
static Map<String, AlarmModeCreateOrUpdateDetailDTOAllOf> mapFromJson(Map<String, dynamic> json) {
|
||||||
|
final map = <String, AlarmModeCreateOrUpdateDetailDTOAllOf>{};
|
||||||
|
if (json != null && json.isNotEmpty) {
|
||||||
|
json.forEach((String key, dynamic v) => map[key] = AlarmModeCreateOrUpdateDetailDTOAllOf.fromJson(v));
|
||||||
|
}
|
||||||
|
return map;
|
||||||
|
}
|
||||||
|
|
||||||
|
// maps a json object with a list of AlarmModeCreateOrUpdateDetailDTOAllOf-objects as value to a dart map
|
||||||
|
static Map<String, List<AlarmModeCreateOrUpdateDetailDTOAllOf>> mapListFromJson(Map<String, dynamic> json, {bool emptyIsNull, bool growable,}) {
|
||||||
|
final map = <String, List<AlarmModeCreateOrUpdateDetailDTOAllOf>>{};
|
||||||
|
if (json != null && json.isNotEmpty) {
|
||||||
|
json.forEach((String key, dynamic v) {
|
||||||
|
map[key] = AlarmModeCreateOrUpdateDetailDTOAllOf.listFromJson(v, emptyIsNull: emptyIsNull, growable: growable);
|
||||||
|
});
|
||||||
|
}
|
||||||
|
return map;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
183
mycore_api/lib/model/alarm_mode_detail_dto.dart
Normal file
183
mycore_api/lib/model/alarm_mode_detail_dto.dart
Normal file
@ -0,0 +1,183 @@
|
|||||||
|
//
|
||||||
|
// 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 AlarmModeDetailDTO {
|
||||||
|
/// Returns a new [AlarmModeDetailDTO] instance.
|
||||||
|
AlarmModeDetailDTO({
|
||||||
|
this.id,
|
||||||
|
this.homeId,
|
||||||
|
this.name,
|
||||||
|
this.type,
|
||||||
|
this.activated,
|
||||||
|
this.isDefault,
|
||||||
|
this.notification,
|
||||||
|
this.createdDate,
|
||||||
|
this.updatedDate,
|
||||||
|
this.triggers,
|
||||||
|
this.devices,
|
||||||
|
this.programmedMode,
|
||||||
|
this.geolocalizedMode,
|
||||||
|
});
|
||||||
|
|
||||||
|
String id;
|
||||||
|
|
||||||
|
String homeId;
|
||||||
|
|
||||||
|
String name;
|
||||||
|
|
||||||
|
AlarmType type;
|
||||||
|
|
||||||
|
bool activated;
|
||||||
|
|
||||||
|
bool isDefault;
|
||||||
|
|
||||||
|
bool notification;
|
||||||
|
|
||||||
|
DateTime createdDate;
|
||||||
|
|
||||||
|
DateTime updatedDate;
|
||||||
|
|
||||||
|
List<Trigger> triggers;
|
||||||
|
|
||||||
|
List<DeviceDetailDTO> devices;
|
||||||
|
|
||||||
|
ProgrammedMode programmedMode;
|
||||||
|
|
||||||
|
GeolocalizedMode geolocalizedMode;
|
||||||
|
|
||||||
|
@override
|
||||||
|
bool operator ==(Object other) => identical(this, other) || other is AlarmModeDetailDTO &&
|
||||||
|
other.id == id &&
|
||||||
|
other.homeId == homeId &&
|
||||||
|
other.name == name &&
|
||||||
|
other.type == type &&
|
||||||
|
other.activated == activated &&
|
||||||
|
other.isDefault == isDefault &&
|
||||||
|
other.notification == notification &&
|
||||||
|
other.createdDate == createdDate &&
|
||||||
|
other.updatedDate == updatedDate &&
|
||||||
|
other.triggers == triggers &&
|
||||||
|
other.devices == devices &&
|
||||||
|
other.programmedMode == programmedMode &&
|
||||||
|
other.geolocalizedMode == geolocalizedMode;
|
||||||
|
|
||||||
|
@override
|
||||||
|
int get hashCode =>
|
||||||
|
(id == null ? 0 : id.hashCode) +
|
||||||
|
(homeId == null ? 0 : homeId.hashCode) +
|
||||||
|
(name == null ? 0 : name.hashCode) +
|
||||||
|
(type == null ? 0 : type.hashCode) +
|
||||||
|
(activated == null ? 0 : activated.hashCode) +
|
||||||
|
(isDefault == null ? 0 : isDefault.hashCode) +
|
||||||
|
(notification == null ? 0 : notification.hashCode) +
|
||||||
|
(createdDate == null ? 0 : createdDate.hashCode) +
|
||||||
|
(updatedDate == null ? 0 : updatedDate.hashCode) +
|
||||||
|
(triggers == null ? 0 : triggers.hashCode) +
|
||||||
|
(devices == null ? 0 : devices.hashCode) +
|
||||||
|
(programmedMode == null ? 0 : programmedMode.hashCode) +
|
||||||
|
(geolocalizedMode == null ? 0 : geolocalizedMode.hashCode);
|
||||||
|
|
||||||
|
@override
|
||||||
|
String toString() => 'AlarmModeDetailDTO[id=$id, homeId=$homeId, name=$name, type=$type, activated=$activated, isDefault=$isDefault, notification=$notification, createdDate=$createdDate, updatedDate=$updatedDate, triggers=$triggers, devices=$devices, programmedMode=$programmedMode, geolocalizedMode=$geolocalizedMode]';
|
||||||
|
|
||||||
|
Map<String, dynamic> toJson() {
|
||||||
|
final json = <String, dynamic>{};
|
||||||
|
if (id != null) {
|
||||||
|
json[r'id'] = id;
|
||||||
|
}
|
||||||
|
if (homeId != null) {
|
||||||
|
json[r'homeId'] = homeId;
|
||||||
|
}
|
||||||
|
if (name != null) {
|
||||||
|
json[r'name'] = name;
|
||||||
|
}
|
||||||
|
if (type != null) {
|
||||||
|
json[r'type'] = type;
|
||||||
|
}
|
||||||
|
if (activated != null) {
|
||||||
|
json[r'activated'] = activated;
|
||||||
|
}
|
||||||
|
if (isDefault != null) {
|
||||||
|
json[r'isDefault'] = isDefault;
|
||||||
|
}
|
||||||
|
if (notification != null) {
|
||||||
|
json[r'notification'] = notification;
|
||||||
|
}
|
||||||
|
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 (devices != null) {
|
||||||
|
json[r'devices'] = devices;
|
||||||
|
}
|
||||||
|
if (programmedMode != null) {
|
||||||
|
json[r'programmedMode'] = programmedMode;
|
||||||
|
}
|
||||||
|
if (geolocalizedMode != null) {
|
||||||
|
json[r'geolocalizedMode'] = geolocalizedMode;
|
||||||
|
}
|
||||||
|
return json;
|
||||||
|
}
|
||||||
|
|
||||||
|
/// Returns a new [AlarmModeDetailDTO] instance and imports its values from
|
||||||
|
/// [json] if it's non-null, null if [json] is null.
|
||||||
|
static AlarmModeDetailDTO fromJson(Map<String, dynamic> json) => json == null
|
||||||
|
? null
|
||||||
|
: AlarmModeDetailDTO(
|
||||||
|
id: json[r'id'],
|
||||||
|
homeId: json[r'homeId'],
|
||||||
|
name: json[r'name'],
|
||||||
|
type: AlarmType.fromJson(json[r'type']),
|
||||||
|
activated: json[r'activated'],
|
||||||
|
isDefault: json[r'isDefault'],
|
||||||
|
notification: json[r'notification'],
|
||||||
|
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']),
|
||||||
|
devices: DeviceDetailDTO.listFromJson(json[r'devices']),
|
||||||
|
programmedMode: ProgrammedMode.fromJson(json[r'programmedMode']),
|
||||||
|
geolocalizedMode: GeolocalizedMode.fromJson(json[r'geolocalizedMode']),
|
||||||
|
);
|
||||||
|
|
||||||
|
static List<AlarmModeDetailDTO> listFromJson(List<dynamic> json, {bool emptyIsNull, bool growable,}) =>
|
||||||
|
json == null || json.isEmpty
|
||||||
|
? true == emptyIsNull ? null : <AlarmModeDetailDTO>[]
|
||||||
|
: json.map((v) => AlarmModeDetailDTO.fromJson(v)).toList(growable: true == growable);
|
||||||
|
|
||||||
|
static Map<String, AlarmModeDetailDTO> mapFromJson(Map<String, dynamic> json) {
|
||||||
|
final map = <String, AlarmModeDetailDTO>{};
|
||||||
|
if (json != null && json.isNotEmpty) {
|
||||||
|
json.forEach((String key, dynamic v) => map[key] = AlarmModeDetailDTO.fromJson(v));
|
||||||
|
}
|
||||||
|
return map;
|
||||||
|
}
|
||||||
|
|
||||||
|
// maps a json object with a list of AlarmModeDetailDTO-objects as value to a dart map
|
||||||
|
static Map<String, List<AlarmModeDetailDTO>> mapListFromJson(Map<String, dynamic> json, {bool emptyIsNull, bool growable,}) {
|
||||||
|
final map = <String, List<AlarmModeDetailDTO>>{};
|
||||||
|
if (json != null && json.isNotEmpty) {
|
||||||
|
json.forEach((String key, dynamic v) {
|
||||||
|
map[key] = AlarmModeDetailDTO.listFromJson(v, emptyIsNull: emptyIsNull, growable: growable);
|
||||||
|
});
|
||||||
|
}
|
||||||
|
return map;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
98
mycore_api/lib/model/alarm_mode_detail_dto_all_of.dart
Normal file
98
mycore_api/lib/model/alarm_mode_detail_dto_all_of.dart
Normal file
@ -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 AlarmModeDetailDTOAllOf {
|
||||||
|
/// Returns a new [AlarmModeDetailDTOAllOf] instance.
|
||||||
|
AlarmModeDetailDTOAllOf({
|
||||||
|
this.triggers,
|
||||||
|
this.devices,
|
||||||
|
this.programmedMode,
|
||||||
|
this.geolocalizedMode,
|
||||||
|
});
|
||||||
|
|
||||||
|
List<Trigger> triggers;
|
||||||
|
|
||||||
|
List<DeviceDetailDTO> devices;
|
||||||
|
|
||||||
|
ProgrammedMode programmedMode;
|
||||||
|
|
||||||
|
GeolocalizedMode geolocalizedMode;
|
||||||
|
|
||||||
|
@override
|
||||||
|
bool operator ==(Object other) => identical(this, other) || other is AlarmModeDetailDTOAllOf &&
|
||||||
|
other.triggers == triggers &&
|
||||||
|
other.devices == devices &&
|
||||||
|
other.programmedMode == programmedMode &&
|
||||||
|
other.geolocalizedMode == geolocalizedMode;
|
||||||
|
|
||||||
|
@override
|
||||||
|
int get hashCode =>
|
||||||
|
(triggers == null ? 0 : triggers.hashCode) +
|
||||||
|
(devices == null ? 0 : devices.hashCode) +
|
||||||
|
(programmedMode == null ? 0 : programmedMode.hashCode) +
|
||||||
|
(geolocalizedMode == null ? 0 : geolocalizedMode.hashCode);
|
||||||
|
|
||||||
|
@override
|
||||||
|
String toString() => 'AlarmModeDetailDTOAllOf[triggers=$triggers, devices=$devices, programmedMode=$programmedMode, geolocalizedMode=$geolocalizedMode]';
|
||||||
|
|
||||||
|
Map<String, dynamic> toJson() {
|
||||||
|
final json = <String, dynamic>{};
|
||||||
|
if (triggers != null) {
|
||||||
|
json[r'triggers'] = triggers;
|
||||||
|
}
|
||||||
|
if (devices != null) {
|
||||||
|
json[r'devices'] = devices;
|
||||||
|
}
|
||||||
|
if (programmedMode != null) {
|
||||||
|
json[r'programmedMode'] = programmedMode;
|
||||||
|
}
|
||||||
|
if (geolocalizedMode != null) {
|
||||||
|
json[r'geolocalizedMode'] = geolocalizedMode;
|
||||||
|
}
|
||||||
|
return json;
|
||||||
|
}
|
||||||
|
|
||||||
|
/// Returns a new [AlarmModeDetailDTOAllOf] instance and imports its values from
|
||||||
|
/// [json] if it's non-null, null if [json] is null.
|
||||||
|
static AlarmModeDetailDTOAllOf fromJson(Map<String, dynamic> json) => json == null
|
||||||
|
? null
|
||||||
|
: AlarmModeDetailDTOAllOf(
|
||||||
|
triggers: Trigger.listFromJson(json[r'triggers']),
|
||||||
|
devices: DeviceDetailDTO.listFromJson(json[r'devices']),
|
||||||
|
programmedMode: ProgrammedMode.fromJson(json[r'programmedMode']),
|
||||||
|
geolocalizedMode: GeolocalizedMode.fromJson(json[r'geolocalizedMode']),
|
||||||
|
);
|
||||||
|
|
||||||
|
static List<AlarmModeDetailDTOAllOf> listFromJson(List<dynamic> json, {bool emptyIsNull, bool growable,}) =>
|
||||||
|
json == null || json.isEmpty
|
||||||
|
? true == emptyIsNull ? null : <AlarmModeDetailDTOAllOf>[]
|
||||||
|
: json.map((v) => AlarmModeDetailDTOAllOf.fromJson(v)).toList(growable: true == growable);
|
||||||
|
|
||||||
|
static Map<String, AlarmModeDetailDTOAllOf> mapFromJson(Map<String, dynamic> json) {
|
||||||
|
final map = <String, AlarmModeDetailDTOAllOf>{};
|
||||||
|
if (json != null && json.isNotEmpty) {
|
||||||
|
json.forEach((String key, dynamic v) => map[key] = AlarmModeDetailDTOAllOf.fromJson(v));
|
||||||
|
}
|
||||||
|
return map;
|
||||||
|
}
|
||||||
|
|
||||||
|
// maps a json object with a list of AlarmModeDetailDTOAllOf-objects as value to a dart map
|
||||||
|
static Map<String, List<AlarmModeDetailDTOAllOf>> mapListFromJson(Map<String, dynamic> json, {bool emptyIsNull, bool growable,}) {
|
||||||
|
final map = <String, List<AlarmModeDetailDTOAllOf>>{};
|
||||||
|
if (json != null && json.isNotEmpty) {
|
||||||
|
json.forEach((String key, dynamic v) {
|
||||||
|
map[key] = AlarmModeDetailDTOAllOf.listFromJson(v, emptyIsNull: emptyIsNull, growable: growable);
|
||||||
|
});
|
||||||
|
}
|
||||||
|
return map;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
147
mycore_api/lib/model/alarm_mode_dto.dart
Normal file
147
mycore_api/lib/model/alarm_mode_dto.dart
Normal file
@ -0,0 +1,147 @@
|
|||||||
|
//
|
||||||
|
// 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 AlarmModeDTO {
|
||||||
|
/// Returns a new [AlarmModeDTO] instance.
|
||||||
|
AlarmModeDTO({
|
||||||
|
this.id,
|
||||||
|
this.homeId,
|
||||||
|
this.name,
|
||||||
|
this.type,
|
||||||
|
this.activated,
|
||||||
|
this.isDefault,
|
||||||
|
this.notification,
|
||||||
|
this.createdDate,
|
||||||
|
this.updatedDate,
|
||||||
|
});
|
||||||
|
|
||||||
|
String id;
|
||||||
|
|
||||||
|
String homeId;
|
||||||
|
|
||||||
|
String name;
|
||||||
|
|
||||||
|
AlarmType type;
|
||||||
|
|
||||||
|
bool activated;
|
||||||
|
|
||||||
|
bool isDefault;
|
||||||
|
|
||||||
|
bool notification;
|
||||||
|
|
||||||
|
DateTime createdDate;
|
||||||
|
|
||||||
|
DateTime updatedDate;
|
||||||
|
|
||||||
|
@override
|
||||||
|
bool operator ==(Object other) => identical(this, other) || other is AlarmModeDTO &&
|
||||||
|
other.id == id &&
|
||||||
|
other.homeId == homeId &&
|
||||||
|
other.name == name &&
|
||||||
|
other.type == type &&
|
||||||
|
other.activated == activated &&
|
||||||
|
other.isDefault == isDefault &&
|
||||||
|
other.notification == notification &&
|
||||||
|
other.createdDate == createdDate &&
|
||||||
|
other.updatedDate == updatedDate;
|
||||||
|
|
||||||
|
@override
|
||||||
|
int get hashCode =>
|
||||||
|
(id == null ? 0 : id.hashCode) +
|
||||||
|
(homeId == null ? 0 : homeId.hashCode) +
|
||||||
|
(name == null ? 0 : name.hashCode) +
|
||||||
|
(type == null ? 0 : type.hashCode) +
|
||||||
|
(activated == null ? 0 : activated.hashCode) +
|
||||||
|
(isDefault == null ? 0 : isDefault.hashCode) +
|
||||||
|
(notification == null ? 0 : notification.hashCode) +
|
||||||
|
(createdDate == null ? 0 : createdDate.hashCode) +
|
||||||
|
(updatedDate == null ? 0 : updatedDate.hashCode);
|
||||||
|
|
||||||
|
@override
|
||||||
|
String toString() => 'AlarmModeDTO[id=$id, homeId=$homeId, name=$name, type=$type, activated=$activated, isDefault=$isDefault, notification=$notification, createdDate=$createdDate, updatedDate=$updatedDate]';
|
||||||
|
|
||||||
|
Map<String, dynamic> toJson() {
|
||||||
|
final json = <String, dynamic>{};
|
||||||
|
if (id != null) {
|
||||||
|
json[r'id'] = id;
|
||||||
|
}
|
||||||
|
if (homeId != null) {
|
||||||
|
json[r'homeId'] = homeId;
|
||||||
|
}
|
||||||
|
if (name != null) {
|
||||||
|
json[r'name'] = name;
|
||||||
|
}
|
||||||
|
if (type != null) {
|
||||||
|
json[r'type'] = type;
|
||||||
|
}
|
||||||
|
if (activated != null) {
|
||||||
|
json[r'activated'] = activated;
|
||||||
|
}
|
||||||
|
if (isDefault != null) {
|
||||||
|
json[r'isDefault'] = isDefault;
|
||||||
|
}
|
||||||
|
if (notification != null) {
|
||||||
|
json[r'notification'] = notification;
|
||||||
|
}
|
||||||
|
if (createdDate != null) {
|
||||||
|
json[r'createdDate'] = createdDate.toUtc().toIso8601String();
|
||||||
|
}
|
||||||
|
if (updatedDate != null) {
|
||||||
|
json[r'updatedDate'] = updatedDate.toUtc().toIso8601String();
|
||||||
|
}
|
||||||
|
return json;
|
||||||
|
}
|
||||||
|
|
||||||
|
/// Returns a new [AlarmModeDTO] instance and imports its values from
|
||||||
|
/// [json] if it's non-null, null if [json] is null.
|
||||||
|
static AlarmModeDTO fromJson(Map<String, dynamic> json) => json == null
|
||||||
|
? null
|
||||||
|
: AlarmModeDTO(
|
||||||
|
id: json[r'id'],
|
||||||
|
homeId: json[r'homeId'],
|
||||||
|
name: json[r'name'],
|
||||||
|
type: AlarmType.fromJson(json[r'type']),
|
||||||
|
activated: json[r'activated'],
|
||||||
|
isDefault: json[r'isDefault'],
|
||||||
|
notification: json[r'notification'],
|
||||||
|
createdDate: json[r'createdDate'] == null
|
||||||
|
? null
|
||||||
|
: DateTime.parse(json[r'createdDate']),
|
||||||
|
updatedDate: json[r'updatedDate'] == null
|
||||||
|
? null
|
||||||
|
: DateTime.parse(json[r'updatedDate']),
|
||||||
|
);
|
||||||
|
|
||||||
|
static List<AlarmModeDTO> listFromJson(List<dynamic> json, {bool emptyIsNull, bool growable,}) =>
|
||||||
|
json == null || json.isEmpty
|
||||||
|
? true == emptyIsNull ? null : <AlarmModeDTO>[]
|
||||||
|
: json.map((v) => AlarmModeDTO.fromJson(v)).toList(growable: true == growable);
|
||||||
|
|
||||||
|
static Map<String, AlarmModeDTO> mapFromJson(Map<String, dynamic> json) {
|
||||||
|
final map = <String, AlarmModeDTO>{};
|
||||||
|
if (json != null && json.isNotEmpty) {
|
||||||
|
json.forEach((String key, dynamic v) => map[key] = AlarmModeDTO.fromJson(v));
|
||||||
|
}
|
||||||
|
return map;
|
||||||
|
}
|
||||||
|
|
||||||
|
// maps a json object with a list of AlarmModeDTO-objects as value to a dart map
|
||||||
|
static Map<String, List<AlarmModeDTO>> mapListFromJson(Map<String, dynamic> json, {bool emptyIsNull, bool growable,}) {
|
||||||
|
final map = <String, List<AlarmModeDTO>>{};
|
||||||
|
if (json != null && json.isNotEmpty) {
|
||||||
|
json.forEach((String key, dynamic v) {
|
||||||
|
map[key] = AlarmModeDTO.listFromJson(v, emptyIsNull: emptyIsNull, growable: growable);
|
||||||
|
});
|
||||||
|
}
|
||||||
|
return map;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
89
mycore_api/lib/model/alarm_triggered.dart
Normal file
89
mycore_api/lib/model/alarm_triggered.dart
Normal file
@ -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 AlarmTriggered {
|
||||||
|
/// Returns a new [AlarmTriggered] instance.
|
||||||
|
AlarmTriggered({
|
||||||
|
this.alarmModeId,
|
||||||
|
this.alarmModeName,
|
||||||
|
this.type,
|
||||||
|
});
|
||||||
|
|
||||||
|
String alarmModeId;
|
||||||
|
|
||||||
|
String alarmModeName;
|
||||||
|
|
||||||
|
AlarmType type;
|
||||||
|
|
||||||
|
@override
|
||||||
|
bool operator ==(Object other) => identical(this, other) || other is AlarmTriggered &&
|
||||||
|
other.alarmModeId == alarmModeId &&
|
||||||
|
other.alarmModeName == alarmModeName &&
|
||||||
|
other.type == type;
|
||||||
|
|
||||||
|
@override
|
||||||
|
int get hashCode =>
|
||||||
|
(alarmModeId == null ? 0 : alarmModeId.hashCode) +
|
||||||
|
(alarmModeName == null ? 0 : alarmModeName.hashCode) +
|
||||||
|
(type == null ? 0 : type.hashCode);
|
||||||
|
|
||||||
|
@override
|
||||||
|
String toString() => 'AlarmTriggered[alarmModeId=$alarmModeId, alarmModeName=$alarmModeName, type=$type]';
|
||||||
|
|
||||||
|
Map<String, dynamic> toJson() {
|
||||||
|
final json = <String, dynamic>{};
|
||||||
|
if (alarmModeId != null) {
|
||||||
|
json[r'alarmModeId'] = alarmModeId;
|
||||||
|
}
|
||||||
|
if (alarmModeName != null) {
|
||||||
|
json[r'alarmModeName'] = alarmModeName;
|
||||||
|
}
|
||||||
|
if (type != null) {
|
||||||
|
json[r'type'] = type;
|
||||||
|
}
|
||||||
|
return json;
|
||||||
|
}
|
||||||
|
|
||||||
|
/// Returns a new [AlarmTriggered] instance and imports its values from
|
||||||
|
/// [json] if it's non-null, null if [json] is null.
|
||||||
|
static AlarmTriggered fromJson(Map<String, dynamic> json) => json == null
|
||||||
|
? null
|
||||||
|
: AlarmTriggered(
|
||||||
|
alarmModeId: json[r'alarmModeId'],
|
||||||
|
alarmModeName: json[r'alarmModeName'],
|
||||||
|
type: AlarmType.fromJson(json[r'type']),
|
||||||
|
);
|
||||||
|
|
||||||
|
static List<AlarmTriggered> listFromJson(List<dynamic> json, {bool emptyIsNull, bool growable,}) =>
|
||||||
|
json == null || json.isEmpty
|
||||||
|
? true == emptyIsNull ? null : <AlarmTriggered>[]
|
||||||
|
: json.map((v) => AlarmTriggered.fromJson(v)).toList(growable: true == growable);
|
||||||
|
|
||||||
|
static Map<String, AlarmTriggered> mapFromJson(Map<String, dynamic> json) {
|
||||||
|
final map = <String, AlarmTriggered>{};
|
||||||
|
if (json != null && json.isNotEmpty) {
|
||||||
|
json.forEach((String key, dynamic v) => map[key] = AlarmTriggered.fromJson(v));
|
||||||
|
}
|
||||||
|
return map;
|
||||||
|
}
|
||||||
|
|
||||||
|
// maps a json object with a list of AlarmTriggered-objects as value to a dart map
|
||||||
|
static Map<String, List<AlarmTriggered>> mapListFromJson(Map<String, dynamic> json, {bool emptyIsNull, bool growable,}) {
|
||||||
|
final map = <String, List<AlarmTriggered>>{};
|
||||||
|
if (json != null && json.isNotEmpty) {
|
||||||
|
json.forEach((String key, dynamic v) {
|
||||||
|
map[key] = AlarmTriggered.listFromJson(v, emptyIsNull: emptyIsNull, growable: growable);
|
||||||
|
});
|
||||||
|
}
|
||||||
|
return map;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
88
mycore_api/lib/model/alarm_type.dart
Normal file
88
mycore_api/lib/model/alarm_type.dart
Normal file
@ -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 AlarmType {
|
||||||
|
/// Instantiate a new enum with the provided [value].
|
||||||
|
const AlarmType._(this.value);
|
||||||
|
|
||||||
|
/// The underlying value of this enum member.
|
||||||
|
final String value;
|
||||||
|
|
||||||
|
@override
|
||||||
|
String toString() => value;
|
||||||
|
|
||||||
|
String toJson() => value;
|
||||||
|
|
||||||
|
static const home = AlarmType._(r'Home');
|
||||||
|
static const absent = AlarmType._(r'Absent');
|
||||||
|
static const geolocalized = AlarmType._(r'Geolocalized');
|
||||||
|
static const programmed = AlarmType._(r'Programmed');
|
||||||
|
static const desarmed = AlarmType._(r'Desarmed');
|
||||||
|
static const custom = AlarmType._(r'Custom');
|
||||||
|
|
||||||
|
/// List of all possible values in this [enum][AlarmType].
|
||||||
|
static const values = <AlarmType>[
|
||||||
|
home,
|
||||||
|
absent,
|
||||||
|
geolocalized,
|
||||||
|
programmed,
|
||||||
|
desarmed,
|
||||||
|
custom,
|
||||||
|
];
|
||||||
|
|
||||||
|
static AlarmType fromJson(dynamic value) =>
|
||||||
|
AlarmTypeTypeTransformer().decode(value);
|
||||||
|
|
||||||
|
static List<AlarmType> listFromJson(List<dynamic> json, {bool emptyIsNull, bool growable,}) =>
|
||||||
|
json == null || json.isEmpty
|
||||||
|
? true == emptyIsNull ? null : <AlarmType>[]
|
||||||
|
: json
|
||||||
|
.map((value) => AlarmType.fromJson(value))
|
||||||
|
.toList(growable: true == growable);
|
||||||
|
}
|
||||||
|
|
||||||
|
/// Transformation class that can [encode] an instance of [AlarmType] to String,
|
||||||
|
/// and [decode] dynamic data back to [AlarmType].
|
||||||
|
class AlarmTypeTypeTransformer {
|
||||||
|
const AlarmTypeTypeTransformer._();
|
||||||
|
|
||||||
|
factory AlarmTypeTypeTransformer() => _instance ??= AlarmTypeTypeTransformer._();
|
||||||
|
|
||||||
|
String encode(AlarmType data) => data.value;
|
||||||
|
|
||||||
|
/// Decodes a [dynamic value][data] to a AlarmType.
|
||||||
|
///
|
||||||
|
/// 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.
|
||||||
|
AlarmType decode(dynamic data, {bool allowNull}) {
|
||||||
|
switch (data) {
|
||||||
|
case r'Home': return AlarmType.home;
|
||||||
|
case r'Absent': return AlarmType.absent;
|
||||||
|
case r'Geolocalized': return AlarmType.geolocalized;
|
||||||
|
case r'Programmed': return AlarmType.programmed;
|
||||||
|
case r'Desarmed': return AlarmType.desarmed;
|
||||||
|
case r'Custom': return AlarmType.custom;
|
||||||
|
default:
|
||||||
|
if (allowNull == false) {
|
||||||
|
throw ArgumentError('Unknown enum value to decode: $data');
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
|
||||||
|
/// Singleton [AlarmTypeTypeTransformer] instance.
|
||||||
|
static AlarmTypeTypeTransformer _instance;
|
||||||
|
}
|
||||||
@ -15,7 +15,7 @@ class AutomationDetailDTO {
|
|||||||
this.id,
|
this.id,
|
||||||
this.name,
|
this.name,
|
||||||
this.active,
|
this.active,
|
||||||
this.userId,
|
this.homeId,
|
||||||
this.createdDate,
|
this.createdDate,
|
||||||
this.updatedDate,
|
this.updatedDate,
|
||||||
this.triggers,
|
this.triggers,
|
||||||
@ -30,7 +30,7 @@ class AutomationDetailDTO {
|
|||||||
|
|
||||||
bool active;
|
bool active;
|
||||||
|
|
||||||
String userId;
|
String homeId;
|
||||||
|
|
||||||
DateTime createdDate;
|
DateTime createdDate;
|
||||||
|
|
||||||
@ -49,7 +49,7 @@ class AutomationDetailDTO {
|
|||||||
other.id == id &&
|
other.id == id &&
|
||||||
other.name == name &&
|
other.name == name &&
|
||||||
other.active == active &&
|
other.active == active &&
|
||||||
other.userId == userId &&
|
other.homeId == homeId &&
|
||||||
other.createdDate == createdDate &&
|
other.createdDate == createdDate &&
|
||||||
other.updatedDate == updatedDate &&
|
other.updatedDate == updatedDate &&
|
||||||
other.triggers == triggers &&
|
other.triggers == triggers &&
|
||||||
@ -62,7 +62,7 @@ class AutomationDetailDTO {
|
|||||||
(id == null ? 0 : id.hashCode) +
|
(id == null ? 0 : id.hashCode) +
|
||||||
(name == null ? 0 : name.hashCode) +
|
(name == null ? 0 : name.hashCode) +
|
||||||
(active == null ? 0 : active.hashCode) +
|
(active == null ? 0 : active.hashCode) +
|
||||||
(userId == null ? 0 : userId.hashCode) +
|
(homeId == null ? 0 : homeId.hashCode) +
|
||||||
(createdDate == null ? 0 : createdDate.hashCode) +
|
(createdDate == null ? 0 : createdDate.hashCode) +
|
||||||
(updatedDate == null ? 0 : updatedDate.hashCode) +
|
(updatedDate == null ? 0 : updatedDate.hashCode) +
|
||||||
(triggers == null ? 0 : triggers.hashCode) +
|
(triggers == null ? 0 : triggers.hashCode) +
|
||||||
@ -71,7 +71,7 @@ class AutomationDetailDTO {
|
|||||||
(devicesIds == null ? 0 : devicesIds.hashCode);
|
(devicesIds == null ? 0 : devicesIds.hashCode);
|
||||||
|
|
||||||
@override
|
@override
|
||||||
String toString() => 'AutomationDetailDTO[id=$id, name=$name, active=$active, userId=$userId, createdDate=$createdDate, updatedDate=$updatedDate, triggers=$triggers, conditions=$conditions, actions=$actions, devicesIds=$devicesIds]';
|
String toString() => 'AutomationDetailDTO[id=$id, name=$name, active=$active, homeId=$homeId, createdDate=$createdDate, updatedDate=$updatedDate, triggers=$triggers, conditions=$conditions, actions=$actions, devicesIds=$devicesIds]';
|
||||||
|
|
||||||
Map<String, dynamic> toJson() {
|
Map<String, dynamic> toJson() {
|
||||||
final json = <String, dynamic>{};
|
final json = <String, dynamic>{};
|
||||||
@ -84,8 +84,8 @@ class AutomationDetailDTO {
|
|||||||
if (active != null) {
|
if (active != null) {
|
||||||
json[r'active'] = active;
|
json[r'active'] = active;
|
||||||
}
|
}
|
||||||
if (userId != null) {
|
if (homeId != null) {
|
||||||
json[r'userId'] = userId;
|
json[r'homeId'] = homeId;
|
||||||
}
|
}
|
||||||
if (createdDate != null) {
|
if (createdDate != null) {
|
||||||
json[r'createdDate'] = createdDate.toUtc().toIso8601String();
|
json[r'createdDate'] = createdDate.toUtc().toIso8601String();
|
||||||
@ -116,7 +116,7 @@ class AutomationDetailDTO {
|
|||||||
id: json[r'id'],
|
id: json[r'id'],
|
||||||
name: json[r'name'],
|
name: json[r'name'],
|
||||||
active: json[r'active'],
|
active: json[r'active'],
|
||||||
userId: json[r'userId'],
|
homeId: json[r'homeId'],
|
||||||
createdDate: json[r'createdDate'] == null
|
createdDate: json[r'createdDate'] == null
|
||||||
? null
|
? null
|
||||||
: DateTime.parse(json[r'createdDate']),
|
: DateTime.parse(json[r'createdDate']),
|
||||||
|
|||||||
Some files were not shown because too many files have changed in this diff Show More
Loading…
x
Reference in New Issue
Block a user