15 KiB
mycoreapi.api.DeviceApi
Load the API package
import 'package:mycoreapi/api.dart';
All URIs are relative to http://192.168.31.140
| Method | HTTP request | Description |
|---|---|---|
| deviceCreate | POST /api/device | Create a device |
| deviceCreateDevicesFromProvider | POST /api/device/{userId}/fromProvider/{providerId} | Create devices from provider |
| deviceDelete | DELETE /api/device/{deviceId} | Delete a device |
| deviceDeleteAllForUser | DELETE /api/device/user/{userId} | Delete all device for a specified |
| deviceDeleteDevicesFromProvider | DELETE /api/device/{userId}/fromProvider/{providerId} | Delete devices from provider |
| deviceGetAll | GET /api/device/{userId} | Get all devices summary |
| deviceGetDetail | GET /api/device/detail/{deviceId} | Get a specific device info |
| deviceGetDevicesByType | GET /api/device/{userId}/type/{type} | Get list of devices from a type |
| deviceGetDevicesFromProvider | GET /api/device/{userId}/fromProvider/{providerId} | Get devices from provider |
| deviceGetDevicesFromZigbee2Mqtt | GET /api/device/zigbee2Mqtt/{userId} | Get all zigbee2Mqtt devices |
| deviceUpdate | PUT /api/device/{deviceId} | Update a device |
deviceCreate
DeviceDetailDTO deviceCreate(deviceDetailDTO)
Create a device
Example
import 'package:mycoreapi/api.dart';
// TODO Configure OAuth2 access token for authorization: bearer
//defaultApiClient.getAuthentication<OAuth>('bearer').accessToken = 'YOUR_ACCESS_TOKEN';
final api_instance = DeviceApi();
final deviceDetailDTO = DeviceDetailDTO(); // DeviceDetailDTO | Device to create
try {
final result = api_instance.deviceCreate(deviceDetailDTO);
print(result);
} catch (e) {
print('Exception when calling DeviceApi->deviceCreate: $e\n');
}
Parameters
| Name | Type | Description | Notes |
|---|---|---|---|
| deviceDetailDTO | DeviceDetailDTO | Device to create |
Return type
Authorization
HTTP request headers
- Content-Type: application/json
- Accept: application/json
[Back to top] [Back to API list] [Back to Model list] [Back to README]
deviceCreateDevicesFromProvider
List deviceCreateDevicesFromProvider(userId, providerId)
Create devices from provider
Example
import 'package:mycoreapi/api.dart';
// TODO Configure OAuth2 access token for authorization: bearer
//defaultApiClient.getAuthentication<OAuth>('bearer').accessToken = 'YOUR_ACCESS_TOKEN';
final api_instance = DeviceApi();
final userId = userId_example; // String | User Id
final providerId = providerId_example; // String | Id of Provider
try {
final result = api_instance.deviceCreateDevicesFromProvider(userId, providerId);
print(result);
} catch (e) {
print('Exception when calling DeviceApi->deviceCreateDevicesFromProvider: $e\n');
}
Parameters
| Name | Type | Description | Notes |
|---|---|---|---|
| userId | String | User Id | |
| providerId | String | Id of Provider |
Return type
Authorization
HTTP request headers
- Content-Type: Not defined
- Accept: application/json
[Back to top] [Back to API list] [Back to Model list] [Back to README]
deviceDelete
MultipartFile deviceDelete(deviceId)
Delete a device
Example
import 'package:mycoreapi/api.dart';
// TODO Configure OAuth2 access token for authorization: bearer
//defaultApiClient.getAuthentication<OAuth>('bearer').accessToken = 'YOUR_ACCESS_TOKEN';
final api_instance = DeviceApi();
final deviceId = deviceId_example; // String | Id of device to delete
try {
final result = api_instance.deviceDelete(deviceId);
print(result);
} catch (e) {
print('Exception when calling DeviceApi->deviceDelete: $e\n');
}
Parameters
| Name | Type | Description | Notes |
|---|---|---|---|
| deviceId | String | Id of device to delete |
Return type
Authorization
HTTP request headers
- Content-Type: Not defined
- Accept: application/octet-stream
[Back to top] [Back to API list] [Back to Model list] [Back to README]
deviceDeleteAllForUser
MultipartFile deviceDeleteAllForUser(userId)
Delete all device for a specified
Example
import 'package:mycoreapi/api.dart';
// TODO Configure OAuth2 access token for authorization: bearer
//defaultApiClient.getAuthentication<OAuth>('bearer').accessToken = 'YOUR_ACCESS_TOKEN';
final api_instance = DeviceApi();
final userId = userId_example; // String | Id of user
try {
final result = api_instance.deviceDeleteAllForUser(userId);
print(result);
} catch (e) {
print('Exception when calling DeviceApi->deviceDeleteAllForUser: $e\n');
}
Parameters
| Name | Type | Description | Notes |
|---|---|---|---|
| userId | String | Id of user |
Return type
Authorization
HTTP request headers
- Content-Type: Not defined
- Accept: application/octet-stream
[Back to top] [Back to API list] [Back to Model list] [Back to README]
deviceDeleteDevicesFromProvider
MultipartFile deviceDeleteDevicesFromProvider(userId, providerId)
Delete devices from provider
Example
import 'package:mycoreapi/api.dart';
// TODO Configure OAuth2 access token for authorization: bearer
//defaultApiClient.getAuthentication<OAuth>('bearer').accessToken = 'YOUR_ACCESS_TOKEN';
final api_instance = DeviceApi();
final userId = userId_example; // String | User Id
final providerId = providerId_example; // String | Id of Provider
try {
final result = api_instance.deviceDeleteDevicesFromProvider(userId, providerId);
print(result);
} catch (e) {
print('Exception when calling DeviceApi->deviceDeleteDevicesFromProvider: $e\n');
}
Parameters
| Name | Type | Description | Notes |
|---|---|---|---|
| userId | String | User Id | |
| providerId | String | Id of Provider |
Return type
Authorization
HTTP request headers
- Content-Type: Not defined
- Accept: application/octet-stream
[Back to top] [Back to API list] [Back to Model list] [Back to README]
deviceGetAll
List deviceGetAll(userId)
Get all devices summary
Example
import 'package:mycoreapi/api.dart';
// TODO Configure OAuth2 access token for authorization: bearer
//defaultApiClient.getAuthentication<OAuth>('bearer').accessToken = 'YOUR_ACCESS_TOKEN';
final api_instance = DeviceApi();
final userId = userId_example; // String | Id of user
try {
final result = api_instance.deviceGetAll(userId);
print(result);
} catch (e) {
print('Exception when calling DeviceApi->deviceGetAll: $e\n');
}
Parameters
| Name | Type | Description | Notes |
|---|---|---|---|
| userId | String | Id of user |
Return type
Authorization
HTTP request headers
- Content-Type: Not defined
- Accept: application/json
[Back to top] [Back to API list] [Back to Model list] [Back to README]
deviceGetDetail
DeviceDetailDTO deviceGetDetail(deviceId)
Get a specific device info
Example
import 'package:mycoreapi/api.dart';
// TODO Configure OAuth2 access token for authorization: bearer
//defaultApiClient.getAuthentication<OAuth>('bearer').accessToken = 'YOUR_ACCESS_TOKEN';
final api_instance = DeviceApi();
final deviceId = deviceId_example; // String | id of device
try {
final result = api_instance.deviceGetDetail(deviceId);
print(result);
} catch (e) {
print('Exception when calling DeviceApi->deviceGetDetail: $e\n');
}
Parameters
| Name | Type | Description | Notes |
|---|---|---|---|
| deviceId | String | id of device |
Return type
Authorization
HTTP request headers
- Content-Type: Not defined
- Accept: application/json
[Back to top] [Back to API list] [Back to Model list] [Back to README]
deviceGetDevicesByType
List deviceGetDevicesByType(userId, type)
Get list of devices from a type
Example
import 'package:mycoreapi/api.dart';
// TODO Configure OAuth2 access token for authorization: bearer
//defaultApiClient.getAuthentication<OAuth>('bearer').accessToken = 'YOUR_ACCESS_TOKEN';
final api_instance = DeviceApi();
final userId = userId_example; // String | user Id
final type = ; // DeviceType | device type
try {
final result = api_instance.deviceGetDevicesByType(userId, type);
print(result);
} catch (e) {
print('Exception when calling DeviceApi->deviceGetDevicesByType: $e\n');
}
Parameters
| Name | Type | Description | Notes |
|---|---|---|---|
| userId | String | user Id | |
| type | DeviceType | device type |
Return type
Authorization
HTTP request headers
- Content-Type: Not defined
- Accept: application/json
[Back to top] [Back to API list] [Back to Model list] [Back to README]
deviceGetDevicesFromProvider
List deviceGetDevicesFromProvider(userId, providerId)
Get devices from provider
Example
import 'package:mycoreapi/api.dart';
// TODO Configure OAuth2 access token for authorization: bearer
//defaultApiClient.getAuthentication<OAuth>('bearer').accessToken = 'YOUR_ACCESS_TOKEN';
final api_instance = DeviceApi();
final userId = userId_example; // String | User Id
final providerId = providerId_example; // String | Id of Provider
try {
final result = api_instance.deviceGetDevicesFromProvider(userId, providerId);
print(result);
} catch (e) {
print('Exception when calling DeviceApi->deviceGetDevicesFromProvider: $e\n');
}
Parameters
| Name | Type | Description | Notes |
|---|---|---|---|
| userId | String | User Id | |
| providerId | String | Id of Provider |
Return type
Authorization
HTTP request headers
- Content-Type: Not defined
- Accept: application/json
[Back to top] [Back to API list] [Back to Model list] [Back to README]
deviceGetDevicesFromZigbee2Mqtt
List deviceGetDevicesFromZigbee2Mqtt(userId)
Get all zigbee2Mqtt devices
Example
import 'package:mycoreapi/api.dart';
// TODO Configure OAuth2 access token for authorization: bearer
//defaultApiClient.getAuthentication<OAuth>('bearer').accessToken = 'YOUR_ACCESS_TOKEN';
final api_instance = DeviceApi();
final userId = userId_example; // String | User Id
try {
final result = api_instance.deviceGetDevicesFromZigbee2Mqtt(userId);
print(result);
} catch (e) {
print('Exception when calling DeviceApi->deviceGetDevicesFromZigbee2Mqtt: $e\n');
}
Parameters
| Name | Type | Description | Notes |
|---|---|---|---|
| userId | String | User Id |
Return type
Authorization
HTTP request headers
- Content-Type: Not defined
- Accept: application/json
[Back to top] [Back to API list] [Back to Model list] [Back to README]
deviceUpdate
DeviceDetailDTO deviceUpdate(deviceId, deviceDetailDTO)
Update a device
Example
import 'package:mycoreapi/api.dart';
// TODO Configure OAuth2 access token for authorization: bearer
//defaultApiClient.getAuthentication<OAuth>('bearer').accessToken = 'YOUR_ACCESS_TOKEN';
final api_instance = DeviceApi();
final deviceId = deviceId_example; // String |
final deviceDetailDTO = DeviceDetailDTO(); // DeviceDetailDTO | Device to update
try {
final result = api_instance.deviceUpdate(deviceId, deviceDetailDTO);
print(result);
} catch (e) {
print('Exception when calling DeviceApi->deviceUpdate: $e\n');
}
Parameters
| Name | Type | Description | Notes |
|---|---|---|---|
| deviceId | String | ||
| deviceDetailDTO | DeviceDetailDTO | Device to update |
Return type
Authorization
HTTP request headers
- Content-Type: application/json
- Accept: application/json
[Back to top] [Back to API list] [Back to Model list] [Back to README]