12 KiB

mycoreapi.api.RoomApi

Load the API package

import 'package:mycoreapi/api.dart';

All URIs are relative to http://localhost:5000

Method HTTP request Description
roomAddDeviceToRoom PUT /api/room/{roomId} Add devices in the specified room
roomCreate POST /api/room Create a room
roomDelete DELETE /api/room/{roomId} Delete a room
roomDelete2 DELETE /api/room/{roomId}/device/{deviceId} Delete device from a room
roomDeleteAllForHome DELETE /api/room/home/{homeId} Delete all rooms for a specified home
roomGetAll GET /api/room/{homeId} Get all rooms for the specified home
roomGetAllWithMainDetails GET /api/room/{homeId}/details Get all rooms main details for the specified home
roomGetDetail GET /api/room/detail/{roomId} Get detail info of a specified room
roomUpdate PUT /api/room Update a room

roomAddDeviceToRoom

RoomDetailDTO roomAddDeviceToRoom(roomId, requestBody)

Add devices in the specified room

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 = RoomApi();
final roomId = roomId_example; // String | Room Id
final requestBody = [List<String>()]; // List<String> | Device Ids

try { 
    final result = api_instance.roomAddDeviceToRoom(roomId, requestBody);
    print(result);
} catch (e) {
    print('Exception when calling RoomApi->roomAddDeviceToRoom: $e\n');
}

Parameters

Name Type Description Notes
roomId String Room Id
requestBody List Device Ids

Return type

RoomDetailDTO

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]

roomCreate

RoomDetailDTO roomCreate(roomCreateOrUpdateDetailDTO)

Create a room

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 = RoomApi();
final roomCreateOrUpdateDetailDTO = RoomCreateOrUpdateDetailDTO(); // RoomCreateOrUpdateDetailDTO | Room to create

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

Parameters

Name Type Description Notes
roomCreateOrUpdateDetailDTO RoomCreateOrUpdateDetailDTO Room to create

Return type

RoomDetailDTO

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]

roomDelete

String roomDelete(roomId)

Delete a room

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 = RoomApi();
final roomId = roomId_example; // String | Id of room 

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

Parameters

Name Type Description Notes
roomId String Id of room

Return type

String

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]

roomDelete2

String roomDelete2(deviceId, roomId)

Delete device from a room

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 = RoomApi();
final deviceId = deviceId_example; // String | Id of device to delete from the room
final roomId = roomId_example; // String | Id of room 

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

Parameters

Name Type Description Notes
deviceId String Id of device to delete from the room
roomId String Id of room

Return type

String

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]

roomDeleteAllForHome

String roomDeleteAllForHome(homeId)

Delete all rooms for a specified home

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 = RoomApi();
final homeId = homeId_example; // String | Home Id

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

Parameters

Name Type Description Notes
homeId String Home Id

Return type

String

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]

roomGetAll

List roomGetAll(homeId)

Get all rooms for the specified home

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 = RoomApi();
final homeId = homeId_example; // String | Home Id

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

Parameters

Name Type Description Notes
homeId String Home 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]

roomGetAllWithMainDetails

List roomGetAllWithMainDetails(homeId)

Get all rooms main details for the specified home

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 = RoomApi();
final homeId = homeId_example; // String | Home Id

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

Parameters

Name Type Description Notes
homeId String Home 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]

roomGetDetail

RoomDetailDTO roomGetDetail(roomId)

Get detail info of a specified room

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 = RoomApi();
final roomId = roomId_example; // String | room id

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

Parameters

Name Type Description Notes
roomId String room id

Return type

RoomDetailDTO

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]

roomUpdate

RoomCreateOrUpdateDetailDTO roomUpdate(roomCreateOrUpdateDetailDTO)

Update a room

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 = RoomApi();
final roomCreateOrUpdateDetailDTO = RoomCreateOrUpdateDetailDTO(); // RoomCreateOrUpdateDetailDTO | room to update

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

Parameters

Name Type Description Notes
roomCreateOrUpdateDetailDTO RoomCreateOrUpdateDetailDTO room to update

Return type

RoomCreateOrUpdateDetailDTO

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]