9.0 KiB

mycoreapi.api.RoomApi

Load the API package

import 'package:mycoreapi/api.dart';

All URIs are relative to http://192.168.31.140

Method HTTP request Description
roomCreate POST /api/room Create a room
roomDelete DELETE /api/room/{roomId}/device/{deviceId} Delete device from a room
roomDelete2 DELETE /api/room/{roomId} Delete a room
roomDeleteAllForUser DELETE /api/room/user/{userId} Delete all room for a specified
roomGetAll GET /api/room/{userId} Get all rooms for the specified user
roomGetDetail GET /api/room/detail/{roomId} Get detail info of a specified room
roomUpdate PUT /api/room Update a room

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

MultipartFile roomDelete(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.roomDelete(deviceId, roomId);
    print(result);
} catch (e) {
    print('Exception when calling RoomApi->roomDelete: $e\n');
}

Parameters

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

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]

roomDelete2

MultipartFile roomDelete2(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.roomDelete2(roomId);
    print(result);
} catch (e) {
    print('Exception when calling RoomApi->roomDelete2: $e\n');
}

Parameters

Name Type Description Notes
roomId String Id of room

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]

roomDeleteAllForUser

MultipartFile roomDeleteAllForUser(userId)

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

try { 
    final result = api_instance.roomDeleteAllForUser(userId);
    print(result);
} catch (e) {
    print('Exception when calling RoomApi->roomDeleteAllForUser: $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]

roomGetAll

List roomGetAll(userId)

Get all rooms 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 = RoomApi();
final userId = userId_example; // String | Id of user

try { 
    final result = api_instance.roomGetAll(userId);
    print(result);
} catch (e) {
    print('Exception when calling RoomApi->roomGetAll: $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]

roomGetDetail

RoomDetailDTO roomGetDetail(roomId, userId)

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
final userId = userId_example; // String | user id

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

Parameters

Name Type Description Notes
roomId String room id
userId String user id [optional]

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]