mirror of
https://bitbucket.org/myhomie/mycorerepository.git
synced 2025-12-06 01:31:19 +00:00
326 lines
8.9 KiB
Markdown
326 lines
8.9 KiB
Markdown
# mycoreapi.api.RoomApi
|
|
|
|
## Load the API package
|
|
```dart
|
|
import 'package:mycoreapi/api.dart';
|
|
```
|
|
|
|
All URIs are relative to *http://localhost:25049*
|
|
|
|
Method | HTTP request | Description
|
|
------------- | ------------- | -------------
|
|
[**roomCreate**](RoomApi.md#roomcreate) | **POST** /api/room | Create a room
|
|
[**roomDelete**](RoomApi.md#roomdelete) | **DELETE** /api/room/{roomId}/device/{deviceId} | Delete device from a room
|
|
[**roomDelete2**](RoomApi.md#roomdelete2) | **DELETE** /api/room/{roomId} | Delete a room
|
|
[**roomDeleteAllForUser**](RoomApi.md#roomdeleteallforuser) | **DELETE** /api/room/user/{userId} | Delete all room for a specified user
|
|
[**roomGetAll**](RoomApi.md#roomgetall) | **GET** /api/room/{userId} | Get all rooms for the specified user
|
|
[**roomGetDetail**](RoomApi.md#roomgetdetail) | **GET** /api/room/detail/{roomId} | Get detail info of a specified room
|
|
[**roomUpdate**](RoomApi.md#roomupdate) | **PUT** /api/room | Update a room
|
|
|
|
|
|
# **roomCreate**
|
|
> RoomDetailDTO roomCreate(roomCreateOrUpdateDetailDTO)
|
|
|
|
Create a room
|
|
|
|
### 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 = 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**](RoomCreateOrUpdateDetailDTO.md)| Room to create |
|
|
|
|
### Return type
|
|
|
|
[**RoomDetailDTO**](RoomDetailDTO.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)
|
|
|
|
# **roomDelete**
|
|
> String roomDelete(deviceId, roomId)
|
|
|
|
Delete device from a room
|
|
|
|
### 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 = 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
|
|
|
|
**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)
|
|
|
|
# **roomDelete2**
|
|
> String roomDelete2(roomId)
|
|
|
|
Delete a room
|
|
|
|
### 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 = 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
|
|
|
|
**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)
|
|
|
|
# **roomDeleteAllForUser**
|
|
> String roomDeleteAllForUser(userId)
|
|
|
|
Delete all room for a 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 = 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
|
|
|
|
**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)
|
|
|
|
# **roomGetAll**
|
|
> List<RoomSummaryDTO> roomGetAll(userId)
|
|
|
|
Get all rooms 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 = 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<RoomSummaryDTO>**](RoomSummaryDTO.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)
|
|
|
|
# **roomGetDetail**
|
|
> RoomDetailDTO roomGetDetail(roomId, userId)
|
|
|
|
Get detail info of a specified room
|
|
|
|
### 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 = 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**](RoomDetailDTO.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)
|
|
|
|
# **roomUpdate**
|
|
> RoomCreateOrUpdateDetailDTO roomUpdate(roomCreateOrUpdateDetailDTO)
|
|
|
|
Update a room
|
|
|
|
### 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 = 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**](RoomCreateOrUpdateDetailDTO.md)| room to update |
|
|
|
|
### Return type
|
|
|
|
[**RoomCreateOrUpdateDetailDTO**](RoomCreateOrUpdateDetailDTO.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)
|
|
|