13 KiB
mycore_api.api.GroupApi
Load the API package
import 'package:mycore_api/api.dart';
All URIs are relative to http://localhost:25049
| Method | HTTP request | Description |
|---|---|---|
| groupCreate | POST /api/group | Create a group |
| groupCreateDevicesFromZigbee2Mqtt | POST /api/group/{homeId}/fromZigbee | Create groups from provider |
| groupDelete | DELETE /api/group/{groupId}/device/{deviceId} | Delete device from a group |
| groupDelete2 | DELETE /api/group/{groupId} | Delete a group |
| groupDeleteAllForHome | DELETE /api/group/home/{homeId} | Delete all group for a specified home |
| groupGetAll | GET /api/group/{homeId} | Get all groups for the specified home |
| groupGetDetail | GET /api/group/detail/{groupId} | Get detail info of a specified group |
| groupGetGroupsByType | GET /api/group/{homeId}/type/{type} | Get list of group from a type |
| groupGetGroupsFromZigbee2Mqtt | GET /api/group/zigbee2Mqtt/{homeId} | Get all zigbee2Mqtt groups |
| groupUpdate | PUT /api/group | Update a group |
groupCreate
GroupDetailDTO groupCreate(groupCreateOrUpdateDetailDTO)
Create a group
Example
import 'package:mycore_api/api.dart';
// TODO Configure OAuth2 access token for authorization: bearer
//defaultApiClient.getAuthentication<OAuth>('bearer').accessToken = 'YOUR_ACCESS_TOKEN';
final api_instance = GroupApi();
final groupCreateOrUpdateDetailDTO = GroupCreateOrUpdateDetailDTO(); // GroupCreateOrUpdateDetailDTO | Group to create
try {
final result = api_instance.groupCreate(groupCreateOrUpdateDetailDTO);
print(result);
} catch (e) {
print('Exception when calling GroupApi->groupCreate: $e\n');
}
Parameters
| Name | Type | Description | Notes |
|---|---|---|---|
| groupCreateOrUpdateDetailDTO | GroupCreateOrUpdateDetailDTO | Group 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]
groupCreateDevicesFromZigbee2Mqtt
List groupCreateDevicesFromZigbee2Mqtt(homeId)
Create groups from provider
Example
import 'package:mycore_api/api.dart';
// TODO Configure OAuth2 access token for authorization: bearer
//defaultApiClient.getAuthentication<OAuth>('bearer').accessToken = 'YOUR_ACCESS_TOKEN';
final api_instance = GroupApi();
final homeId = homeId_example; // String | Home Id
try {
final result = api_instance.groupCreateDevicesFromZigbee2Mqtt(homeId);
print(result);
} catch (e) {
print('Exception when calling GroupApi->groupCreateDevicesFromZigbee2Mqtt: $e\n');
}
Parameters
| Name | Type | Description | Notes |
|---|---|---|---|
| homeId | String | Home 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]
groupDelete
String groupDelete(deviceId, groupId)
Delete device from a group
Example
import 'package:mycore_api/api.dart';
// TODO Configure OAuth2 access token for authorization: bearer
//defaultApiClient.getAuthentication<OAuth>('bearer').accessToken = 'YOUR_ACCESS_TOKEN';
final api_instance = GroupApi();
final deviceId = deviceId_example; // String | Id of device to delete from the group
final groupId = groupId_example; // String | Id of group
try {
final result = api_instance.groupDelete(deviceId, groupId);
print(result);
} catch (e) {
print('Exception when calling GroupApi->groupDelete: $e\n');
}
Parameters
| Name | Type | Description | Notes |
|---|---|---|---|
| deviceId | String | Id of device to delete from the group | |
| groupId | String | Id of group |
Return type
String
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]
groupDelete2
String groupDelete2(groupId)
Delete a group
Example
import 'package:mycore_api/api.dart';
// TODO Configure OAuth2 access token for authorization: bearer
//defaultApiClient.getAuthentication<OAuth>('bearer').accessToken = 'YOUR_ACCESS_TOKEN';
final api_instance = GroupApi();
final groupId = groupId_example; // String | Id of group
try {
final result = api_instance.groupDelete2(groupId);
print(result);
} catch (e) {
print('Exception when calling GroupApi->groupDelete2: $e\n');
}
Parameters
| Name | Type | Description | Notes |
|---|---|---|---|
| groupId | String | Id of group |
Return type
String
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]
groupDeleteAllForHome
String groupDeleteAllForHome(homeId)
Delete all group for a specified home
Example
import 'package:mycore_api/api.dart';
// TODO Configure OAuth2 access token for authorization: bearer
//defaultApiClient.getAuthentication<OAuth>('bearer').accessToken = 'YOUR_ACCESS_TOKEN';
final api_instance = GroupApi();
final homeId = homeId_example; // String | Home Id
try {
final result = api_instance.groupDeleteAllForHome(homeId);
print(result);
} catch (e) {
print('Exception when calling GroupApi->groupDeleteAllForHome: $e\n');
}
Parameters
| Name | Type | Description | Notes |
|---|---|---|---|
| homeId | String | Home Id |
Return type
String
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]
groupGetAll
List groupGetAll(homeId)
Get all groups for the specified home
Example
import 'package:mycore_api/api.dart';
// TODO Configure OAuth2 access token for authorization: bearer
//defaultApiClient.getAuthentication<OAuth>('bearer').accessToken = 'YOUR_ACCESS_TOKEN';
final api_instance = GroupApi();
final homeId = homeId_example; // String | Home Id
try {
final result = api_instance.groupGetAll(homeId);
print(result);
} catch (e) {
print('Exception when calling GroupApi->groupGetAll: $e\n');
}
Parameters
| Name | Type | Description | Notes |
|---|---|---|---|
| homeId | String | Home 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]
groupGetDetail
GroupDetailDTO groupGetDetail(groupId)
Get detail info of a specified group
Example
import 'package:mycore_api/api.dart';
// TODO Configure OAuth2 access token for authorization: bearer
//defaultApiClient.getAuthentication<OAuth>('bearer').accessToken = 'YOUR_ACCESS_TOKEN';
final api_instance = GroupApi();
final groupId = groupId_example; // String | groupid
try {
final result = api_instance.groupGetDetail(groupId);
print(result);
} catch (e) {
print('Exception when calling GroupApi->groupGetDetail: $e\n');
}
Parameters
| Name | Type | Description | Notes |
|---|---|---|---|
| groupId | String | groupid |
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]
groupGetGroupsByType
List groupGetGroupsByType(homeId, type)
Get list of group from a type
Example
import 'package:mycore_api/api.dart';
// TODO Configure OAuth2 access token for authorization: bearer
//defaultApiClient.getAuthentication<OAuth>('bearer').accessToken = 'YOUR_ACCESS_TOKEN';
final api_instance = GroupApi();
final homeId = homeId_example; // String | home Id
final type = type_example; // String | group type
try {
final result = api_instance.groupGetGroupsByType(homeId, type);
print(result);
} catch (e) {
print('Exception when calling GroupApi->groupGetGroupsByType: $e\n');
}
Parameters
| Name | Type | Description | Notes |
|---|---|---|---|
| homeId | String | home Id | |
| type | String | group 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]
groupGetGroupsFromZigbee2Mqtt
List groupGetGroupsFromZigbee2Mqtt(homeId)
Get all zigbee2Mqtt groups
Example
import 'package:mycore_api/api.dart';
// TODO Configure OAuth2 access token for authorization: bearer
//defaultApiClient.getAuthentication<OAuth>('bearer').accessToken = 'YOUR_ACCESS_TOKEN';
final api_instance = GroupApi();
final homeId = homeId_example; // String | Home Id
try {
final result = api_instance.groupGetGroupsFromZigbee2Mqtt(homeId);
print(result);
} catch (e) {
print('Exception when calling GroupApi->groupGetGroupsFromZigbee2Mqtt: $e\n');
}
Parameters
| Name | Type | Description | Notes |
|---|---|---|---|
| homeId | String | Home 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]
groupUpdate
GroupCreateOrUpdateDetailDTO groupUpdate(groupCreateOrUpdateDetailDTO)
Update a group
Example
import 'package:mycore_api/api.dart';
// TODO Configure OAuth2 access token for authorization: bearer
//defaultApiClient.getAuthentication<OAuth>('bearer').accessToken = 'YOUR_ACCESS_TOKEN';
final api_instance = GroupApi();
final groupCreateOrUpdateDetailDTO = GroupCreateOrUpdateDetailDTO(); // GroupCreateOrUpdateDetailDTO | group to update
try {
final result = api_instance.groupUpdate(groupCreateOrUpdateDetailDTO);
print(result);
} catch (e) {
print('Exception when calling GroupApi->groupUpdate: $e\n');
}
Parameters
| Name | Type | Description | Notes |
|---|---|---|---|
| groupCreateOrUpdateDetailDTO | GroupCreateOrUpdateDetailDTO | group 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]