mirror of
https://bitbucket.org/myhomie/myhomie_app.git
synced 2025-12-06 17:11:19 +00:00
6.1 KiB
6.1 KiB
mycoreapi.api.HomeApi
Load the API package
import 'package:mycoreapi/api.dart';
All URIs are relative to http://192.168.31.140
| Method | HTTP request | Description |
|---|---|---|
| homeCreate | POST /api/home | Create a home |
| homeDelete | DELETE /api/home/{homeId} | Delete a home |
| homeGetAll | GET /api/home/{userId} | Get all home for specified user |
| homeGetDetail | GET /api/home/detail/{homeId} | Get detail info of a specified home |
| homeUpdate | PUT /api/home | Update a home |
homeCreate
HomeDTO homeCreate(createOrUpdateHomeDTO)
Create a 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 = HomeApi();
final createOrUpdateHomeDTO = CreateOrUpdateHomeDTO(); // CreateOrUpdateHomeDTO | Home to create
try {
final result = api_instance.homeCreate(createOrUpdateHomeDTO);
print(result);
} catch (e) {
print('Exception when calling HomeApi->homeCreate: $e\n');
}
Parameters
| Name | Type | Description | Notes |
|---|---|---|---|
| createOrUpdateHomeDTO | CreateOrUpdateHomeDTO | Home to create |
Return type
Authorization
HTTP request headers
- Content-Type: application/json
- Accept: application/json
[Back to top] [Back to API list] [Back to Model list] [Back to README]
homeDelete
String homeDelete(homeId)
Delete a 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 = HomeApi();
final homeId = homeId_example; // String | Id of home to delete
try {
final result = api_instance.homeDelete(homeId);
print(result);
} catch (e) {
print('Exception when calling HomeApi->homeDelete: $e\n');
}
Parameters
| Name | Type | Description | Notes |
|---|---|---|---|
| homeId | String | Id of home to delete |
Return type
String
Authorization
HTTP request headers
- Content-Type: Not defined
- Accept: application/json
[Back to top] [Back to API list] [Back to Model list] [Back to README]
homeGetAll
List homeGetAll(userId)
Get all home for 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 = HomeApi();
final userId = userId_example; // String | User Id
try {
final result = api_instance.homeGetAll(userId);
print(result);
} catch (e) {
print('Exception when calling HomeApi->homeGetAll: $e\n');
}
Parameters
| Name | Type | Description | Notes |
|---|---|---|---|
| userId | String | User Id |
Return type
Authorization
HTTP request headers
- Content-Type: Not defined
- Accept: application/json
[Back to top] [Back to API list] [Back to Model list] [Back to README]
homeGetDetail
HomeDetailDTO homeGetDetail(homeId)
Get detail info of 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 = HomeApi();
final homeId = homeId_example; // String | home id
try {
final result = api_instance.homeGetDetail(homeId);
print(result);
} catch (e) {
print('Exception when calling HomeApi->homeGetDetail: $e\n');
}
Parameters
| Name | Type | Description | Notes |
|---|---|---|---|
| homeId | String | home id |
Return type
Authorization
HTTP request headers
- Content-Type: Not defined
- Accept: application/json
[Back to top] [Back to API list] [Back to Model list] [Back to README]
homeUpdate
HomeDTO homeUpdate(createOrUpdateHomeDTO)
Update a 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 = HomeApi();
final createOrUpdateHomeDTO = CreateOrUpdateHomeDTO(); // CreateOrUpdateHomeDTO | Home to update
try {
final result = api_instance.homeUpdate(createOrUpdateHomeDTO);
print(result);
} catch (e) {
print('Exception when calling HomeApi->homeUpdate: $e\n');
}
Parameters
| Name | Type | Description | Notes |
|---|---|---|---|
| createOrUpdateHomeDTO | CreateOrUpdateHomeDTO | Home to update |
Return type
Authorization
HTTP request headers
- Content-Type: application/json
- Accept: application/json
[Back to top] [Back to API list] [Back to Model list] [Back to README]