Портфели, создание счетов, ручные события, PATCH инструмента, ScopeCardOut, MetricsStatusOut, логотипы в HoldingOut.
296 lines
9.5 KiB
Markdown
296 lines
9.5 KiB
Markdown
# fintracker_api.api.InstrumentsApi
|
|
|
|
## Load the API package
|
|
```dart
|
|
import 'package:fintracker_api/api.dart';
|
|
```
|
|
|
|
All URIs are relative to *http://localhost*
|
|
|
|
Method | HTTP request | Description
|
|
------------- | ------------- | -------------
|
|
[**instrumentsGet**](InstrumentsApi.md#instrumentsget) | **GET** /api/v1/instruments/{instrument_id} | Get
|
|
[**instrumentsList**](InstrumentsApi.md#instrumentslist) | **GET** /api/v1/instruments | List
|
|
[**instrumentsPatch**](InstrumentsApi.md#instrumentspatch) | **PATCH** /api/v1/instruments/{instrument_id} | Patch
|
|
[**instrumentsPending**](InstrumentsApi.md#instrumentspending) | **GET** /api/v1/instruments/pending | Pending
|
|
[**instrumentsPendingResolve**](InstrumentsApi.md#instrumentspendingresolve) | **POST** /api/v1/instruments/pending/{pending_id}/resolve | Pending Resolve
|
|
[**instrumentsSetManualPrice**](InstrumentsApi.md#instrumentssetmanualprice) | **POST** /api/v1/instruments/{instrument_id}/prices | Set Manual Price
|
|
|
|
|
|
# **instrumentsGet**
|
|
> InstrumentDetail instrumentsGet(instrumentId, scope, pricesFrom)
|
|
|
|
Get
|
|
|
|
One instrument with its position, open lots, events and price history.
|
|
|
|
### Example
|
|
```dart
|
|
import 'package:fintracker_api/api.dart';
|
|
|
|
final api = FintrackerApi().getInstrumentsApi();
|
|
final int instrumentId = 56; // int |
|
|
final String scope = scope_example; // String | all | account:<id> | portfolio:<id>
|
|
final DateTime pricesFrom = 2013-10-20; // DateTime |
|
|
|
|
try {
|
|
final response = api.instrumentsGet(instrumentId, scope, pricesFrom);
|
|
print(response);
|
|
} on DioException catch (e) {
|
|
print('Exception when calling InstrumentsApi->instrumentsGet: $e\n');
|
|
}
|
|
```
|
|
|
|
### Parameters
|
|
|
|
Name | Type | Description | Notes
|
|
------------- | ------------- | ------------- | -------------
|
|
**instrumentId** | **int**| |
|
|
**scope** | **String**| all | account:<id> | portfolio:<id> | [optional] [default to 'all']
|
|
**pricesFrom** | **DateTime**| | [optional]
|
|
|
|
### Return type
|
|
|
|
[**InstrumentDetail**](InstrumentDetail.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)
|
|
|
|
# **instrumentsList**
|
|
> List<InstrumentOut> instrumentsList(q, assetClass, heldOnly, limit)
|
|
|
|
List
|
|
|
|
### Example
|
|
```dart
|
|
import 'package:fintracker_api/api.dart';
|
|
|
|
final api = FintrackerApi().getInstrumentsApi();
|
|
final String q = q_example; // String | substring of ticker, name or ISIN
|
|
final String assetClass = assetClass_example; // String | share | bond | etf | fund | currency | index | …
|
|
final bool heldOnly = true; // bool | only instruments with an open lot
|
|
final int limit = 56; // int |
|
|
|
|
try {
|
|
final response = api.instrumentsList(q, assetClass, heldOnly, limit);
|
|
print(response);
|
|
} on DioException catch (e) {
|
|
print('Exception when calling InstrumentsApi->instrumentsList: $e\n');
|
|
}
|
|
```
|
|
|
|
### Parameters
|
|
|
|
Name | Type | Description | Notes
|
|
------------- | ------------- | ------------- | -------------
|
|
**q** | **String**| substring of ticker, name or ISIN | [optional]
|
|
**assetClass** | **String**| share | bond | etf | fund | currency | index | … | [optional]
|
|
**heldOnly** | **bool**| only instruments with an open lot | [optional] [default to false]
|
|
**limit** | **int**| | [optional] [default to 100]
|
|
|
|
### Return type
|
|
|
|
[**List<InstrumentOut>**](InstrumentOut.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)
|
|
|
|
# **instrumentsPatch**
|
|
> InstrumentOut instrumentsPatch(instrumentId, instrumentPatch)
|
|
|
|
Patch
|
|
|
|
Correct an instrument by hand: name, board, lot, asset class, sector. The lot only rounds the quantities the rebalancing suggests; the asset class decides the bucket it lands in. Neither is refreshed here — call `POST /metrics/refresh` after, same as `/rules/apply`.
|
|
|
|
### Example
|
|
```dart
|
|
import 'package:fintracker_api/api.dart';
|
|
|
|
final api = FintrackerApi().getInstrumentsApi();
|
|
final int instrumentId = 56; // int |
|
|
final InstrumentPatch instrumentPatch = ; // InstrumentPatch |
|
|
|
|
try {
|
|
final response = api.instrumentsPatch(instrumentId, instrumentPatch);
|
|
print(response);
|
|
} on DioException catch (e) {
|
|
print('Exception when calling InstrumentsApi->instrumentsPatch: $e\n');
|
|
}
|
|
```
|
|
|
|
### Parameters
|
|
|
|
Name | Type | Description | Notes
|
|
------------- | ------------- | ------------- | -------------
|
|
**instrumentId** | **int**| |
|
|
**instrumentPatch** | [**InstrumentPatch**](InstrumentPatch.md)| |
|
|
|
|
### Return type
|
|
|
|
[**InstrumentOut**](InstrumentOut.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)
|
|
|
|
# **instrumentsPending**
|
|
> List<PendingInstrumentOut> instrumentsPending(status, limit, offset)
|
|
|
|
Pending
|
|
|
|
Instruments a report named that nothing in the master resolves to.
|
|
|
|
### Example
|
|
```dart
|
|
import 'package:fintracker_api/api.dart';
|
|
|
|
final api = FintrackerApi().getInstrumentsApi();
|
|
final String status = status_example; // String | pending | resolved | ignored | all
|
|
final int limit = 56; // int |
|
|
final int offset = 56; // int |
|
|
|
|
try {
|
|
final response = api.instrumentsPending(status, limit, offset);
|
|
print(response);
|
|
} on DioException catch (e) {
|
|
print('Exception when calling InstrumentsApi->instrumentsPending: $e\n');
|
|
}
|
|
```
|
|
|
|
### Parameters
|
|
|
|
Name | Type | Description | Notes
|
|
------------- | ------------- | ------------- | -------------
|
|
**status** | **String**| pending | resolved | ignored | all | [optional] [default to 'pending']
|
|
**limit** | **int**| | [optional] [default to 100]
|
|
**offset** | **int**| | [optional] [default to 0]
|
|
|
|
### Return type
|
|
|
|
[**List<PendingInstrumentOut>**](PendingInstrumentOut.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)
|
|
|
|
# **instrumentsPendingResolve**
|
|
> PendingResolveResult instrumentsPendingResolve(pendingId, pendingResolveRequest)
|
|
|
|
Pending Resolve
|
|
|
|
Link, create or ignore — then bind the events that were waiting and rebuild the lots.
|
|
|
|
### Example
|
|
```dart
|
|
import 'package:fintracker_api/api.dart';
|
|
|
|
final api = FintrackerApi().getInstrumentsApi();
|
|
final int pendingId = 56; // int |
|
|
final PendingResolveRequest pendingResolveRequest = ; // PendingResolveRequest |
|
|
|
|
try {
|
|
final response = api.instrumentsPendingResolve(pendingId, pendingResolveRequest);
|
|
print(response);
|
|
} on DioException catch (e) {
|
|
print('Exception when calling InstrumentsApi->instrumentsPendingResolve: $e\n');
|
|
}
|
|
```
|
|
|
|
### Parameters
|
|
|
|
Name | Type | Description | Notes
|
|
------------- | ------------- | ------------- | -------------
|
|
**pendingId** | **int**| |
|
|
**pendingResolveRequest** | [**PendingResolveRequest**](PendingResolveRequest.md)| |
|
|
|
|
### Return type
|
|
|
|
[**PendingResolveResult**](PendingResolveResult.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)
|
|
|
|
# **instrumentsSetManualPrice**
|
|
> PriceManualOut instrumentsSetManualPrice(instrumentId, priceManualIn)
|
|
|
|
Set Manual Price
|
|
|
|
Set (or replace) the manual price of `instrument_id` on `body.d`. For what no exchange quotes: real estate, crypto, a custom holding, an OTC bond nobody lists. One row per (instrument, day) — a second call for the same day replaces it rather than piling up duplicates the price series would then have to pick between. Does not itself refresh `metric_*`; call `POST /metrics/refresh` after, same as `/rules/apply`.
|
|
|
|
### Example
|
|
```dart
|
|
import 'package:fintracker_api/api.dart';
|
|
|
|
final api = FintrackerApi().getInstrumentsApi();
|
|
final int instrumentId = 56; // int |
|
|
final PriceManualIn priceManualIn = ; // PriceManualIn |
|
|
|
|
try {
|
|
final response = api.instrumentsSetManualPrice(instrumentId, priceManualIn);
|
|
print(response);
|
|
} on DioException catch (e) {
|
|
print('Exception when calling InstrumentsApi->instrumentsSetManualPrice: $e\n');
|
|
}
|
|
```
|
|
|
|
### Parameters
|
|
|
|
Name | Type | Description | Notes
|
|
------------- | ------------- | ------------- | -------------
|
|
**instrumentId** | **int**| |
|
|
**priceManualIn** | [**PriceManualIn**](PriceManualIn.md)| |
|
|
|
|
### Return type
|
|
|
|
[**PriceManualOut**](PriceManualOut.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)
|
|
|