myhomie_app/mycore_api/doc/GroupApi.md

13 KiB

mycoreapi.api.GroupApi

Load the API package

import 'package:mycoreapi/api.dart';

All URIs are relative to http://192.168.31.140

Method HTTP request Description
groupCreate POST /api/group Create a group
groupCreateDevicesFromZigbee2Mqtt POST /api/group/{userId}/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
groupDeleteAllForUser DELETE /api/group/user/{userId} Delete all group for a specified
groupGetAll GET /api/group/{userId} Get all groups for the specified user
groupGetDetail GET /api/group/detail/{groupId} Get detail info of a specified group
groupGetGroupsByType GET /api/group/{userId}/type/{type} Get list of group from a type
groupGetGroupsFromZigbee2Mqtt GET /api/group/zigbee2Mqtt/{userId} Get all zigbee2Mqtt groups
groupUpdate PUT /api/group Update a group

groupCreate

GroupDetailDTO groupCreate(groupCreateOrUpdateDetailDTO)

Create a group

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 = 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

GroupDetailDTO

Authorization

bearer

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(userId)

Create groups 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 = 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

Authorization

bearer

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

MultipartFile groupDelete(deviceId, groupId)

Delete device from a group

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 = GroupApi();
final deviceId = deviceId_example; // String | Id of device to delete from the group
final groupId = groupId_example; // String | Id of group 

try { 
    final result = api_instance.groupDelete(deviceId, groupId);
    print(result);
} catch (e) {
    print('Exception when calling GroupApi->groupDelete: $e\n');
}

Parameters

Name Type Description Notes
deviceId String Id of device to delete from the group
groupId String Id of group

Return type

MultipartFile

Authorization

bearer

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]

groupDelete2

MultipartFile groupDelete2(groupId)

Delete a group

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 = GroupApi();
final groupId = groupId_example; // String | Id of group 

try { 
    final result = api_instance.groupDelete2(groupId);
    print(result);
} catch (e) {
    print('Exception when calling GroupApi->groupDelete2: $e\n');
}

Parameters

Name Type Description Notes
groupId String Id of group

Return type

MultipartFile

Authorization

bearer

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]

groupDeleteAllForUser

MultipartFile groupDeleteAllForUser(userId)

Delete all group 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 = GroupApi();
final userId = userId_example; // String | Id of user

try { 
    final result = api_instance.groupDeleteAllForUser(userId);
    print(result);
} catch (e) {
    print('Exception when calling GroupApi->groupDeleteAllForUser: $e\n');
}

Parameters

Name Type Description Notes
userId String Id of user

Return type

MultipartFile

Authorization

bearer

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]

groupGetAll

List groupGetAll(userId)

Get all groups for the specified user

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 = 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

Authorization

bearer

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, userId)

Get detail info of a specified group

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 = GroupApi();
final groupId = groupId_example; // String | groupid
final userId = userId_example; // String | user id

try { 
    final result = api_instance.groupGetDetail(groupId, userId);
    print(result);
} catch (e) {
    print('Exception when calling GroupApi->groupGetDetail: $e\n');
}

Parameters

Name Type Description Notes
groupId String groupid
userId String user id [optional]

Return type

GroupDetailDTO

Authorization

bearer

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(userId, type)

Get list of group 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 = 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

Authorization

bearer

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(userId)

Get all zigbee2Mqtt groups

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 = 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

Authorization

bearer

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: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 group to update

Return type

GroupCreateOrUpdateDetailDTO

Authorization

bearer

HTTP request headers

  • Content-Type: application/json
  • Accept: application/json

[Back to top] [Back to API list] [Back to Model list] [Back to README]