just gen-client — покрывает links, cashflow-broker, ручные цены, imports/pending, goals/income/rebalance/tax/benchmarks.
150 lines
4.6 KiB
Markdown
150 lines
4.6 KiB
Markdown
# fintracker_api.api.RebalanceApi
|
|
|
|
## Load the API package
|
|
```dart
|
|
import 'package:fintracker_api/api.dart';
|
|
```
|
|
|
|
All URIs are relative to *http://localhost*
|
|
|
|
Method | HTTP request | Description
|
|
------------- | ------------- | -------------
|
|
[**rebalanceRebalance**](RebalanceApi.md#rebalancerebalance) | **GET** /api/v1/portfolios/{portfolio_id}/rebalance | Rebalance
|
|
[**rebalanceSetTargets**](RebalanceApi.md#rebalancesettargets) | **PUT** /api/v1/portfolios/{portfolio_id}/targets | Set Targets
|
|
[**rebalanceTargets**](RebalanceApi.md#rebalancetargets) | **GET** /api/v1/portfolios/{portfolio_id}/targets | Targets
|
|
|
|
|
|
# **rebalanceRebalance**
|
|
> RebalanceOut rebalanceRebalance(portfolioId, dimension, cashAvailable)
|
|
|
|
Rebalance
|
|
|
|
### Example
|
|
```dart
|
|
import 'package:fintracker_api/api.dart';
|
|
|
|
final api = FintrackerApi().getRebalanceApi();
|
|
final int portfolioId = 56; // int |
|
|
final String dimension = dimension_example; // String | asset_class | sector | country | currency
|
|
final CashAvailable cashAvailable = ; // CashAvailable | переопределяет остаток на счетах для what-if
|
|
|
|
try {
|
|
final response = api.rebalanceRebalance(portfolioId, dimension, cashAvailable);
|
|
print(response);
|
|
} on DioException catch (e) {
|
|
print('Exception when calling RebalanceApi->rebalanceRebalance: $e\n');
|
|
}
|
|
```
|
|
|
|
### Parameters
|
|
|
|
Name | Type | Description | Notes
|
|
------------- | ------------- | ------------- | -------------
|
|
**portfolioId** | **int**| |
|
|
**dimension** | **String**| asset_class | sector | country | currency | [optional] [default to 'asset_class']
|
|
**cashAvailable** | [**CashAvailable**](.md)| переопределяет остаток на счетах для what-if | [optional]
|
|
|
|
### Return type
|
|
|
|
[**RebalanceOut**](RebalanceOut.md)
|
|
|
|
### Authorization
|
|
|
|
[HTTPBearer](../README.md#HTTPBearer)
|
|
|
|
### HTTP request headers
|
|
|
|
- **Content-Type**: Not defined
|
|
- **Accept**: application/json, application/problem+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)
|
|
|
|
# **rebalanceSetTargets**
|
|
> TargetsOut rebalanceSetTargets(portfolioId, targetsIn)
|
|
|
|
Set Targets
|
|
|
|
Replace the whole set for one dimension. The weights must add up to 1 within `WEIGHT_TOLERANCE`; otherwise the request is refused with the actual sum in the message, so the user can see by how much the plan misses rather than being handed a silently rescaled one.
|
|
|
|
### Example
|
|
```dart
|
|
import 'package:fintracker_api/api.dart';
|
|
|
|
final api = FintrackerApi().getRebalanceApi();
|
|
final int portfolioId = 56; // int |
|
|
final TargetsIn targetsIn = ; // TargetsIn |
|
|
|
|
try {
|
|
final response = api.rebalanceSetTargets(portfolioId, targetsIn);
|
|
print(response);
|
|
} on DioException catch (e) {
|
|
print('Exception when calling RebalanceApi->rebalanceSetTargets: $e\n');
|
|
}
|
|
```
|
|
|
|
### Parameters
|
|
|
|
Name | Type | Description | Notes
|
|
------------- | ------------- | ------------- | -------------
|
|
**portfolioId** | **int**| |
|
|
**targetsIn** | [**TargetsIn**](TargetsIn.md)| |
|
|
|
|
### Return type
|
|
|
|
[**TargetsOut**](TargetsOut.md)
|
|
|
|
### Authorization
|
|
|
|
[HTTPBearer](../README.md#HTTPBearer)
|
|
|
|
### HTTP request headers
|
|
|
|
- **Content-Type**: application/json
|
|
- **Accept**: application/json, application/problem+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)
|
|
|
|
# **rebalanceTargets**
|
|
> TargetsOut rebalanceTargets(portfolioId, dimension)
|
|
|
|
Targets
|
|
|
|
### Example
|
|
```dart
|
|
import 'package:fintracker_api/api.dart';
|
|
|
|
final api = FintrackerApi().getRebalanceApi();
|
|
final int portfolioId = 56; // int |
|
|
final String dimension = dimension_example; // String | asset_class | sector | country | currency
|
|
|
|
try {
|
|
final response = api.rebalanceTargets(portfolioId, dimension);
|
|
print(response);
|
|
} on DioException catch (e) {
|
|
print('Exception when calling RebalanceApi->rebalanceTargets: $e\n');
|
|
}
|
|
```
|
|
|
|
### Parameters
|
|
|
|
Name | Type | Description | Notes
|
|
------------- | ------------- | ------------- | -------------
|
|
**portfolioId** | **int**| |
|
|
**dimension** | **String**| asset_class | sector | country | currency | [optional] [default to 'asset_class']
|
|
|
|
### Return type
|
|
|
|
[**TargetsOut**](TargetsOut.md)
|
|
|
|
### Authorization
|
|
|
|
[HTTPBearer](../README.md#HTTPBearer)
|
|
|
|
### HTTP request headers
|
|
|
|
- **Content-Type**: Not defined
|
|
- **Accept**: application/json, application/problem+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)
|
|
|