mirror of
https://bitbucket.org/myhomie/mycorerepository.git
synced 2025-12-06 17:51:20 +00:00
458 lines
13 KiB
Markdown
458 lines
13 KiB
Markdown
# mycoreapi.api.GroupApi
|
|
|
|
## Load the API package
|
|
```dart
|
|
import 'package:mycoreapi/api.dart';
|
|
```
|
|
|
|
All URIs are relative to *http://localhost:25049*
|
|
|
|
Method | HTTP request | Description
|
|
------------- | ------------- | -------------
|
|
[**groupCreate**](GroupApi.md#groupcreate) | **POST** /api/group | Create a group
|
|
[**groupCreateDevicesFromZigbee2Mqtt**](GroupApi.md#groupcreatedevicesfromzigbee2mqtt) | **POST** /api/group/{userId}/fromZigbee | Create groups from provider
|
|
[**groupDelete**](GroupApi.md#groupdelete) | **DELETE** /api/group/{groupId}/device/{deviceId} | Delete device from a group
|
|
[**groupDelete2**](GroupApi.md#groupdelete2) | **DELETE** /api/group/{groupId} | Delete a group
|
|
[**groupDeleteAllForUser**](GroupApi.md#groupdeleteallforuser) | **DELETE** /api/group/user/{userId} | Delete all group for a specified
|
|
[**groupGetAll**](GroupApi.md#groupgetall) | **GET** /api/group/{userId} | Get all groups for the specified user
|
|
[**groupGetDetail**](GroupApi.md#groupgetdetail) | **GET** /api/group/detail/{groupId} | Get detail info of a specified group
|
|
[**groupGetGroupsByType**](GroupApi.md#groupgetgroupsbytype) | **GET** /api/group/{userId}/type/{type} | Get list of group from a type
|
|
[**groupGetGroupsFromZigbee2Mqtt**](GroupApi.md#groupgetgroupsfromzigbee2mqtt) | **GET** /api/group/zigbee2Mqtt/{userId} | Get all zigbee2Mqtt groups
|
|
[**groupUpdate**](GroupApi.md#groupupdate) | **PUT** /api/group | Update a group
|
|
|
|
|
|
# **groupCreate**
|
|
> GroupDetailDTO groupCreate(groupCreateOrUpdateDetailDTO)
|
|
|
|
Create a group
|
|
|
|
### Example
|
|
```dart
|
|
import 'package:mycoreapi/api.dart';
|
|
// TODO Configure OAuth2 access token for authorization: bearer
|
|
//defaultApiClient.getAuthentication<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**](GroupCreateOrUpdateDetailDTO.md)| Group to create |
|
|
|
|
### Return type
|
|
|
|
[**GroupDetailDTO**](GroupDetailDTO.md)
|
|
|
|
### Authorization
|
|
|
|
[bearer](../README.md#bearer)
|
|
|
|
### HTTP request headers
|
|
|
|
- **Content-Type**: application/json
|
|
- **Accept**: application/json
|
|
|
|
[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md)
|
|
|
|
# **groupCreateDevicesFromZigbee2Mqtt**
|
|
> List<GroupDetailDTO> groupCreateDevicesFromZigbee2Mqtt(userId)
|
|
|
|
Create groups from provider
|
|
|
|
### 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 = GroupApi();
|
|
final userId = userId_example; // String | User Id
|
|
|
|
try {
|
|
final result = api_instance.groupCreateDevicesFromZigbee2Mqtt(userId);
|
|
print(result);
|
|
} catch (e) {
|
|
print('Exception when calling GroupApi->groupCreateDevicesFromZigbee2Mqtt: $e\n');
|
|
}
|
|
```
|
|
|
|
### Parameters
|
|
|
|
Name | Type | Description | Notes
|
|
------------- | ------------- | ------------- | -------------
|
|
**userId** | **String**| User Id |
|
|
|
|
### Return type
|
|
|
|
[**List<GroupDetailDTO>**](GroupDetailDTO.md)
|
|
|
|
### Authorization
|
|
|
|
[bearer](../README.md#bearer)
|
|
|
|
### HTTP request headers
|
|
|
|
- **Content-Type**: Not defined
|
|
- **Accept**: application/json
|
|
|
|
[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md)
|
|
|
|
# **groupDelete**
|
|
> String groupDelete(deviceId, groupId)
|
|
|
|
Delete device from a group
|
|
|
|
### Example
|
|
```dart
|
|
import 'package:mycoreapi/api.dart';
|
|
// TODO Configure OAuth2 access token for authorization: bearer
|
|
//defaultApiClient.getAuthentication<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
|
|
|
|
[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)
|
|
|
|
# **groupDelete2**
|
|
> String groupDelete2(groupId)
|
|
|
|
Delete a group
|
|
|
|
### 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 = 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
|
|
|
|
[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)
|
|
|
|
# **groupDeleteAllForUser**
|
|
> String groupDeleteAllForUser(userId)
|
|
|
|
Delete all group for a specified
|
|
|
|
### Example
|
|
```dart
|
|
import 'package:mycoreapi/api.dart';
|
|
// TODO Configure OAuth2 access token for authorization: bearer
|
|
//defaultApiClient.getAuthentication<OAuth>('bearer').accessToken = 'YOUR_ACCESS_TOKEN';
|
|
|
|
final api_instance = GroupApi();
|
|
final userId = userId_example; // String | Id of user
|
|
|
|
try {
|
|
final result = api_instance.groupDeleteAllForUser(userId);
|
|
print(result);
|
|
} catch (e) {
|
|
print('Exception when calling GroupApi->groupDeleteAllForUser: $e\n');
|
|
}
|
|
```
|
|
|
|
### Parameters
|
|
|
|
Name | Type | Description | Notes
|
|
------------- | ------------- | ------------- | -------------
|
|
**userId** | **String**| Id of user |
|
|
|
|
### Return type
|
|
|
|
**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)
|
|
|
|
# **groupGetAll**
|
|
> List<GroupSummaryDTO> groupGetAll(userId)
|
|
|
|
Get all groups for the specified user
|
|
|
|
### Example
|
|
```dart
|
|
import 'package:mycoreapi/api.dart';
|
|
// TODO Configure OAuth2 access token for authorization: bearer
|
|
//defaultApiClient.getAuthentication<OAuth>('bearer').accessToken = 'YOUR_ACCESS_TOKEN';
|
|
|
|
final api_instance = GroupApi();
|
|
final userId = userId_example; // String | Id of user
|
|
|
|
try {
|
|
final result = api_instance.groupGetAll(userId);
|
|
print(result);
|
|
} catch (e) {
|
|
print('Exception when calling GroupApi->groupGetAll: $e\n');
|
|
}
|
|
```
|
|
|
|
### Parameters
|
|
|
|
Name | Type | Description | Notes
|
|
------------- | ------------- | ------------- | -------------
|
|
**userId** | **String**| Id of user |
|
|
|
|
### Return type
|
|
|
|
[**List<GroupSummaryDTO>**](GroupSummaryDTO.md)
|
|
|
|
### Authorization
|
|
|
|
[bearer](../README.md#bearer)
|
|
|
|
### HTTP request headers
|
|
|
|
- **Content-Type**: Not defined
|
|
- **Accept**: application/json
|
|
|
|
[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md)
|
|
|
|
# **groupGetDetail**
|
|
> GroupDetailDTO groupGetDetail(groupId)
|
|
|
|
Get detail info of a specified group
|
|
|
|
### 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 = 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
|
|
|
|
[**GroupDetailDTO**](GroupDetailDTO.md)
|
|
|
|
### Authorization
|
|
|
|
[bearer](../README.md#bearer)
|
|
|
|
### HTTP request headers
|
|
|
|
- **Content-Type**: Not defined
|
|
- **Accept**: application/json
|
|
|
|
[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md)
|
|
|
|
# **groupGetGroupsByType**
|
|
> List<GroupSummaryDTO> groupGetGroupsByType(userId, type)
|
|
|
|
Get list of group from a type
|
|
|
|
### Example
|
|
```dart
|
|
import 'package:mycoreapi/api.dart';
|
|
// TODO Configure OAuth2 access token for authorization: bearer
|
|
//defaultApiClient.getAuthentication<OAuth>('bearer').accessToken = 'YOUR_ACCESS_TOKEN';
|
|
|
|
final api_instance = GroupApi();
|
|
final userId = userId_example; // String | user Id
|
|
final type = type_example; // String | group type
|
|
|
|
try {
|
|
final result = api_instance.groupGetGroupsByType(userId, type);
|
|
print(result);
|
|
} catch (e) {
|
|
print('Exception when calling GroupApi->groupGetGroupsByType: $e\n');
|
|
}
|
|
```
|
|
|
|
### Parameters
|
|
|
|
Name | Type | Description | Notes
|
|
------------- | ------------- | ------------- | -------------
|
|
**userId** | **String**| user Id |
|
|
**type** | **String**| group type |
|
|
|
|
### Return type
|
|
|
|
[**List<GroupSummaryDTO>**](GroupSummaryDTO.md)
|
|
|
|
### Authorization
|
|
|
|
[bearer](../README.md#bearer)
|
|
|
|
### HTTP request headers
|
|
|
|
- **Content-Type**: Not defined
|
|
- **Accept**: application/json
|
|
|
|
[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md)
|
|
|
|
# **groupGetGroupsFromZigbee2Mqtt**
|
|
> List<GroupDetailDTO> groupGetGroupsFromZigbee2Mqtt(userId)
|
|
|
|
Get all zigbee2Mqtt groups
|
|
|
|
### 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 = GroupApi();
|
|
final userId = userId_example; // String | User Id
|
|
|
|
try {
|
|
final result = api_instance.groupGetGroupsFromZigbee2Mqtt(userId);
|
|
print(result);
|
|
} catch (e) {
|
|
print('Exception when calling GroupApi->groupGetGroupsFromZigbee2Mqtt: $e\n');
|
|
}
|
|
```
|
|
|
|
### Parameters
|
|
|
|
Name | Type | Description | Notes
|
|
------------- | ------------- | ------------- | -------------
|
|
**userId** | **String**| User Id |
|
|
|
|
### Return type
|
|
|
|
[**List<GroupDetailDTO>**](GroupDetailDTO.md)
|
|
|
|
### Authorization
|
|
|
|
[bearer](../README.md#bearer)
|
|
|
|
### HTTP request headers
|
|
|
|
- **Content-Type**: Not defined
|
|
- **Accept**: application/json
|
|
|
|
[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md)
|
|
|
|
# **groupUpdate**
|
|
> GroupCreateOrUpdateDetailDTO groupUpdate(groupCreateOrUpdateDetailDTO)
|
|
|
|
Update a group
|
|
|
|
### Example
|
|
```dart
|
|
import 'package:mycoreapi/api.dart';
|
|
// TODO Configure OAuth2 access token for authorization: bearer
|
|
//defaultApiClient.getAuthentication<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**](GroupCreateOrUpdateDetailDTO.md)| group to update |
|
|
|
|
### Return type
|
|
|
|
[**GroupCreateOrUpdateDetailDTO**](GroupCreateOrUpdateDetailDTO.md)
|
|
|
|
### Authorization
|
|
|
|
[bearer](../README.md#bearer)
|
|
|
|
### HTTP request headers
|
|
|
|
- **Content-Type**: application/json
|
|
- **Accept**: application/json
|
|
|
|
[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md)
|
|
|