chore(app): сгенерированный Dart-клиент

just gen-client — покрывает links, cashflow-broker, ручные цены,
imports/pending, goals/income/rebalance/tax/benchmarks.
This commit is contained in:
Dmitry
2026-09-19 10:46:09 +03:00
parent b69bb4a0c9
commit ccd06f32f7
242 changed files with 25877 additions and 3 deletions
@@ -5,16 +5,29 @@ doc/AccountKind.md
doc/AccountOut.md
doc/AccountPatch.md
doc/AccountRole.md
doc/AccountSuggestion.md
doc/AccountsApi.md
doc/AllocationBucket.md
doc/AllocationDimension.md
doc/AnalyticsApi.md
doc/AuthApi.md
doc/BenchmarkComparison.md
doc/BenchmarkComparisonOut.md
doc/BenchmarkCreate.md
doc/BenchmarkOut.md
doc/BenchmarkPatch.md
doc/BenchmarkReturnOut.md
doc/BenchmarksApi.md
doc/Broker.md
doc/CalendarEntry.md
doc/CalendarOut.md
doc/CashAvailable.md
doc/CashFlowBrokerMonth.md
doc/CashFlowMonth.md
doc/CashflowApi.md
doc/CategoriesApi.md
doc/CategoryOut.md
doc/CommitRequest.md
doc/DataQualityRow.md
doc/EventKind.md
doc/EventOut.md
@@ -23,21 +36,52 @@ doc/EventSource.md
doc/EventStatus.md
doc/EventsApi.md
doc/FlowType.md
doc/ForecastMonth.md
doc/ForecastOut.md
doc/GoalCreate.md
doc/GoalOut.md
doc/GoalPatch.md
doc/GoalProgressOut.md
doc/GoalsApi.md
doc/Health.md
doc/HealthApi.md
doc/HistoryOut.md
doc/HistoryRow.md
doc/HistoryTotals.md
doc/HoldingOut.md
doc/ImportCounts.md
doc/ImportPreview.md
doc/ImportResult.md
doc/ImportSummary.md
doc/ImportsApi.md
doc/IncomeApi.md
doc/InstrumentDetail.md
doc/InstrumentOut.md
doc/InstrumentsApi.md
doc/JobStatus.md
doc/LinkCreate.md
doc/LinkOut.md
doc/LinksApi.md
doc/LoginRequest.md
doc/LotOut.md
doc/MetricsApi.md
doc/NetWorthBreakdown.md
doc/NetWorthDay.md
doc/NetworthApi.md
doc/NewInstrument.md
doc/PendingInstrumentOut.md
doc/PendingResolveRequest.md
doc/PendingResolveResult.md
doc/PriceManualIn.md
doc/PriceManualOut.md
doc/PricePoint.md
doc/Problem.md
doc/RebalanceApi.md
doc/RebalanceBucketOut.md
doc/RebalanceOut.md
doc/ReconciliationCash.md
doc/ReconciliationOut.md
doc/ReconciliationPosition.md
doc/RefreshLogOut.md
doc/RefreshRequest.md
doc/ReturnsOut.md
@@ -49,6 +93,7 @@ doc/RulePatch.md
doc/RulesApi.md
doc/RunStatus.md
doc/RunwayOut.md
doc/SampleEventOut.md
doc/ScopeOut.md
doc/SourceStatus.md
doc/SpendingRow.md
@@ -56,10 +101,24 @@ doc/SummaryOut.md
doc/SyncApi.md
doc/SyncJobOut.md
doc/SyncRunOut.md
doc/TargetIn.md
doc/TargetOut.md
doc/TargetsIn.md
doc/TargetsOut.md
doc/TaxAccountOut.md
doc/TaxApi.md
doc/TaxLotOut.md
doc/TaxLotsOut.md
doc/TaxTotals.md
doc/TaxYearOut.md
doc/TokenPair.md
doc/TradeOut.md
doc/TransactionOut.md
doc/TransactionPage.md
doc/TransactionsApi.md
doc/UnmatchedBrokerOut.md
doc/UnmatchedOut.md
doc/UnmatchedZmOut.md
doc/UserOut.md
doc/ValueDay.md
lib/fintracker_api.dart
@@ -67,15 +126,22 @@ lib/src/api.dart
lib/src/api/accounts_api.dart
lib/src/api/analytics_api.dart
lib/src/api/auth_api.dart
lib/src/api/benchmarks_api.dart
lib/src/api/cashflow_api.dart
lib/src/api/categories_api.dart
lib/src/api/events_api.dart
lib/src/api/goals_api.dart
lib/src/api/health_api.dart
lib/src/api/imports_api.dart
lib/src/api/income_api.dart
lib/src/api/instruments_api.dart
lib/src/api/links_api.dart
lib/src/api/metrics_api.dart
lib/src/api/networth_api.dart
lib/src/api/rebalance_api.dart
lib/src/api/rules_api.dart
lib/src/api/sync_api.dart
lib/src/api/tax_api.dart
lib/src/api/transactions_api.dart
lib/src/auth/api_key_auth.dart
lib/src/auth/auth.dart
@@ -88,11 +154,23 @@ lib/src/model/account_kind.dart
lib/src/model/account_out.dart
lib/src/model/account_patch.dart
lib/src/model/account_role.dart
lib/src/model/account_suggestion.dart
lib/src/model/allocation_bucket.dart
lib/src/model/allocation_dimension.dart
lib/src/model/benchmark_comparison.dart
lib/src/model/benchmark_comparison_out.dart
lib/src/model/benchmark_create.dart
lib/src/model/benchmark_out.dart
lib/src/model/benchmark_patch.dart
lib/src/model/benchmark_return_out.dart
lib/src/model/broker.dart
lib/src/model/calendar_entry.dart
lib/src/model/calendar_out.dart
lib/src/model/cash_available.dart
lib/src/model/cash_flow_broker_month.dart
lib/src/model/cash_flow_month.dart
lib/src/model/category_out.dart
lib/src/model/commit_request.dart
lib/src/model/data_quality_row.dart
lib/src/model/event_kind.dart
lib/src/model/event_out.dart
@@ -100,17 +178,43 @@ lib/src/model/event_page.dart
lib/src/model/event_source.dart
lib/src/model/event_status.dart
lib/src/model/flow_type.dart
lib/src/model/forecast_month.dart
lib/src/model/forecast_out.dart
lib/src/model/goal_create.dart
lib/src/model/goal_out.dart
lib/src/model/goal_patch.dart
lib/src/model/goal_progress_out.dart
lib/src/model/health.dart
lib/src/model/history_out.dart
lib/src/model/history_row.dart
lib/src/model/history_totals.dart
lib/src/model/holding_out.dart
lib/src/model/import_counts.dart
lib/src/model/import_preview.dart
lib/src/model/import_result.dart
lib/src/model/import_summary.dart
lib/src/model/instrument_detail.dart
lib/src/model/instrument_out.dart
lib/src/model/job_status.dart
lib/src/model/link_create.dart
lib/src/model/link_out.dart
lib/src/model/login_request.dart
lib/src/model/lot_out.dart
lib/src/model/net_worth_breakdown.dart
lib/src/model/net_worth_day.dart
lib/src/model/new_instrument.dart
lib/src/model/pending_instrument_out.dart
lib/src/model/pending_resolve_request.dart
lib/src/model/pending_resolve_result.dart
lib/src/model/price_manual_in.dart
lib/src/model/price_manual_out.dart
lib/src/model/price_point.dart
lib/src/model/problem.dart
lib/src/model/rebalance_bucket_out.dart
lib/src/model/rebalance_out.dart
lib/src/model/reconciliation_cash.dart
lib/src/model/reconciliation_out.dart
lib/src/model/reconciliation_position.dart
lib/src/model/refresh_log_out.dart
lib/src/model/refresh_request.dart
lib/src/model/returns_out.dart
@@ -121,15 +225,73 @@ lib/src/model/rule_out.dart
lib/src/model/rule_patch.dart
lib/src/model/run_status.dart
lib/src/model/runway_out.dart
lib/src/model/sample_event_out.dart
lib/src/model/scope_out.dart
lib/src/model/source_status.dart
lib/src/model/spending_row.dart
lib/src/model/summary_out.dart
lib/src/model/sync_job_out.dart
lib/src/model/sync_run_out.dart
lib/src/model/target_in.dart
lib/src/model/target_out.dart
lib/src/model/targets_in.dart
lib/src/model/targets_out.dart
lib/src/model/tax_account_out.dart
lib/src/model/tax_lot_out.dart
lib/src/model/tax_lots_out.dart
lib/src/model/tax_totals.dart
lib/src/model/tax_year_out.dart
lib/src/model/token_pair.dart
lib/src/model/trade_out.dart
lib/src/model/transaction_out.dart
lib/src/model/transaction_page.dart
lib/src/model/unmatched_broker_out.dart
lib/src/model/unmatched_out.dart
lib/src/model/unmatched_zm_out.dart
lib/src/model/user_out.dart
lib/src/model/value_day.dart
pubspec.yaml
test/benchmark_comparison_out_test.dart
test/benchmark_comparison_test.dart
test/benchmark_create_test.dart
test/benchmark_out_test.dart
test/benchmark_patch_test.dart
test/benchmark_return_out_test.dart
test/benchmarks_api_test.dart
test/calendar_entry_test.dart
test/calendar_out_test.dart
test/cash_available_test.dart
test/cash_flow_broker_month_test.dart
test/forecast_month_test.dart
test/forecast_out_test.dart
test/goal_create_test.dart
test/goal_out_test.dart
test/goal_patch_test.dart
test/goal_progress_out_test.dart
test/goals_api_test.dart
test/history_out_test.dart
test/history_row_test.dart
test/history_totals_test.dart
test/income_api_test.dart
test/link_create_test.dart
test/link_out_test.dart
test/links_api_test.dart
test/price_manual_in_test.dart
test/price_manual_out_test.dart
test/rebalance_api_test.dart
test/rebalance_bucket_out_test.dart
test/rebalance_out_test.dart
test/target_in_test.dart
test/target_out_test.dart
test/targets_in_test.dart
test/targets_out_test.dart
test/tax_account_out_test.dart
test/tax_api_test.dart
test/tax_lot_out_test.dart
test/tax_lots_out_test.dart
test/tax_totals_test.dart
test/tax_year_out_test.dart
test/trade_out_test.dart
test/unmatched_broker_out_test.dart
test/unmatched_out_test.dart
test/unmatched_zm_out_test.dart
@@ -0,0 +1,18 @@
# fintracker_api.model.AccountSuggestion
## Load the model package
```dart
import 'package:fintracker_api/api.dart';
```
## Properties
Name | Type | Description | Notes
------------ | ------------- | ------------- | -------------
**broker** | **String** | |
**id** | **int** | |
**name** | **String** | |
**sourceId** | **String** | |
[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md)
@@ -10,6 +10,7 @@ All URIs are relative to *http://localhost*
Method | HTTP request | Description
------------- | ------------- | -------------
[**analyticsAllocation**](AnalyticsApi.md#analyticsallocation) | **GET** /api/v1/analytics/allocation | Allocation
[**analyticsCashflowBroker**](AnalyticsApi.md#analyticscashflowbroker) | **GET** /api/v1/analytics/cashflow-broker | Cashflow Broker
[**analyticsHoldings**](AnalyticsApi.md#analyticsholdings) | **GET** /api/v1/analytics/holdings | Holdings
[**analyticsReturns**](AnalyticsApi.md#analyticsreturns) | **GET** /api/v1/analytics/returns | Returns
[**analyticsScopes**](AnalyticsApi.md#analyticsscopes) | **GET** /api/v1/analytics/scopes | Scopes
@@ -62,6 +63,49 @@ Name | Type | Description | Notes
[[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)
# **analyticsCashflowBroker**
> List<CashFlowBrokerMonth> analyticsCashflowBroker(scope)
Cashflow Broker
Money moved across the brokerage boundary, by month: the other half of cash flow that `metric_cash_flow_monthly` (ZenMoney spending) does not cover.
### Example
```dart
import 'package:fintracker_api/api.dart';
final api = FintrackerApi().getAnalyticsApi();
final String scope = scope_example; // String | all | account:<id> | portfolio:<id>
try {
final response = api.analyticsCashflowBroker(scope);
print(response);
} on DioException catch (e) {
print('Exception when calling AnalyticsApi->analyticsCashflowBroker: $e\n');
}
```
### Parameters
Name | Type | Description | Notes
------------- | ------------- | ------------- | -------------
**scope** | **String**| all | account:<id> | portfolio:<id> | [optional] [default to 'all']
### Return type
[**List&lt;CashFlowBrokerMonth&gt;**](CashFlowBrokerMonth.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)
# **analyticsHoldings**
> List<HoldingOut> analyticsHoldings(scope)
@@ -0,0 +1,15 @@
# fintracker_api.model.BenchmarkComparison
## Load the model package
```dart
import 'package:fintracker_api/api.dart';
```
## Properties
Name | Type | Description | Notes
------------ | ------------- | ------------- | -------------
**rows** | [**List&lt;BenchmarkComparisonOut&gt;**](BenchmarkComparisonOut.md) | |
[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md)
@@ -0,0 +1,21 @@
# fintracker_api.model.BenchmarkComparisonOut
## Load the model package
```dart
import 'package:fintracker_api/api.dart';
```
## Properties
Name | Type | Description | Notes
------------ | ------------- | ------------- | -------------
**benchmarks** | [**List&lt;BenchmarkReturnOut&gt;**](BenchmarkReturnOut.md) | |
**dateFrom** | [**DateTime**](DateTime.md) | |
**dateTo** | [**DateTime**](DateTime.md) | |
**period** | **String** | |
**portfolioDaysSkipped** | **int** | |
**portfolioTwr** | **String** | decimal as string |
**portfolioTwrAnnualized** | **String** | decimal as string |
[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md)
@@ -0,0 +1,22 @@
# fintracker_api.model.BenchmarkCreate
## Load the model package
```dart
import 'package:fintracker_api/api.dart';
```
## Properties
Name | Type | Description | Notes
------------ | ------------- | ------------- | -------------
**code** | **String** | |
**currency** | **String** | | [optional] [default to 'RUB']
**instrumentId** | **int** | | [optional]
**isActive** | **bool** | | [optional] [default to true]
**isDefault** | **bool** | | [optional] [default to false]
**kind** | **String** | |
**name** | **String** | |
**source_** | **String** | | [optional] [default to 'moex']
[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md)
@@ -0,0 +1,25 @@
# fintracker_api.model.BenchmarkOut
## Load the model package
```dart
import 'package:fintracker_api/api.dart';
```
## Properties
Name | Type | Description | Notes
------------ | ------------- | ------------- | -------------
**code** | **String** | |
**currency** | **String** | |
**historyFrom** | [**DateTime**](DateTime.md) | |
**historyTo** | [**DateTime**](DateTime.md) | |
**id** | **int** | |
**instrumentId** | **int** | |
**isActive** | **bool** | |
**isDefault** | **bool** | |
**kind** | **String** | |
**name** | **String** | |
**source_** | **String** | |
[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md)
@@ -0,0 +1,22 @@
# fintracker_api.model.BenchmarkPatch
## Load the model package
```dart
import 'package:fintracker_api/api.dart';
```
## Properties
Name | Type | Description | Notes
------------ | ------------- | ------------- | -------------
**code** | **String** | | [optional]
**currency** | **String** | | [optional]
**instrumentId** | **int** | | [optional]
**isActive** | **bool** | | [optional]
**isDefault** | **bool** | | [optional]
**kind** | **String** | | [optional]
**name** | **String** | | [optional]
**source_** | **String** | | [optional]
[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md)
@@ -0,0 +1,22 @@
# fintracker_api.model.BenchmarkReturnOut
## Load the model package
```dart
import 'package:fintracker_api/api.dart';
```
## Properties
Name | Type | Description | Notes
------------ | ------------- | ------------- | -------------
**benchmarkId** | **int** | |
**code** | **String** | |
**daysSkipped** | **int** | |
**excess** | **String** | decimal as string |
**kind** | **String** | |
**name** | **String** | |
**twr** | **String** | decimal as string |
**twrAnnualized** | **String** | decimal as string |
[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md)
@@ -0,0 +1,226 @@
# fintracker_api.api.BenchmarksApi
## Load the API package
```dart
import 'package:fintracker_api/api.dart';
```
All URIs are relative to *http://localhost*
Method | HTTP request | Description
------------- | ------------- | -------------
[**benchmarksBenchmarks**](BenchmarksApi.md#benchmarksbenchmarks) | **GET** /api/v1/analytics/benchmarks | Benchmarks
[**benchmarksCreate**](BenchmarksApi.md#benchmarkscreate) | **POST** /api/v1/benchmarks | Create
[**benchmarksDelete**](BenchmarksApi.md#benchmarksdelete) | **DELETE** /api/v1/benchmarks/{benchmark_id} | Delete
[**benchmarksList**](BenchmarksApi.md#benchmarkslist) | **GET** /api/v1/benchmarks | List
[**benchmarksPatch**](BenchmarksApi.md#benchmarkspatch) | **PATCH** /api/v1/benchmarks/{benchmark_id} | Patch
# **benchmarksBenchmarks**
> BenchmarkComparison benchmarksBenchmarks(scope, period)
Benchmarks
The portfolio's TWR beside each benchmark's, on the same grid of days. `days_skipped` is returned on both sides and is not cosmetic: a non-zero value on either means the two chains did not cover the same days, and the difference is then an approximation of an excess return rather than one.
### Example
```dart
import 'package:fintracker_api/api.dart';
final api = FintrackerApi().getBenchmarksApi();
final String scope = scope_example; // String | all | account:<id> | portfolio:<id>
final List<String?> period = ; // List<String?> | repeatable: 1m 3m 6m ytd 1y 3y all
try {
final response = api.benchmarksBenchmarks(scope, period);
print(response);
} on DioException catch (e) {
print('Exception when calling BenchmarksApi->benchmarksBenchmarks: $e\n');
}
```
### Parameters
Name | Type | Description | Notes
------------- | ------------- | ------------- | -------------
**scope** | **String**| all | account:<id> | portfolio:<id> | [optional] [default to 'all']
**period** | [**List&lt;String?&gt;**](String.md)| repeatable: 1m 3m 6m ytd 1y 3y all | [optional]
### Return type
[**BenchmarkComparison**](BenchmarkComparison.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)
# **benchmarksCreate**
> BenchmarkOut benchmarksCreate(benchmarkCreate)
Create
### Example
```dart
import 'package:fintracker_api/api.dart';
final api = FintrackerApi().getBenchmarksApi();
final BenchmarkCreate benchmarkCreate = ; // BenchmarkCreate |
try {
final response = api.benchmarksCreate(benchmarkCreate);
print(response);
} on DioException catch (e) {
print('Exception when calling BenchmarksApi->benchmarksCreate: $e\n');
}
```
### Parameters
Name | Type | Description | Notes
------------- | ------------- | ------------- | -------------
**benchmarkCreate** | [**BenchmarkCreate**](BenchmarkCreate.md)| |
### Return type
[**BenchmarkOut**](BenchmarkOut.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)
# **benchmarksDelete**
> benchmarksDelete(benchmarkId)
Delete
### Example
```dart
import 'package:fintracker_api/api.dart';
final api = FintrackerApi().getBenchmarksApi();
final int benchmarkId = 56; // int |
try {
api.benchmarksDelete(benchmarkId);
} on DioException catch (e) {
print('Exception when calling BenchmarksApi->benchmarksDelete: $e\n');
}
```
### Parameters
Name | Type | Description | Notes
------------- | ------------- | ------------- | -------------
**benchmarkId** | **int**| |
### Return type
void (empty response body)
### Authorization
[HTTPBearer](../README.md#HTTPBearer)
### HTTP request headers
- **Content-Type**: Not defined
- **Accept**: 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)
# **benchmarksList**
> List<BenchmarkOut> benchmarksList()
List
Every benchmark, defaults first — the order the comparison block shows them in.
### Example
```dart
import 'package:fintracker_api/api.dart';
final api = FintrackerApi().getBenchmarksApi();
try {
final response = api.benchmarksList();
print(response);
} on DioException catch (e) {
print('Exception when calling BenchmarksApi->benchmarksList: $e\n');
}
```
### Parameters
This endpoint does not need any parameter.
### Return type
[**List&lt;BenchmarkOut&gt;**](BenchmarkOut.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)
# **benchmarksPatch**
> BenchmarkOut benchmarksPatch(benchmarkId, benchmarkPatch)
Patch
### Example
```dart
import 'package:fintracker_api/api.dart';
final api = FintrackerApi().getBenchmarksApi();
final int benchmarkId = 56; // int |
final BenchmarkPatch benchmarkPatch = ; // BenchmarkPatch |
try {
final response = api.benchmarksPatch(benchmarkId, benchmarkPatch);
print(response);
} on DioException catch (e) {
print('Exception when calling BenchmarksApi->benchmarksPatch: $e\n');
}
```
### Parameters
Name | Type | Description | Notes
------------- | ------------- | ------------- | -------------
**benchmarkId** | **int**| |
**benchmarkPatch** | [**BenchmarkPatch**](BenchmarkPatch.md)| |
### Return type
[**BenchmarkOut**](BenchmarkOut.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)
@@ -0,0 +1,27 @@
# fintracker_api.model.CalendarEntry
## Load the model package
```dart
import 'package:fintracker_api/api.dart';
```
## Properties
Name | Type | Description | Notes
------------ | ------------- | ------------- | -------------
**amount** | **String** | decimal as string |
**amountRub** | **String** | decimal as string |
**basis** | **String** | |
**currency** | **String** | |
**expectedDate** | [**DateTime**](DateTime.md) | |
**instrumentId** | **int** | |
**kind** | **String** | |
**name** | **String** | |
**perUnit** | **String** | decimal as string |
**qty** | **String** | decimal as string |
**recordDate** | [**DateTime**](DateTime.md) | |
**taxWithheld** | **String** | decimal as string |
**ticker** | **String** | |
[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md)
@@ -0,0 +1,19 @@
# fintracker_api.model.CalendarOut
## Load the model package
```dart
import 'package:fintracker_api/api.dart';
```
## Properties
Name | Type | Description | Notes
------------ | ------------- | ------------- | -------------
**asOf** | [**DateTime**](DateTime.md) | |
**byBasis** | **Map&lt;String, String&gt;** | |
**currency** | **String** | |
**entries** | [**List&lt;CalendarEntry&gt;**](CalendarEntry.md) | |
**totalExpectedRub** | **String** | decimal as string |
[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md)
@@ -0,0 +1,14 @@
# fintracker_api.model.CashAvailable
## Load the model package
```dart
import 'package:fintracker_api/api.dart';
```
## Properties
Name | Type | Description | Notes
------------ | ------------- | ------------- | -------------
[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md)
@@ -0,0 +1,19 @@
# fintracker_api.model.CashFlowBrokerMonth
## Load the model package
```dart
import 'package:fintracker_api/api.dart';
```
## Properties
Name | Type | Description | Notes
------------ | ------------- | ------------- | -------------
**depositsRub** | **String** | decimal as string |
**eventCount** | **int** | |
**month** | [**DateTime**](DateTime.md) | |
**netRub** | **String** | decimal as string |
**withdrawalsRub** | **String** | decimal as string |
[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md)
@@ -0,0 +1,17 @@
# fintracker_api.model.CommitRequest
## Load the model package
```dart
import 'package:fintracker_api/api.dart';
```
## Properties
Name | Type | Description | Notes
------------ | ------------- | ------------- | -------------
**accountId** | **int** | | [optional]
**confirmDuplicates** | **bool** | | [optional] [default to false]
**dryRun** | **bool** | | [optional] [default to false]
[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md)
@@ -0,0 +1,17 @@
# fintracker_api.model.ForecastMonth
## Load the model package
```dart
import 'package:fintracker_api/api.dart';
```
## Properties
Name | Type | Description | Notes
------------ | ------------- | ------------- | -------------
**amountRub** | **String** | decimal as string |
**byBasis** | **Map&lt;String, String&gt;** | |
**month** | [**DateTime**](DateTime.md) | |
[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md)
@@ -0,0 +1,18 @@
# fintracker_api.model.ForecastOut
## Load the model package
```dart
import 'package:fintracker_api/api.dart';
```
## Properties
Name | Type | Description | Notes
------------ | ------------- | ------------- | -------------
**annualYieldOnValue** | **String** | decimal as string |
**months** | [**List&lt;ForecastMonth&gt;**](ForecastMonth.md) | |
**totalRub** | **String** | decimal as string |
**warnings** | **List&lt;String&gt;** | |
[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md)
+22
View File
@@ -0,0 +1,22 @@
# fintracker_api.model.GoalCreate
## Load the model package
```dart
import 'package:fintracker_api/api.dart';
```
## Properties
Name | Type | Description | Notes
------------ | ------------- | ------------- | -------------
**archived** | **bool** | | [optional] [default to false]
**currency** | **String** | | [optional] [default to 'RUB']
**monthlyContribution** | **String** | decimal as string | [optional]
**name** | **String** | |
**note** | **String** | | [optional]
**scope** | **String** | | [optional] [default to 'all']
**targetAmount** | **String** | decimal as string |
**targetDate** | [**DateTime**](DateTime.md) | | [optional]
[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md)
+23
View File
@@ -0,0 +1,23 @@
# fintracker_api.model.GoalOut
## Load the model package
```dart
import 'package:fintracker_api/api.dart';
```
## Properties
Name | Type | Description | Notes
------------ | ------------- | ------------- | -------------
**archived** | **bool** | |
**currency** | **String** | |
**id** | **int** | |
**monthlyContribution** | **String** | decimal as string |
**name** | **String** | |
**note** | **String** | |
**scope** | **String** | |
**targetAmount** | **String** | decimal as string |
**targetDate** | [**DateTime**](DateTime.md) | |
[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md)
+22
View File
@@ -0,0 +1,22 @@
# fintracker_api.model.GoalPatch
## Load the model package
```dart
import 'package:fintracker_api/api.dart';
```
## Properties
Name | Type | Description | Notes
------------ | ------------- | ------------- | -------------
**archived** | **bool** | | [optional]
**currency** | **String** | | [optional]
**monthlyContribution** | **String** | decimal as string | [optional]
**name** | **String** | | [optional]
**note** | **String** | | [optional]
**scope** | **String** | | [optional]
**targetAmount** | **String** | decimal as string | [optional]
**targetDate** | [**DateTime**](DateTime.md) | | [optional]
[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md)
@@ -0,0 +1,24 @@
# fintracker_api.model.GoalProgressOut
## Load the model package
```dart
import 'package:fintracker_api/api.dart';
```
## Properties
Name | Type | Description | Notes
------------ | ------------- | ------------- | -------------
**asOf** | [**DateTime**](DateTime.md) | |
**assumedRate** | **String** | decimal as string |
**basis** | **String** | |
**currentValueRub** | **String** | decimal as string |
**goalId** | **int** | |
**monthlyNeededRub** | **String** | decimal as string |
**onTrack** | **bool** | |
**progress** | **String** | decimal as string |
**projectedDate** | [**DateTime**](DateTime.md) | |
**targetAmountRub** | **String** | decimal as string |
[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md)
+224
View File
@@ -0,0 +1,224 @@
# fintracker_api.api.GoalsApi
## Load the API package
```dart
import 'package:fintracker_api/api.dart';
```
All URIs are relative to *http://localhost*
Method | HTTP request | Description
------------- | ------------- | -------------
[**goalsCreate**](GoalsApi.md#goalscreate) | **POST** /api/v1/goals | Create
[**goalsDelete**](GoalsApi.md#goalsdelete) | **DELETE** /api/v1/goals/{goal_id} | Delete
[**goalsList**](GoalsApi.md#goalslist) | **GET** /api/v1/goals | List
[**goalsPatch**](GoalsApi.md#goalspatch) | **PATCH** /api/v1/goals/{goal_id} | Patch
[**goalsProgress**](GoalsApi.md#goalsprogress) | **GET** /api/v1/goals/{goal_id}/progress | Progress
# **goalsCreate**
> GoalOut goalsCreate(goalCreate)
Create
### Example
```dart
import 'package:fintracker_api/api.dart';
final api = FintrackerApi().getGoalsApi();
final GoalCreate goalCreate = ; // GoalCreate |
try {
final response = api.goalsCreate(goalCreate);
print(response);
} on DioException catch (e) {
print('Exception when calling GoalsApi->goalsCreate: $e\n');
}
```
### Parameters
Name | Type | Description | Notes
------------- | ------------- | ------------- | -------------
**goalCreate** | [**GoalCreate**](GoalCreate.md)| |
### Return type
[**GoalOut**](GoalOut.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)
# **goalsDelete**
> goalsDelete(goalId)
Delete
### Example
```dart
import 'package:fintracker_api/api.dart';
final api = FintrackerApi().getGoalsApi();
final int goalId = 56; // int |
try {
api.goalsDelete(goalId);
} on DioException catch (e) {
print('Exception when calling GoalsApi->goalsDelete: $e\n');
}
```
### Parameters
Name | Type | Description | Notes
------------- | ------------- | ------------- | -------------
**goalId** | **int**| |
### Return type
void (empty response body)
### Authorization
[HTTPBearer](../README.md#HTTPBearer)
### HTTP request headers
- **Content-Type**: Not defined
- **Accept**: 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)
# **goalsList**
> List<GoalOut> goalsList(includeArchived)
List
### Example
```dart
import 'package:fintracker_api/api.dart';
final api = FintrackerApi().getGoalsApi();
final bool includeArchived = true; // bool |
try {
final response = api.goalsList(includeArchived);
print(response);
} on DioException catch (e) {
print('Exception when calling GoalsApi->goalsList: $e\n');
}
```
### Parameters
Name | Type | Description | Notes
------------- | ------------- | ------------- | -------------
**includeArchived** | **bool**| | [optional] [default to false]
### Return type
[**List&lt;GoalOut&gt;**](GoalOut.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)
# **goalsPatch**
> GoalOut goalsPatch(goalId, goalPatch)
Patch
### Example
```dart
import 'package:fintracker_api/api.dart';
final api = FintrackerApi().getGoalsApi();
final int goalId = 56; // int |
final GoalPatch goalPatch = ; // GoalPatch |
try {
final response = api.goalsPatch(goalId, goalPatch);
print(response);
} on DioException catch (e) {
print('Exception when calling GoalsApi->goalsPatch: $e\n');
}
```
### Parameters
Name | Type | Description | Notes
------------- | ------------- | ------------- | -------------
**goalId** | **int**| |
**goalPatch** | [**GoalPatch**](GoalPatch.md)| |
### Return type
[**GoalOut**](GoalOut.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)
# **goalsProgress**
> GoalProgressOut goalsProgress(goalId)
Progress
### Example
```dart
import 'package:fintracker_api/api.dart';
final api = FintrackerApi().getGoalsApi();
final int goalId = 56; // int |
try {
final response = api.goalsProgress(goalId);
print(response);
} on DioException catch (e) {
print('Exception when calling GoalsApi->goalsProgress: $e\n');
}
```
### Parameters
Name | Type | Description | Notes
------------- | ------------- | ------------- | -------------
**goalId** | **int**| |
### Return type
[**GoalProgressOut**](GoalProgressOut.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)
+16
View File
@@ -0,0 +1,16 @@
# fintracker_api.model.HistoryOut
## Load the model package
```dart
import 'package:fintracker_api/api.dart';
```
## Properties
Name | Type | Description | Notes
------------ | ------------- | ------------- | -------------
**rows** | [**List&lt;HistoryRow&gt;**](HistoryRow.md) | |
**totals** | [**HistoryTotals**](HistoryTotals.md) | |
[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md)
+21
View File
@@ -0,0 +1,21 @@
# fintracker_api.model.HistoryRow
## Load the model package
```dart
import 'package:fintracker_api/api.dart';
```
## Properties
Name | Type | Description | Notes
------------ | ------------- | ------------- | -------------
**amount** | **String** | decimal as string |
**amountRub** | **String** | decimal as string |
**currency** | **String** | |
**kind** | **String** | |
**month** | [**DateTime**](DateTime.md) | |
**paymentCount** | **int** | |
**taxWithheld** | **String** | decimal as string |
[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md)
@@ -0,0 +1,16 @@
# fintracker_api.model.HistoryTotals
## Load the model package
```dart
import 'package:fintracker_api/api.dart';
```
## Properties
Name | Type | Description | Notes
------------ | ------------- | ------------- | -------------
**amountRub** | **String** | decimal as string |
**taxWithheldRub** | **String** | decimal as string |
[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md)
@@ -0,0 +1,21 @@
# fintracker_api.model.ImportCounts
## Load the model package
```dart
import 'package:fintracker_api/api.dart';
```
## Properties
Name | Type | Description | Notes
------------ | ------------- | ------------- | -------------
**byKind** | **Map&lt;String, int&gt;** | |
**eventsDuplicate** | **int** | |
**eventsNew** | **int** | |
**eventsPending** | **int** | |
**eventsShadow** | **int** | |
**eventsTotal** | **int** | |
**lines** | **int** | |
[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md)
@@ -0,0 +1,37 @@
# fintracker_api.model.ImportPreview
## Load the model package
```dart
import 'package:fintracker_api/api.dart';
```
## Properties
Name | Type | Description | Notes
------------ | ------------- | ------------- | -------------
**accountExternalId** | **String** | | [optional]
**accountId** | **int** | | [optional]
**accountName** | **String** | | [optional]
**accountSuggestions** | [**List&lt;AccountSuggestion&gt;**](AccountSuggestion.md) | | [optional]
**broker** | **String** | |
**committedAt** | [**DateTime**](DateTime.md) | | [optional]
**counts** | [**ImportCounts**](ImportCounts.md) | |
**duplicateOfId** | **int** | | [optional]
**error** | **String** | | [optional]
**filename** | **String** | |
**id** | **int** | |
**parseStatus** | **String** | |
**parserName** | **String** | | [optional]
**parserVersion** | **String** | | [optional]
**pendingInstruments** | [**List&lt;PendingInstrumentOut&gt;**](PendingInstrumentOut.md) | | [optional]
**periodFrom** | [**DateTime**](DateTime.md) | | [optional]
**periodTo** | [**DateTime**](DateTime.md) | | [optional]
**reconciliation** | [**ReconciliationOut**](ReconciliationOut.md) | |
**sampleEvents** | [**List&lt;SampleEventOut&gt;**](SampleEventOut.md) | | [optional]
**sha256** | **String** | |
**sizeBytes** | **int** | |
**uploadedAt** | [**DateTime**](DateTime.md) | | [optional]
**warnings** | **List&lt;String&gt;** | | [optional]
[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md)
@@ -0,0 +1,23 @@
# fintracker_api.model.ImportResult
## Load the model package
```dart
import 'package:fintracker_api/api.dart';
```
## Properties
Name | Type | Description | Notes
------------ | ------------- | ------------- | -------------
**committed** | **bool** | |
**eventsCreated** | **int** | |
**eventsShadow** | **int** | |
**eventsSkipped** | **int** | |
**eventsUpdated** | **int** | |
**importId** | **int** | |
**metricsRefreshed** | **bool** | |
**pendingInstruments** | **int** | |
**reconciliation** | [**ReconciliationOut**](ReconciliationOut.md) | |
[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md)
@@ -0,0 +1,32 @@
# fintracker_api.model.ImportSummary
## Load the model package
```dart
import 'package:fintracker_api/api.dart';
```
## Properties
Name | Type | Description | Notes
------------ | ------------- | ------------- | -------------
**accountExternalId** | **String** | | [optional]
**accountId** | **int** | | [optional]
**accountName** | **String** | | [optional]
**broker** | **String** | |
**committedAt** | [**DateTime**](DateTime.md) | | [optional]
**counts** | [**ImportCounts**](ImportCounts.md) | |
**duplicateOfId** | **int** | | [optional]
**error** | **String** | | [optional]
**filename** | **String** | |
**id** | **int** | |
**parseStatus** | **String** | |
**parserName** | **String** | | [optional]
**parserVersion** | **String** | | [optional]
**periodFrom** | [**DateTime**](DateTime.md) | | [optional]
**periodTo** | [**DateTime**](DateTime.md) | | [optional]
**sha256** | **String** | |
**sizeBytes** | **int** | |
**uploadedAt** | [**DateTime**](DateTime.md) | | [optional]
[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md)
+242
View File
@@ -0,0 +1,242 @@
# fintracker_api.api.ImportsApi
## Load the API package
```dart
import 'package:fintracker_api/api.dart';
```
All URIs are relative to *http://localhost*
Method | HTTP request | Description
------------- | ------------- | -------------
[**importsCommit**](ImportsApi.md#importscommit) | **POST** /api/v1/imports/{import_id}/commit | Commit
[**importsCreate**](ImportsApi.md#importscreate) | **POST** /api/v1/imports | Create
[**importsDelete**](ImportsApi.md#importsdelete) | **DELETE** /api/v1/imports/{import_id} | Delete
[**importsGet**](ImportsApi.md#importsget) | **GET** /api/v1/imports/{import_id} | Get
[**importsList**](ImportsApi.md#importslist) | **GET** /api/v1/imports | List
# **importsCommit**
> ImportResult importsCommit(importId, commitRequest)
Commit
Write the file's events into the ledger and rebuild every metric.
### Example
```dart
import 'package:fintracker_api/api.dart';
final api = FintrackerApi().getImportsApi();
final int importId = 56; // int |
final CommitRequest commitRequest = ; // CommitRequest |
try {
final response = api.importsCommit(importId, commitRequest);
print(response);
} on DioException catch (e) {
print('Exception when calling ImportsApi->importsCommit: $e\n');
}
```
### Parameters
Name | Type | Description | Notes
------------- | ------------- | ------------- | -------------
**importId** | **int**| |
**commitRequest** | [**CommitRequest**](CommitRequest.md)| |
### Return type
[**ImportResult**](ImportResult.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)
# **importsCreate**
> ImportPreview importsCreate(file, accountId, parser)
Create
Upload a report, parse it and show what committing it would do. Writes no event.
### Example
```dart
import 'package:fintracker_api/api.dart';
final api = FintrackerApi().getImportsApi();
final MultipartFile file = BINARY_DATA_HERE; // MultipartFile | the report itself
final int accountId = 56; // int | target account, if known
final String parser = parser_example; // String | force a parser from registry.names()
try {
final response = api.importsCreate(file, accountId, parser);
print(response);
} on DioException catch (e) {
print('Exception when calling ImportsApi->importsCreate: $e\n');
}
```
### Parameters
Name | Type | Description | Notes
------------- | ------------- | ------------- | -------------
**file** | **MultipartFile**| the report itself |
**accountId** | **int**| target account, if known | [optional]
**parser** | **String**| force a parser from registry.names() | [optional]
### Return type
[**ImportPreview**](ImportPreview.md)
### Authorization
[HTTPBearer](../README.md#HTTPBearer)
### HTTP request headers
- **Content-Type**: multipart/form-data
- **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)
# **importsDelete**
> importsDelete(importId)
Delete
Drop an uncommitted import. A committed one stays: `raw_*` is append-only.
### Example
```dart
import 'package:fintracker_api/api.dart';
final api = FintrackerApi().getImportsApi();
final int importId = 56; // int |
try {
api.importsDelete(importId);
} on DioException catch (e) {
print('Exception when calling ImportsApi->importsDelete: $e\n');
}
```
### Parameters
Name | Type | Description | Notes
------------- | ------------- | ------------- | -------------
**importId** | **int**| |
### Return type
void (empty response body)
### Authorization
[HTTPBearer](../README.md#HTTPBearer)
### HTTP request headers
- **Content-Type**: Not defined
- **Accept**: 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)
# **importsGet**
> ImportPreview importsGet(importId)
Get
The preview again — recomputed for an uncommitted import, replayed for a committed one.
### Example
```dart
import 'package:fintracker_api/api.dart';
final api = FintrackerApi().getImportsApi();
final int importId = 56; // int |
try {
final response = api.importsGet(importId);
print(response);
} on DioException catch (e) {
print('Exception when calling ImportsApi->importsGet: $e\n');
}
```
### Parameters
Name | Type | Description | Notes
------------- | ------------- | ------------- | -------------
**importId** | **int**| |
### Return type
[**ImportPreview**](ImportPreview.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)
# **importsList**
> List<ImportSummary> importsList(status, limit, offset)
List
Newest imports first, with the counters each was committed with.
### Example
```dart
import 'package:fintracker_api/api.dart';
final api = FintrackerApi().getImportsApi();
final String status = status_example; // String | uploaded | parsed | committed | failed
final int limit = 56; // int |
final int offset = 56; // int |
try {
final response = api.importsList(status, limit, offset);
print(response);
} on DioException catch (e) {
print('Exception when calling ImportsApi->importsList: $e\n');
}
```
### Parameters
Name | Type | Description | Notes
------------- | ------------- | ------------- | -------------
**status** | **String**| uploaded | parsed | committed | failed | [optional]
**limit** | **int**| | [optional] [default to 50]
**offset** | **int**| | [optional] [default to 0]
### Return type
[**List&lt;ImportSummary&gt;**](ImportSummary.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)
+161
View File
@@ -0,0 +1,161 @@
# fintracker_api.api.IncomeApi
## Load the API package
```dart
import 'package:fintracker_api/api.dart';
```
All URIs are relative to *http://localhost*
Method | HTTP request | Description
------------- | ------------- | -------------
[**incomeCalendar**](IncomeApi.md#incomecalendar) | **GET** /api/v1/income/calendar | Calendar
[**incomeForecast**](IncomeApi.md#incomeforecast) | **GET** /api/v1/income/forecast | Forecast
[**incomeHistory**](IncomeApi.md#incomehistory) | **GET** /api/v1/income/history | History
# **incomeCalendar**
> CalendarOut incomeCalendar(scope, dateFrom, dateTo, includePaid)
Calendar
Payments in a window, one row each; defaults to the next 12 months, forecast only.
### Example
```dart
import 'package:fintracker_api/api.dart';
final api = FintrackerApi().getIncomeApi();
final String scope = scope_example; // String | all | account:<id> | portfolio:<id>
final DateTime dateFrom = 2013-10-20; // DateTime |
final DateTime dateTo = 2013-10-20; // DateTime |
final bool includePaid = true; // bool |
try {
final response = api.incomeCalendar(scope, dateFrom, dateTo, includePaid);
print(response);
} on DioException catch (e) {
print('Exception when calling IncomeApi->incomeCalendar: $e\n');
}
```
### Parameters
Name | Type | Description | Notes
------------- | ------------- | ------------- | -------------
**scope** | **String**| all | account:<id> | portfolio:<id> | [optional] [default to 'all']
**dateFrom** | **DateTime**| | [optional]
**dateTo** | **DateTime**| | [optional]
**includePaid** | **bool**| | [optional] [default to false]
### Return type
[**CalendarOut**](CalendarOut.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)
# **incomeForecast**
> ForecastOut incomeForecast(scope, months)
Forecast
Expected income per month, split by basis, plus the yield it implies.
### Example
```dart
import 'package:fintracker_api/api.dart';
final api = FintrackerApi().getIncomeApi();
final String scope = scope_example; // String | all | account:<id> | portfolio:<id>
final int months = 56; // int |
try {
final response = api.incomeForecast(scope, months);
print(response);
} on DioException catch (e) {
print('Exception when calling IncomeApi->incomeForecast: $e\n');
}
```
### Parameters
Name | Type | Description | Notes
------------- | ------------- | ------------- | -------------
**scope** | **String**| all | account:<id> | portfolio:<id> | [optional] [default to 'all']
**months** | **int**| | [optional] [default to 12]
### Return type
[**ForecastOut**](ForecastOut.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)
# **incomeHistory**
> HistoryOut incomeHistory(scope, group, dateFrom, dateTo, kind)
History
Income actually received, grouped by month, kind and currency. `group` exists for the contract's sake and accepts only `month`: the table is stored monthly, and a finer grouping would have to re-read the ledger, which is what the calendar's `paid` rows already do per payment.
### Example
```dart
import 'package:fintracker_api/api.dart';
final api = FintrackerApi().getIncomeApi();
final String scope = scope_example; // String | all | account:<id> | portfolio:<id>
final String group = group_example; // String | month
final DateTime dateFrom = 2013-10-20; // DateTime |
final DateTime dateTo = 2013-10-20; // DateTime |
final String kind = kind_example; // String | dividend | coupon | …
try {
final response = api.incomeHistory(scope, group, dateFrom, dateTo, kind);
print(response);
} on DioException catch (e) {
print('Exception when calling IncomeApi->incomeHistory: $e\n');
}
```
### Parameters
Name | Type | Description | Notes
------------- | ------------- | ------------- | -------------
**scope** | **String**| all | account:<id> | portfolio:<id> | [optional] [default to 'all']
**group** | **String**| month | [optional] [default to 'month']
**dateFrom** | **DateTime**| | [optional]
**dateTo** | **DateTime**| | [optional]
**kind** | **String**| dividend | coupon | … | [optional]
### Return type
[**HistoryOut**](HistoryOut.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)
@@ -11,6 +11,9 @@ Method | HTTP request | Description
------------- | ------------- | -------------
[**instrumentsGet**](InstrumentsApi.md#instrumentsget) | **GET** /api/v1/instruments/{instrument_id} | Get
[**instrumentsList**](InstrumentsApi.md#instrumentslist) | **GET** /api/v1/instruments | List
[**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**
@@ -107,3 +110,140 @@ Name | Type | Description | Notes
[[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&lt;PendingInstrumentOut&gt;**](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)
+16
View File
@@ -0,0 +1,16 @@
# fintracker_api.model.LinkCreate
## Load the model package
```dart
import 'package:fintracker_api/api.dart';
```
## Properties
Name | Type | Description | Notes
------------ | ------------- | ------------- | -------------
**cashTxnId** | **int** | |
**eventId** | **int** | |
[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md)
+23
View File
@@ -0,0 +1,23 @@
# fintracker_api.model.LinkOut
## Load the model package
```dart
import 'package:fintracker_api/api.dart';
```
## Properties
Name | Type | Description | Notes
------------ | ------------- | ------------- | -------------
**amountDelta** | **String** | decimal as string |
**cashTxnId** | **int** | |
**confidence** | **String** | decimal as string |
**currency** | **String** | |
**dayGap** | **int** | |
**eventId** | **int** | |
**id** | **int** | |
**kind** | **String** | |
**note** | **String** | |
[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md)
+140
View File
@@ -0,0 +1,140 @@
# fintracker_api.api.LinksApi
## Load the API package
```dart
import 'package:fintracker_api/api.dart';
```
All URIs are relative to *http://localhost*
Method | HTTP request | Description
------------- | ------------- | -------------
[**linksCreate**](LinksApi.md#linkscreate) | **POST** /api/v1/links | Create
[**linksDelete**](LinksApi.md#linksdelete) | **DELETE** /api/v1/links/{link_id} | Delete
[**linksUnmatched**](LinksApi.md#linksunmatched) | **GET** /api/v1/links/unmatched | Unmatched
# **linksCreate**
> LinkOut linksCreate(linkCreate)
Create
Confirm a pairing the matcher missed. Never touched by the automatic rebuild afterwards.
### Example
```dart
import 'package:fintracker_api/api.dart';
final api = FintrackerApi().getLinksApi();
final LinkCreate linkCreate = ; // LinkCreate |
try {
final response = api.linksCreate(linkCreate);
print(response);
} on DioException catch (e) {
print('Exception when calling LinksApi->linksCreate: $e\n');
}
```
### Parameters
Name | Type | Description | Notes
------------- | ------------- | ------------- | -------------
**linkCreate** | [**LinkCreate**](LinkCreate.md)| |
### Return type
[**LinkOut**](LinkOut.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)
# **linksDelete**
> linksDelete(linkId)
Delete
Undo a link, manual or automatic. `flow_type` reverts on the next `POST /metrics/refresh`, when `classify` rebuilds it from the rules and `matching` no longer overwrites it.
### Example
```dart
import 'package:fintracker_api/api.dart';
final api = FintrackerApi().getLinksApi();
final int linkId = 56; // int |
try {
api.linksDelete(linkId);
} on DioException catch (e) {
print('Exception when calling LinksApi->linksDelete: $e\n');
}
```
### Parameters
Name | Type | Description | Notes
------------- | ------------- | ------------- | -------------
**linkId** | **int**| |
### Return type
void (empty response body)
### Authorization
[HTTPBearer](../README.md#HTTPBearer)
### HTTP request headers
- **Content-Type**: Not defined
- **Accept**: 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)
# **linksUnmatched**
> UnmatchedOut linksUnmatched()
Unmatched
Every candidate that survives matching without a link, on either side.
### Example
```dart
import 'package:fintracker_api/api.dart';
final api = FintrackerApi().getLinksApi();
try {
final response = api.linksUnmatched();
print(response);
} on DioException catch (e) {
print('Exception when calling LinksApi->linksUnmatched: $e\n');
}
```
### Parameters
This endpoint does not need any parameter.
### Return type
[**UnmatchedOut**](UnmatchedOut.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)
@@ -0,0 +1,21 @@
# fintracker_api.model.NewInstrument
## Load the model package
```dart
import 'package:fintracker_api/api.dart';
```
## Properties
Name | Type | Description | Notes
------------ | ------------- | ------------- | -------------
**assetClass** | **String** | |
**board** | **String** | | [optional]
**currency** | **String** | | [optional] [default to 'RUB']
**isin** | **String** | | [optional]
**lot** | **int** | | [optional] [default to 1]
**name** | **String** | |
**ticker** | **String** | | [optional]
[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md)
@@ -0,0 +1,30 @@
# fintracker_api.model.PendingInstrumentOut
## Load the model package
```dart
import 'package:fintracker_api/api.dart';
```
## Properties
Name | Type | Description | Notes
------------ | ------------- | ------------- | -------------
**assetClassHint** | **String** | | [optional]
**board** | **String** | | [optional]
**createdAt** | [**DateTime**](DateTime.md) | | [optional]
**currency** | **String** | | [optional]
**firstSeenFileId** | **int** | | [optional]
**id** | **int** | |
**instrumentId** | **int** | | [optional]
**isin** | **String** | | [optional]
**name** | **String** | | [optional]
**occurrences** | **int** | |
**samplePrice** | **String** | decimal as string | [optional]
**sampleQuantity** | **String** | decimal as string | [optional]
**source_** | **String** | |
**sourceKey** | **String** | |
**status** | **String** | |
**ticker** | **String** | | [optional]
[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md)
@@ -0,0 +1,17 @@
# fintracker_api.model.PendingResolveRequest
## Load the model package
```dart
import 'package:fintracker_api/api.dart';
```
## Properties
Name | Type | Description | Notes
------------ | ------------- | ------------- | -------------
**action** | **String** | |
**instrument** | [**NewInstrument**](NewInstrument.md) | | [optional]
**instrumentId** | **int** | | [optional]
[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md)
@@ -0,0 +1,20 @@
# fintracker_api.model.PendingResolveResult
## Load the model package
```dart
import 'package:fintracker_api/api.dart';
```
## Properties
Name | Type | Description | Notes
------------ | ------------- | ------------- | -------------
**aliasCreated** | **bool** | |
**eventsBound** | **int** | |
**id** | **int** | |
**instrumentId** | **int** | | [optional]
**metricsRefreshed** | **bool** | |
**status** | **String** | |
[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md)
@@ -0,0 +1,18 @@
# fintracker_api.model.PriceManualIn
## Load the model package
```dart
import 'package:fintracker_api/api.dart';
```
## Properties
Name | Type | Description | Notes
------------ | ------------- | ------------- | -------------
**currency** | **String** | |
**d** | [**DateTime**](DateTime.md) | |
**note** | **String** | | [optional]
**price** | **String** | decimal as string |
[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md)
@@ -0,0 +1,20 @@
# fintracker_api.model.PriceManualOut
## Load the model package
```dart
import 'package:fintracker_api/api.dart';
```
## Properties
Name | Type | Description | Notes
------------ | ------------- | ------------- | -------------
**currency** | **String** | |
**d** | [**DateTime**](DateTime.md) | |
**id** | **int** | |
**instrumentId** | **int** | |
**note** | **String** | |
**price** | **String** | decimal as string |
[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md)
@@ -12,6 +12,7 @@ Name | Type | Description | Notes
**close** | **String** | decimal as string |
**currency** | **String** | |
**d** | [**DateTime**](DateTime.md) | |
**source_** | **String** | | [optional] [default to 'daily']
[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md)
+149
View File
@@ -0,0 +1,149 @@
# 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)
@@ -0,0 +1,22 @@
# fintracker_api.model.RebalanceBucketOut
## Load the model package
```dart
import 'package:fintracker_api/api.dart';
```
## Properties
Name | Type | Description | Notes
------------ | ------------- | ------------- | -------------
**bucket** | **String** | |
**currentValueRub** | **String** | decimal as string |
**currentWeight** | **String** | decimal as string |
**deltaValueRub** | **String** | decimal as string |
**drift** | **String** | decimal as string |
**targetWeight** | **String** | decimal as string |
**trades** | [**List&lt;TradeOut&gt;**](TradeOut.md) | |
**withinBand** | **bool** | |
[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md)
@@ -0,0 +1,21 @@
# fintracker_api.model.RebalanceOut
## Load the model package
```dart
import 'package:fintracker_api/api.dart';
```
## Properties
Name | Type | Description | Notes
------------ | ------------- | ------------- | -------------
**asOf** | [**DateTime**](DateTime.md) | |
**buckets** | [**List&lt;RebalanceBucketOut&gt;**](RebalanceBucketOut.md) | |
**cashAvailableRub** | **String** | decimal as string |
**dimension** | **String** | |
**portfolioId** | **int** | |
**totalValueRub** | **String** | decimal as string |
**warnings** | **List&lt;String&gt;** | |
[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md)
@@ -0,0 +1,19 @@
# fintracker_api.model.ReconciliationCash
## Load the model package
```dart
import 'package:fintracker_api/api.dart';
```
## Properties
Name | Type | Description | Notes
------------ | ------------- | ------------- | -------------
**balanceDerived** | **String** | decimal as string |
**balanceReport** | **String** | decimal as string |
**currency** | **String** | |
**delta** | **String** | decimal as string |
**matches** | **bool** | |
[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md)
@@ -0,0 +1,18 @@
# fintracker_api.model.ReconciliationOut
## Load the model package
```dart
import 'package:fintracker_api/api.dart';
```
## Properties
Name | Type | Description | Notes
------------ | ------------- | ------------- | -------------
**asOf** | [**DateTime**](DateTime.md) | |
**cash** | [**List&lt;ReconciliationCash&gt;**](ReconciliationCash.md) | | [optional]
**matches** | **bool** | | [optional] [default to true]
**positions** | [**List&lt;ReconciliationPosition&gt;**](ReconciliationPosition.md) | | [optional]
[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md)
@@ -0,0 +1,22 @@
# fintracker_api.model.ReconciliationPosition
## Load the model package
```dart
import 'package:fintracker_api/api.dart';
```
## Properties
Name | Type | Description | Notes
------------ | ------------- | ------------- | -------------
**instrumentId** | **int** | |
**instrumentName** | **String** | |
**isin** | **String** | |
**matches** | **bool** | |
**qtyDelta** | **String** | decimal as string |
**qtyDerived** | **String** | decimal as string |
**qtyReport** | **String** | decimal as string |
**ticker** | **String** | |
[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md)
@@ -0,0 +1,30 @@
# fintracker_api.model.SampleEventOut
## Load the model package
```dart
import 'package:fintracker_api/api.dart';
```
## Properties
Name | Type | Description | Notes
------------ | ------------- | ------------- | -------------
**amount** | **String** | decimal as string |
**currency** | **String** | |
**dedupeKey** | **String** | |
**description** | **String** | | [optional]
**fee** | **String** | decimal as string | [optional]
**instrumentId** | **int** | | [optional]
**instrumentKey** | **String** | | [optional]
**instrumentName** | **String** | | [optional]
**isDuplicate** | **bool** | |
**kind** | **String** | |
**lineNo** | **int** | |
**price** | **String** | decimal as string | [optional]
**quantity** | **String** | decimal as string | [optional]
**settleDate** | [**DateTime**](DateTime.md) | | [optional]
**tradeDate** | [**DateTime**](DateTime.md) | |
**tradeNo** | **String** | | [optional]
[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md)
+18
View File
@@ -0,0 +1,18 @@
# fintracker_api.model.TargetIn
## Load the model package
```dart
import 'package:fintracker_api/api.dart';
```
## Properties
Name | Type | Description | Notes
------------ | ------------- | ------------- | -------------
**band** | **String** | decimal as string | [optional]
**bucket** | **String** | |
**note** | **String** | | [optional]
**targetWeight** | **String** | decimal as string |
[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md)
+18
View File
@@ -0,0 +1,18 @@
# fintracker_api.model.TargetOut
## Load the model package
```dart
import 'package:fintracker_api/api.dart';
```
## Properties
Name | Type | Description | Notes
------------ | ------------- | ------------- | -------------
**band** | **String** | decimal as string |
**bucket** | **String** | |
**note** | **String** | |
**targetWeight** | **String** | decimal as string |
[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md)
+16
View File
@@ -0,0 +1,16 @@
# fintracker_api.model.TargetsIn
## Load the model package
```dart
import 'package:fintracker_api/api.dart';
```
## Properties
Name | Type | Description | Notes
------------ | ------------- | ------------- | -------------
**dimension** | **String** | asset_class | sector | country | currency |
**targets** | [**List&lt;TargetIn&gt;**](TargetIn.md) | |
[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md)
+18
View File
@@ -0,0 +1,18 @@
# fintracker_api.model.TargetsOut
## Load the model package
```dart
import 'package:fintracker_api/api.dart';
```
## Properties
Name | Type | Description | Notes
------------ | ------------- | ------------- | -------------
**dimension** | **String** | |
**portfolioId** | **int** | |
**targets** | [**List&lt;TargetOut&gt;**](TargetOut.md) | |
**weightsSum** | **String** | decimal as string |
[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md)
@@ -0,0 +1,24 @@
# fintracker_api.model.TaxAccountOut
## Load the model package
```dart
import 'package:fintracker_api/api.dart';
```
## Properties
Name | Type | Description | Notes
------------ | ------------- | ------------- | -------------
**accountId** | **int** | |
**accountName** | **String** | |
**couponsGrossRub** | **String** | decimal as string |
**dividendsGrossRub** | **String** | decimal as string |
**estimatedTaxRub** | **String** | decimal as string |
**ldvExemptRub** | **String** | decimal as string |
**realizedGainRub** | **String** | decimal as string |
**realizedLossRub** | **String** | decimal as string |
**taxWithheldRub** | **String** | decimal as string |
**taxableBaseRub** | **String** | decimal as string |
[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md)
+105
View File
@@ -0,0 +1,105 @@
# fintracker_api.api.TaxApi
## Load the API package
```dart
import 'package:fintracker_api/api.dart';
```
All URIs are relative to *http://localhost*
Method | HTTP request | Description
------------- | ------------- | -------------
[**taxLots**](TaxApi.md#taxlots) | **GET** /api/v1/tax/lots | Lots
[**taxSummary**](TaxApi.md#taxsummary) | **GET** /api/v1/tax | Summary
# **taxLots**
> TaxLotsOut taxLots(year, accountId)
Lots
Open lots with the date after which a sale falls under the long-term exemption. `year` selects the rate the \"what if I sold today\" figure is computed at; the lots themselves are always the ones open right now. `lot` is rebuilt from the ledger on every refresh and holds today's state only, so there is no honest way to answer \"which lots were open on 31 December two years ago\" — and inventing one would be worse than the limitation.
### Example
```dart
import 'package:fintracker_api/api.dart';
final api = FintrackerApi().getTaxApi();
final int year = 56; // int |
final int accountId = 56; // int |
try {
final response = api.taxLots(year, accountId);
print(response);
} on DioException catch (e) {
print('Exception when calling TaxApi->taxLots: $e\n');
}
```
### Parameters
Name | Type | Description | Notes
------------- | ------------- | ------------- | -------------
**year** | **int**| | [optional]
**accountId** | **int**| | [optional]
### Return type
[**TaxLotsOut**](TaxLotsOut.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)
# **taxSummary**
> TaxYearOut taxSummary(year, accountId)
Summary
The year's estimated tax position, per account and in total.
### Example
```dart
import 'package:fintracker_api/api.dart';
final api = FintrackerApi().getTaxApi();
final int year = 56; // int |
final int accountId = 56; // int |
try {
final response = api.taxSummary(year, accountId);
print(response);
} on DioException catch (e) {
print('Exception when calling TaxApi->taxSummary: $e\n');
}
```
### Parameters
Name | Type | Description | Notes
------------- | ------------- | ------------- | -------------
**year** | **int**| | [optional]
**accountId** | **int**| | [optional]
### Return type
[**TaxYearOut**](TaxYearOut.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)
+29
View File
@@ -0,0 +1,29 @@
# fintracker_api.model.TaxLotOut
## Load the model package
```dart
import 'package:fintracker_api/api.dart';
```
## Properties
Name | Type | Description | Notes
------------ | ------------- | ------------- | -------------
**accountId** | **int** | |
**accountName** | **String** | |
**costRub** | **String** | decimal as string |
**daysToLdv** | **int** | |
**instrumentId** | **int** | |
**ldvDate** | [**DateTime**](DateTime.md) | |
**ldvEligible** | **bool** | |
**lotId** | **int** | |
**marketValueRub** | **String** | decimal as string |
**name** | **String** | |
**openDate** | [**DateTime**](DateTime.md) | |
**qtyRemaining** | **String** | decimal as string |
**taxIfSoldNowRub** | **String** | decimal as string |
**ticker** | **String** | |
**unrealizedGainRub** | **String** | decimal as string |
[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md)
+20
View File
@@ -0,0 +1,20 @@
# fintracker_api.model.TaxLotsOut
## Load the model package
```dart
import 'package:fintracker_api/api.dart';
```
## Properties
Name | Type | Description | Notes
------------ | ------------- | ------------- | -------------
**asOf** | [**DateTime**](DateTime.md) | |
**disclaimer** | **String** | |
**estimated** | **bool** | | [optional] [default to true]
**lots** | [**List&lt;TaxLotOut&gt;**](TaxLotOut.md) | |
**taxRate** | **String** | decimal as string |
**year** | **int** | |
[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md)
+22
View File
@@ -0,0 +1,22 @@
# fintracker_api.model.TaxTotals
## Load the model package
```dart
import 'package:fintracker_api/api.dart';
```
## Properties
Name | Type | Description | Notes
------------ | ------------- | ------------- | -------------
**couponsGrossRub** | **String** | decimal as string |
**dividendsGrossRub** | **String** | decimal as string |
**estimatedTaxRub** | **String** | decimal as string |
**ldvExemptRub** | **String** | decimal as string |
**realizedGainRub** | **String** | decimal as string |
**realizedLossRub** | **String** | decimal as string |
**taxWithheldRub** | **String** | decimal as string |
**taxableBaseRub** | **String** | decimal as string |
[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md)
+20
View File
@@ -0,0 +1,20 @@
# fintracker_api.model.TaxYearOut
## Load the model package
```dart
import 'package:fintracker_api/api.dart';
```
## Properties
Name | Type | Description | Notes
------------ | ------------- | ------------- | -------------
**accounts** | [**List&lt;TaxAccountOut&gt;**](TaxAccountOut.md) | |
**disclaimer** | **String** | |
**estimated** | **bool** | | [optional] [default to true]
**taxRate** | **String** | decimal as string |
**totals** | [**TaxTotals**](TaxTotals.md) | |
**year** | **int** | |
[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md)
+24
View File
@@ -0,0 +1,24 @@
# fintracker_api.model.TradeOut
## Load the model package
```dart
import 'package:fintracker_api/api.dart';
```
## Properties
Name | Type | Description | Notes
------------ | ------------- | ------------- | -------------
**action** | **String** | |
**amountRub** | **String** | decimal as string |
**blockedByCash** | **bool** | |
**instrumentId** | **int** | |
**lot** | **int** | |
**name** | **String** | |
**price** | **String** | decimal as string |
**priceCurrency** | **String** | |
**suggestedQty** | **String** | decimal as string |
**ticker** | **String** | |
[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md)
@@ -0,0 +1,20 @@
# fintracker_api.model.UnmatchedBrokerOut
## Load the model package
```dart
import 'package:fintracker_api/api.dart';
```
## Properties
Name | Type | Description | Notes
------------ | ------------- | ------------- | -------------
**accountId** | **int** | |
**amount** | **String** | decimal as string |
**currency** | **String** | |
**date** | [**DateTime**](DateTime.md) | |
**direction** | **String** | |
**eventId** | **int** | |
[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md)
@@ -0,0 +1,16 @@
# fintracker_api.model.UnmatchedOut
## Load the model package
```dart
import 'package:fintracker_api/api.dart';
```
## Properties
Name | Type | Description | Notes
------------ | ------------- | ------------- | -------------
**broker** | [**List&lt;UnmatchedBrokerOut&gt;**](UnmatchedBrokerOut.md) | |
**zm** | [**List&lt;UnmatchedZmOut&gt;**](UnmatchedZmOut.md) | |
[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md)
@@ -0,0 +1,23 @@
# fintracker_api.model.UnmatchedZmOut
## Load the model package
```dart
import 'package:fintracker_api/api.dart';
```
## Properties
Name | Type | Description | Notes
------------ | ------------- | ------------- | -------------
**amount** | **String** | decimal as string |
**brokerAccountId** | **int** | |
**cashTxnId** | **int** | |
**comment** | **String** | |
**currency** | **String** | |
**date** | [**DateTime**](DateTime.md) | |
**direction** | **String** | |
**payee** | **String** | |
**route** | **String** | |
[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md)
@@ -12,15 +12,22 @@ export 'package:fintracker_api/src/auth/oauth.dart';
export 'package:fintracker_api/src/api/accounts_api.dart';
export 'package:fintracker_api/src/api/analytics_api.dart';
export 'package:fintracker_api/src/api/auth_api.dart';
export 'package:fintracker_api/src/api/benchmarks_api.dart';
export 'package:fintracker_api/src/api/cashflow_api.dart';
export 'package:fintracker_api/src/api/categories_api.dart';
export 'package:fintracker_api/src/api/events_api.dart';
export 'package:fintracker_api/src/api/goals_api.dart';
export 'package:fintracker_api/src/api/health_api.dart';
export 'package:fintracker_api/src/api/imports_api.dart';
export 'package:fintracker_api/src/api/income_api.dart';
export 'package:fintracker_api/src/api/instruments_api.dart';
export 'package:fintracker_api/src/api/links_api.dart';
export 'package:fintracker_api/src/api/metrics_api.dart';
export 'package:fintracker_api/src/api/networth_api.dart';
export 'package:fintracker_api/src/api/rebalance_api.dart';
export 'package:fintracker_api/src/api/rules_api.dart';
export 'package:fintracker_api/src/api/sync_api.dart';
export 'package:fintracker_api/src/api/tax_api.dart';
export 'package:fintracker_api/src/api/transactions_api.dart';
export 'package:fintracker_api/src/model/account_balance.dart';
@@ -28,11 +35,23 @@ export 'package:fintracker_api/src/model/account_kind.dart';
export 'package:fintracker_api/src/model/account_out.dart';
export 'package:fintracker_api/src/model/account_patch.dart';
export 'package:fintracker_api/src/model/account_role.dart';
export 'package:fintracker_api/src/model/account_suggestion.dart';
export 'package:fintracker_api/src/model/allocation_bucket.dart';
export 'package:fintracker_api/src/model/allocation_dimension.dart';
export 'package:fintracker_api/src/model/benchmark_comparison.dart';
export 'package:fintracker_api/src/model/benchmark_comparison_out.dart';
export 'package:fintracker_api/src/model/benchmark_create.dart';
export 'package:fintracker_api/src/model/benchmark_out.dart';
export 'package:fintracker_api/src/model/benchmark_patch.dart';
export 'package:fintracker_api/src/model/benchmark_return_out.dart';
export 'package:fintracker_api/src/model/broker.dart';
export 'package:fintracker_api/src/model/calendar_entry.dart';
export 'package:fintracker_api/src/model/calendar_out.dart';
export 'package:fintracker_api/src/model/cash_available.dart';
export 'package:fintracker_api/src/model/cash_flow_broker_month.dart';
export 'package:fintracker_api/src/model/cash_flow_month.dart';
export 'package:fintracker_api/src/model/category_out.dart';
export 'package:fintracker_api/src/model/commit_request.dart';
export 'package:fintracker_api/src/model/data_quality_row.dart';
export 'package:fintracker_api/src/model/event_kind.dart';
export 'package:fintracker_api/src/model/event_out.dart';
@@ -40,17 +59,43 @@ export 'package:fintracker_api/src/model/event_page.dart';
export 'package:fintracker_api/src/model/event_source.dart';
export 'package:fintracker_api/src/model/event_status.dart';
export 'package:fintracker_api/src/model/flow_type.dart';
export 'package:fintracker_api/src/model/forecast_month.dart';
export 'package:fintracker_api/src/model/forecast_out.dart';
export 'package:fintracker_api/src/model/goal_create.dart';
export 'package:fintracker_api/src/model/goal_out.dart';
export 'package:fintracker_api/src/model/goal_patch.dart';
export 'package:fintracker_api/src/model/goal_progress_out.dart';
export 'package:fintracker_api/src/model/health.dart';
export 'package:fintracker_api/src/model/history_out.dart';
export 'package:fintracker_api/src/model/history_row.dart';
export 'package:fintracker_api/src/model/history_totals.dart';
export 'package:fintracker_api/src/model/holding_out.dart';
export 'package:fintracker_api/src/model/import_counts.dart';
export 'package:fintracker_api/src/model/import_preview.dart';
export 'package:fintracker_api/src/model/import_result.dart';
export 'package:fintracker_api/src/model/import_summary.dart';
export 'package:fintracker_api/src/model/instrument_detail.dart';
export 'package:fintracker_api/src/model/instrument_out.dart';
export 'package:fintracker_api/src/model/job_status.dart';
export 'package:fintracker_api/src/model/link_create.dart';
export 'package:fintracker_api/src/model/link_out.dart';
export 'package:fintracker_api/src/model/login_request.dart';
export 'package:fintracker_api/src/model/lot_out.dart';
export 'package:fintracker_api/src/model/net_worth_breakdown.dart';
export 'package:fintracker_api/src/model/net_worth_day.dart';
export 'package:fintracker_api/src/model/new_instrument.dart';
export 'package:fintracker_api/src/model/pending_instrument_out.dart';
export 'package:fintracker_api/src/model/pending_resolve_request.dart';
export 'package:fintracker_api/src/model/pending_resolve_result.dart';
export 'package:fintracker_api/src/model/price_manual_in.dart';
export 'package:fintracker_api/src/model/price_manual_out.dart';
export 'package:fintracker_api/src/model/price_point.dart';
export 'package:fintracker_api/src/model/problem.dart';
export 'package:fintracker_api/src/model/rebalance_bucket_out.dart';
export 'package:fintracker_api/src/model/rebalance_out.dart';
export 'package:fintracker_api/src/model/reconciliation_cash.dart';
export 'package:fintracker_api/src/model/reconciliation_out.dart';
export 'package:fintracker_api/src/model/reconciliation_position.dart';
export 'package:fintracker_api/src/model/refresh_log_out.dart';
export 'package:fintracker_api/src/model/refresh_request.dart';
export 'package:fintracker_api/src/model/returns_out.dart';
@@ -61,15 +106,29 @@ export 'package:fintracker_api/src/model/rule_out.dart';
export 'package:fintracker_api/src/model/rule_patch.dart';
export 'package:fintracker_api/src/model/run_status.dart';
export 'package:fintracker_api/src/model/runway_out.dart';
export 'package:fintracker_api/src/model/sample_event_out.dart';
export 'package:fintracker_api/src/model/scope_out.dart';
export 'package:fintracker_api/src/model/source_status.dart';
export 'package:fintracker_api/src/model/spending_row.dart';
export 'package:fintracker_api/src/model/summary_out.dart';
export 'package:fintracker_api/src/model/sync_job_out.dart';
export 'package:fintracker_api/src/model/sync_run_out.dart';
export 'package:fintracker_api/src/model/target_in.dart';
export 'package:fintracker_api/src/model/target_out.dart';
export 'package:fintracker_api/src/model/targets_in.dart';
export 'package:fintracker_api/src/model/targets_out.dart';
export 'package:fintracker_api/src/model/tax_account_out.dart';
export 'package:fintracker_api/src/model/tax_lot_out.dart';
export 'package:fintracker_api/src/model/tax_lots_out.dart';
export 'package:fintracker_api/src/model/tax_totals.dart';
export 'package:fintracker_api/src/model/tax_year_out.dart';
export 'package:fintracker_api/src/model/token_pair.dart';
export 'package:fintracker_api/src/model/trade_out.dart';
export 'package:fintracker_api/src/model/transaction_out.dart';
export 'package:fintracker_api/src/model/transaction_page.dart';
export 'package:fintracker_api/src/model/unmatched_broker_out.dart';
export 'package:fintracker_api/src/model/unmatched_out.dart';
export 'package:fintracker_api/src/model/unmatched_zm_out.dart';
export 'package:fintracker_api/src/model/user_out.dart';
export 'package:fintracker_api/src/model/value_day.dart';
+49
View File
@@ -10,15 +10,22 @@ import 'package:fintracker_api/src/auth/oauth.dart';
import 'package:fintracker_api/src/api/accounts_api.dart';
import 'package:fintracker_api/src/api/analytics_api.dart';
import 'package:fintracker_api/src/api/auth_api.dart';
import 'package:fintracker_api/src/api/benchmarks_api.dart';
import 'package:fintracker_api/src/api/cashflow_api.dart';
import 'package:fintracker_api/src/api/categories_api.dart';
import 'package:fintracker_api/src/api/events_api.dart';
import 'package:fintracker_api/src/api/goals_api.dart';
import 'package:fintracker_api/src/api/health_api.dart';
import 'package:fintracker_api/src/api/imports_api.dart';
import 'package:fintracker_api/src/api/income_api.dart';
import 'package:fintracker_api/src/api/instruments_api.dart';
import 'package:fintracker_api/src/api/links_api.dart';
import 'package:fintracker_api/src/api/metrics_api.dart';
import 'package:fintracker_api/src/api/networth_api.dart';
import 'package:fintracker_api/src/api/rebalance_api.dart';
import 'package:fintracker_api/src/api/rules_api.dart';
import 'package:fintracker_api/src/api/sync_api.dart';
import 'package:fintracker_api/src/api/tax_api.dart';
import 'package:fintracker_api/src/api/transactions_api.dart';
class FintrackerApi {
@@ -130,6 +137,12 @@ class FintrackerApi {
return AuthApi(dio);
}
/// Get BenchmarksApi instance, base route and serializer can be overridden by a given but be careful,
/// by doing that all interceptors will not be executed
BenchmarksApi getBenchmarksApi() {
return BenchmarksApi(dio);
}
/// Get CashflowApi instance, base route and serializer can be overridden by a given but be careful,
/// by doing that all interceptors will not be executed
CashflowApi getCashflowApi() {
@@ -148,18 +161,42 @@ class FintrackerApi {
return EventsApi(dio);
}
/// Get GoalsApi instance, base route and serializer can be overridden by a given but be careful,
/// by doing that all interceptors will not be executed
GoalsApi getGoalsApi() {
return GoalsApi(dio);
}
/// Get HealthApi instance, base route and serializer can be overridden by a given but be careful,
/// by doing that all interceptors will not be executed
HealthApi getHealthApi() {
return HealthApi(dio);
}
/// Get ImportsApi instance, base route and serializer can be overridden by a given but be careful,
/// by doing that all interceptors will not be executed
ImportsApi getImportsApi() {
return ImportsApi(dio);
}
/// Get IncomeApi instance, base route and serializer can be overridden by a given but be careful,
/// by doing that all interceptors will not be executed
IncomeApi getIncomeApi() {
return IncomeApi(dio);
}
/// Get InstrumentsApi instance, base route and serializer can be overridden by a given but be careful,
/// by doing that all interceptors will not be executed
InstrumentsApi getInstrumentsApi() {
return InstrumentsApi(dio);
}
/// Get LinksApi instance, base route and serializer can be overridden by a given but be careful,
/// by doing that all interceptors will not be executed
LinksApi getLinksApi() {
return LinksApi(dio);
}
/// Get MetricsApi instance, base route and serializer can be overridden by a given but be careful,
/// by doing that all interceptors will not be executed
MetricsApi getMetricsApi() {
@@ -172,6 +209,12 @@ class FintrackerApi {
return NetworthApi(dio);
}
/// Get RebalanceApi instance, base route and serializer can be overridden by a given but be careful,
/// by doing that all interceptors will not be executed
RebalanceApi getRebalanceApi() {
return RebalanceApi(dio);
}
/// Get RulesApi instance, base route and serializer can be overridden by a given but be careful,
/// by doing that all interceptors will not be executed
RulesApi getRulesApi() {
@@ -184,6 +227,12 @@ class FintrackerApi {
return SyncApi(dio);
}
/// Get TaxApi instance, base route and serializer can be overridden by a given but be careful,
/// by doing that all interceptors will not be executed
TaxApi getTaxApi() {
return TaxApi(dio);
}
/// Get TransactionsApi instance, base route and serializer can be overridden by a given but be careful,
/// by doing that all interceptors will not be executed
TransactionsApi getTransactionsApi() {
@@ -11,6 +11,7 @@ import 'package:dio/dio.dart';
import 'package:fintracker_api/src/model/allocation_bucket.dart';
import 'package:fintracker_api/src/model/allocation_dimension.dart';
import 'package:fintracker_api/src/model/cash_flow_broker_month.dart';
import 'package:fintracker_api/src/model/holding_out.dart';
import 'package:fintracker_api/src/model/problem.dart';
import 'package:fintracker_api/src/model/returns_out.dart';
@@ -110,6 +111,89 @@ _responseData = rawData == null ? null : deserialize<List<AllocationBucket>, All
);
}
/// Cashflow Broker
/// Money moved across the brokerage boundary, by month: the other half of cash flow that &#x60;metric_cash_flow_monthly&#x60; (ZenMoney spending) does not cover.
///
/// Parameters:
/// * [scope] - all | account:<id> | portfolio:<id>
/// * [cancelToken] - A [CancelToken] that can be used to cancel the operation
/// * [headers] - Can be used to add additional headers to the request
/// * [extras] - Can be used to add flags to the request
/// * [validateStatus] - A [ValidateStatus] callback that can be used to determine request success based on the HTTP status of the response
/// * [onSendProgress] - A [ProgressCallback] that can be used to get the send progress
/// * [onReceiveProgress] - A [ProgressCallback] that can be used to get the receive progress
///
/// Returns a [Future] containing a [Response] with a [List<CashFlowBrokerMonth>] as data
/// Throws [DioException] if API call or serialization fails
Future<Response<List<CashFlowBrokerMonth>>> analyticsCashflowBroker({
String? scope = 'all',
CancelToken? cancelToken,
Map<String, dynamic>? headers,
Map<String, dynamic>? extra,
ValidateStatus? validateStatus,
ProgressCallback? onSendProgress,
ProgressCallback? onReceiveProgress,
}) async {
final _path = r'/api/v1/analytics/cashflow-broker';
final _options = Options(
method: r'GET',
headers: <String, dynamic>{
...?headers,
},
extra: <String, dynamic>{
'secure': <Map<String, String>>[
{
'type': 'http',
'scheme': 'bearer',
'name': 'HTTPBearer',
},
],
...?extra,
},
validateStatus: validateStatus,
);
final _queryParameters = <String, dynamic>{
if (scope != null) r'scope': scope,
};
final _response = await _dio.request<Object>(
_path,
options: _options,
queryParameters: _queryParameters,
cancelToken: cancelToken,
onSendProgress: onSendProgress,
onReceiveProgress: onReceiveProgress,
);
List<CashFlowBrokerMonth>? _responseData;
try {
final rawData = _response.data;
_responseData = rawData == null ? null : deserialize<List<CashFlowBrokerMonth>, CashFlowBrokerMonth>(rawData, 'List<CashFlowBrokerMonth>', growable: true);
} catch (error, stackTrace) {
throw DioException(
requestOptions: _response.requestOptions,
response: _response,
type: DioExceptionType.unknown,
error: error,
stackTrace: stackTrace,
);
}
return Response<List<CashFlowBrokerMonth>>(
data: _responseData,
headers: _response.headers,
isRedirect: _response.isRedirect,
requestOptions: _response.requestOptions,
redirects: _response.redirects,
statusCode: _response.statusCode,
statusMessage: _response.statusMessage,
extra: _response.extra,
);
}
/// Holdings
/// Open positions, most valuable first; unpriced ones last with null values.
///
@@ -0,0 +1,435 @@
//
// AUTO-GENERATED FILE, DO NOT MODIFY!
//
import 'dart:async';
// ignore: unused_import
import 'dart:convert';
import 'package:fintracker_api/src/deserialize.dart';
import 'package:dio/dio.dart';
import 'package:fintracker_api/src/model/benchmark_comparison.dart';
import 'package:fintracker_api/src/model/benchmark_create.dart';
import 'package:fintracker_api/src/model/benchmark_out.dart';
import 'package:fintracker_api/src/model/benchmark_patch.dart';
import 'package:fintracker_api/src/model/problem.dart';
class BenchmarksApi {
final Dio _dio;
const BenchmarksApi(this._dio);
/// Benchmarks
/// The portfolio&#39;s TWR beside each benchmark&#39;s, on the same grid of days. &#x60;days_skipped&#x60; is returned on both sides and is not cosmetic: a non-zero value on either means the two chains did not cover the same days, and the difference is then an approximation of an excess return rather than one.
///
/// Parameters:
/// * [scope] - all | account:<id> | portfolio:<id>
/// * [period] - repeatable: 1m 3m 6m ytd 1y 3y all
/// * [cancelToken] - A [CancelToken] that can be used to cancel the operation
/// * [headers] - Can be used to add additional headers to the request
/// * [extras] - Can be used to add flags to the request
/// * [validateStatus] - A [ValidateStatus] callback that can be used to determine request success based on the HTTP status of the response
/// * [onSendProgress] - A [ProgressCallback] that can be used to get the send progress
/// * [onReceiveProgress] - A [ProgressCallback] that can be used to get the receive progress
///
/// Returns a [Future] containing a [Response] with a [BenchmarkComparison] as data
/// Throws [DioException] if API call or serialization fails
Future<Response<BenchmarkComparison>> benchmarksBenchmarks({
String? scope = 'all',
List<String?>? period,
CancelToken? cancelToken,
Map<String, dynamic>? headers,
Map<String, dynamic>? extra,
ValidateStatus? validateStatus,
ProgressCallback? onSendProgress,
ProgressCallback? onReceiveProgress,
}) async {
final _path = r'/api/v1/analytics/benchmarks';
final _options = Options(
method: r'GET',
headers: <String, dynamic>{
...?headers,
},
extra: <String, dynamic>{
'secure': <Map<String, String>>[
{
'type': 'http',
'scheme': 'bearer',
'name': 'HTTPBearer',
},
],
...?extra,
},
validateStatus: validateStatus,
);
final _queryParameters = <String, dynamic>{
if (scope != null) r'scope': scope,
if (period != null) r'period': period,
};
final _response = await _dio.request<Object>(
_path,
options: _options,
queryParameters: _queryParameters,
cancelToken: cancelToken,
onSendProgress: onSendProgress,
onReceiveProgress: onReceiveProgress,
);
BenchmarkComparison? _responseData;
try {
final rawData = _response.data;
_responseData = rawData == null ? null : deserialize<BenchmarkComparison, BenchmarkComparison>(rawData, 'BenchmarkComparison', growable: true);
} catch (error, stackTrace) {
throw DioException(
requestOptions: _response.requestOptions,
response: _response,
type: DioExceptionType.unknown,
error: error,
stackTrace: stackTrace,
);
}
return Response<BenchmarkComparison>(
data: _responseData,
headers: _response.headers,
isRedirect: _response.isRedirect,
requestOptions: _response.requestOptions,
redirects: _response.redirects,
statusCode: _response.statusCode,
statusMessage: _response.statusMessage,
extra: _response.extra,
);
}
/// Create
///
///
/// Parameters:
/// * [benchmarkCreate]
/// * [cancelToken] - A [CancelToken] that can be used to cancel the operation
/// * [headers] - Can be used to add additional headers to the request
/// * [extras] - Can be used to add flags to the request
/// * [validateStatus] - A [ValidateStatus] callback that can be used to determine request success based on the HTTP status of the response
/// * [onSendProgress] - A [ProgressCallback] that can be used to get the send progress
/// * [onReceiveProgress] - A [ProgressCallback] that can be used to get the receive progress
///
/// Returns a [Future] containing a [Response] with a [BenchmarkOut] as data
/// Throws [DioException] if API call or serialization fails
Future<Response<BenchmarkOut>> benchmarksCreate({
required BenchmarkCreate benchmarkCreate,
CancelToken? cancelToken,
Map<String, dynamic>? headers,
Map<String, dynamic>? extra,
ValidateStatus? validateStatus,
ProgressCallback? onSendProgress,
ProgressCallback? onReceiveProgress,
}) async {
final _path = r'/api/v1/benchmarks';
final _options = Options(
method: r'POST',
headers: <String, dynamic>{
...?headers,
},
extra: <String, dynamic>{
'secure': <Map<String, String>>[
{
'type': 'http',
'scheme': 'bearer',
'name': 'HTTPBearer',
},
],
...?extra,
},
contentType: 'application/json',
validateStatus: validateStatus,
);
dynamic _bodyData;
try {
_bodyData = jsonEncode(benchmarkCreate);
} catch(error, stackTrace) {
throw DioException(
requestOptions: _options.compose(
_dio.options,
_path,
),
type: DioExceptionType.unknown,
error: error,
stackTrace: stackTrace,
);
}
final _response = await _dio.request<Object>(
_path,
data: _bodyData,
options: _options,
cancelToken: cancelToken,
onSendProgress: onSendProgress,
onReceiveProgress: onReceiveProgress,
);
BenchmarkOut? _responseData;
try {
final rawData = _response.data;
_responseData = rawData == null ? null : deserialize<BenchmarkOut, BenchmarkOut>(rawData, 'BenchmarkOut', growable: true);
} catch (error, stackTrace) {
throw DioException(
requestOptions: _response.requestOptions,
response: _response,
type: DioExceptionType.unknown,
error: error,
stackTrace: stackTrace,
);
}
return Response<BenchmarkOut>(
data: _responseData,
headers: _response.headers,
isRedirect: _response.isRedirect,
requestOptions: _response.requestOptions,
redirects: _response.redirects,
statusCode: _response.statusCode,
statusMessage: _response.statusMessage,
extra: _response.extra,
);
}
/// Delete
///
///
/// Parameters:
/// * [benchmarkId]
/// * [cancelToken] - A [CancelToken] that can be used to cancel the operation
/// * [headers] - Can be used to add additional headers to the request
/// * [extras] - Can be used to add flags to the request
/// * [validateStatus] - A [ValidateStatus] callback that can be used to determine request success based on the HTTP status of the response
/// * [onSendProgress] - A [ProgressCallback] that can be used to get the send progress
/// * [onReceiveProgress] - A [ProgressCallback] that can be used to get the receive progress
///
/// Returns a [Future]
/// Throws [DioException] if API call or serialization fails
Future<Response<void>> benchmarksDelete({
required int benchmarkId,
CancelToken? cancelToken,
Map<String, dynamic>? headers,
Map<String, dynamic>? extra,
ValidateStatus? validateStatus,
ProgressCallback? onSendProgress,
ProgressCallback? onReceiveProgress,
}) async {
final _path = r'/api/v1/benchmarks/{benchmark_id}'.replaceAll('{' r'benchmark_id' '}', benchmarkId.toString());
final _options = Options(
method: r'DELETE',
headers: <String, dynamic>{
...?headers,
},
extra: <String, dynamic>{
'secure': <Map<String, String>>[
{
'type': 'http',
'scheme': 'bearer',
'name': 'HTTPBearer',
},
],
...?extra,
},
validateStatus: validateStatus,
);
final _response = await _dio.request<Object>(
_path,
options: _options,
cancelToken: cancelToken,
onSendProgress: onSendProgress,
onReceiveProgress: onReceiveProgress,
);
return _response;
}
/// List
/// Every benchmark, defaults first — the order the comparison block shows them in.
///
/// Parameters:
/// * [cancelToken] - A [CancelToken] that can be used to cancel the operation
/// * [headers] - Can be used to add additional headers to the request
/// * [extras] - Can be used to add flags to the request
/// * [validateStatus] - A [ValidateStatus] callback that can be used to determine request success based on the HTTP status of the response
/// * [onSendProgress] - A [ProgressCallback] that can be used to get the send progress
/// * [onReceiveProgress] - A [ProgressCallback] that can be used to get the receive progress
///
/// Returns a [Future] containing a [Response] with a [List<BenchmarkOut>] as data
/// Throws [DioException] if API call or serialization fails
Future<Response<List<BenchmarkOut>>> benchmarksList({
CancelToken? cancelToken,
Map<String, dynamic>? headers,
Map<String, dynamic>? extra,
ValidateStatus? validateStatus,
ProgressCallback? onSendProgress,
ProgressCallback? onReceiveProgress,
}) async {
final _path = r'/api/v1/benchmarks';
final _options = Options(
method: r'GET',
headers: <String, dynamic>{
...?headers,
},
extra: <String, dynamic>{
'secure': <Map<String, String>>[
{
'type': 'http',
'scheme': 'bearer',
'name': 'HTTPBearer',
},
],
...?extra,
},
validateStatus: validateStatus,
);
final _response = await _dio.request<Object>(
_path,
options: _options,
cancelToken: cancelToken,
onSendProgress: onSendProgress,
onReceiveProgress: onReceiveProgress,
);
List<BenchmarkOut>? _responseData;
try {
final rawData = _response.data;
_responseData = rawData == null ? null : deserialize<List<BenchmarkOut>, BenchmarkOut>(rawData, 'List<BenchmarkOut>', growable: true);
} catch (error, stackTrace) {
throw DioException(
requestOptions: _response.requestOptions,
response: _response,
type: DioExceptionType.unknown,
error: error,
stackTrace: stackTrace,
);
}
return Response<List<BenchmarkOut>>(
data: _responseData,
headers: _response.headers,
isRedirect: _response.isRedirect,
requestOptions: _response.requestOptions,
redirects: _response.redirects,
statusCode: _response.statusCode,
statusMessage: _response.statusMessage,
extra: _response.extra,
);
}
/// Patch
///
///
/// Parameters:
/// * [benchmarkId]
/// * [benchmarkPatch]
/// * [cancelToken] - A [CancelToken] that can be used to cancel the operation
/// * [headers] - Can be used to add additional headers to the request
/// * [extras] - Can be used to add flags to the request
/// * [validateStatus] - A [ValidateStatus] callback that can be used to determine request success based on the HTTP status of the response
/// * [onSendProgress] - A [ProgressCallback] that can be used to get the send progress
/// * [onReceiveProgress] - A [ProgressCallback] that can be used to get the receive progress
///
/// Returns a [Future] containing a [Response] with a [BenchmarkOut] as data
/// Throws [DioException] if API call or serialization fails
Future<Response<BenchmarkOut>> benchmarksPatch({
required int benchmarkId,
required BenchmarkPatch benchmarkPatch,
CancelToken? cancelToken,
Map<String, dynamic>? headers,
Map<String, dynamic>? extra,
ValidateStatus? validateStatus,
ProgressCallback? onSendProgress,
ProgressCallback? onReceiveProgress,
}) async {
final _path = r'/api/v1/benchmarks/{benchmark_id}'.replaceAll('{' r'benchmark_id' '}', benchmarkId.toString());
final _options = Options(
method: r'PATCH',
headers: <String, dynamic>{
...?headers,
},
extra: <String, dynamic>{
'secure': <Map<String, String>>[
{
'type': 'http',
'scheme': 'bearer',
'name': 'HTTPBearer',
},
],
...?extra,
},
contentType: 'application/json',
validateStatus: validateStatus,
);
dynamic _bodyData;
try {
_bodyData = jsonEncode(benchmarkPatch);
} catch(error, stackTrace) {
throw DioException(
requestOptions: _options.compose(
_dio.options,
_path,
),
type: DioExceptionType.unknown,
error: error,
stackTrace: stackTrace,
);
}
final _response = await _dio.request<Object>(
_path,
data: _bodyData,
options: _options,
cancelToken: cancelToken,
onSendProgress: onSendProgress,
onReceiveProgress: onReceiveProgress,
);
BenchmarkOut? _responseData;
try {
final rawData = _response.data;
_responseData = rawData == null ? null : deserialize<BenchmarkOut, BenchmarkOut>(rawData, 'BenchmarkOut', growable: true);
} catch (error, stackTrace) {
throw DioException(
requestOptions: _response.requestOptions,
response: _response,
type: DioExceptionType.unknown,
error: error,
stackTrace: stackTrace,
);
}
return Response<BenchmarkOut>(
data: _responseData,
headers: _response.headers,
isRedirect: _response.isRedirect,
requestOptions: _response.requestOptions,
redirects: _response.redirects,
statusCode: _response.statusCode,
statusMessage: _response.statusMessage,
extra: _response.extra,
);
}
}
@@ -0,0 +1,434 @@
//
// AUTO-GENERATED FILE, DO NOT MODIFY!
//
import 'dart:async';
// ignore: unused_import
import 'dart:convert';
import 'package:fintracker_api/src/deserialize.dart';
import 'package:dio/dio.dart';
import 'package:fintracker_api/src/model/goal_create.dart';
import 'package:fintracker_api/src/model/goal_out.dart';
import 'package:fintracker_api/src/model/goal_patch.dart';
import 'package:fintracker_api/src/model/goal_progress_out.dart';
import 'package:fintracker_api/src/model/problem.dart';
class GoalsApi {
final Dio _dio;
const GoalsApi(this._dio);
/// Create
///
///
/// Parameters:
/// * [goalCreate]
/// * [cancelToken] - A [CancelToken] that can be used to cancel the operation
/// * [headers] - Can be used to add additional headers to the request
/// * [extras] - Can be used to add flags to the request
/// * [validateStatus] - A [ValidateStatus] callback that can be used to determine request success based on the HTTP status of the response
/// * [onSendProgress] - A [ProgressCallback] that can be used to get the send progress
/// * [onReceiveProgress] - A [ProgressCallback] that can be used to get the receive progress
///
/// Returns a [Future] containing a [Response] with a [GoalOut] as data
/// Throws [DioException] if API call or serialization fails
Future<Response<GoalOut>> goalsCreate({
required GoalCreate goalCreate,
CancelToken? cancelToken,
Map<String, dynamic>? headers,
Map<String, dynamic>? extra,
ValidateStatus? validateStatus,
ProgressCallback? onSendProgress,
ProgressCallback? onReceiveProgress,
}) async {
final _path = r'/api/v1/goals';
final _options = Options(
method: r'POST',
headers: <String, dynamic>{
...?headers,
},
extra: <String, dynamic>{
'secure': <Map<String, String>>[
{
'type': 'http',
'scheme': 'bearer',
'name': 'HTTPBearer',
},
],
...?extra,
},
contentType: 'application/json',
validateStatus: validateStatus,
);
dynamic _bodyData;
try {
_bodyData = jsonEncode(goalCreate);
} catch(error, stackTrace) {
throw DioException(
requestOptions: _options.compose(
_dio.options,
_path,
),
type: DioExceptionType.unknown,
error: error,
stackTrace: stackTrace,
);
}
final _response = await _dio.request<Object>(
_path,
data: _bodyData,
options: _options,
cancelToken: cancelToken,
onSendProgress: onSendProgress,
onReceiveProgress: onReceiveProgress,
);
GoalOut? _responseData;
try {
final rawData = _response.data;
_responseData = rawData == null ? null : deserialize<GoalOut, GoalOut>(rawData, 'GoalOut', growable: true);
} catch (error, stackTrace) {
throw DioException(
requestOptions: _response.requestOptions,
response: _response,
type: DioExceptionType.unknown,
error: error,
stackTrace: stackTrace,
);
}
return Response<GoalOut>(
data: _responseData,
headers: _response.headers,
isRedirect: _response.isRedirect,
requestOptions: _response.requestOptions,
redirects: _response.redirects,
statusCode: _response.statusCode,
statusMessage: _response.statusMessage,
extra: _response.extra,
);
}
/// Delete
///
///
/// Parameters:
/// * [goalId]
/// * [cancelToken] - A [CancelToken] that can be used to cancel the operation
/// * [headers] - Can be used to add additional headers to the request
/// * [extras] - Can be used to add flags to the request
/// * [validateStatus] - A [ValidateStatus] callback that can be used to determine request success based on the HTTP status of the response
/// * [onSendProgress] - A [ProgressCallback] that can be used to get the send progress
/// * [onReceiveProgress] - A [ProgressCallback] that can be used to get the receive progress
///
/// Returns a [Future]
/// Throws [DioException] if API call or serialization fails
Future<Response<void>> goalsDelete({
required int goalId,
CancelToken? cancelToken,
Map<String, dynamic>? headers,
Map<String, dynamic>? extra,
ValidateStatus? validateStatus,
ProgressCallback? onSendProgress,
ProgressCallback? onReceiveProgress,
}) async {
final _path = r'/api/v1/goals/{goal_id}'.replaceAll('{' r'goal_id' '}', goalId.toString());
final _options = Options(
method: r'DELETE',
headers: <String, dynamic>{
...?headers,
},
extra: <String, dynamic>{
'secure': <Map<String, String>>[
{
'type': 'http',
'scheme': 'bearer',
'name': 'HTTPBearer',
},
],
...?extra,
},
validateStatus: validateStatus,
);
final _response = await _dio.request<Object>(
_path,
options: _options,
cancelToken: cancelToken,
onSendProgress: onSendProgress,
onReceiveProgress: onReceiveProgress,
);
return _response;
}
/// List
///
///
/// Parameters:
/// * [includeArchived]
/// * [cancelToken] - A [CancelToken] that can be used to cancel the operation
/// * [headers] - Can be used to add additional headers to the request
/// * [extras] - Can be used to add flags to the request
/// * [validateStatus] - A [ValidateStatus] callback that can be used to determine request success based on the HTTP status of the response
/// * [onSendProgress] - A [ProgressCallback] that can be used to get the send progress
/// * [onReceiveProgress] - A [ProgressCallback] that can be used to get the receive progress
///
/// Returns a [Future] containing a [Response] with a [List<GoalOut>] as data
/// Throws [DioException] if API call or serialization fails
Future<Response<List<GoalOut>>> goalsList({
bool? includeArchived = false,
CancelToken? cancelToken,
Map<String, dynamic>? headers,
Map<String, dynamic>? extra,
ValidateStatus? validateStatus,
ProgressCallback? onSendProgress,
ProgressCallback? onReceiveProgress,
}) async {
final _path = r'/api/v1/goals';
final _options = Options(
method: r'GET',
headers: <String, dynamic>{
...?headers,
},
extra: <String, dynamic>{
'secure': <Map<String, String>>[
{
'type': 'http',
'scheme': 'bearer',
'name': 'HTTPBearer',
},
],
...?extra,
},
validateStatus: validateStatus,
);
final _queryParameters = <String, dynamic>{
if (includeArchived != null) r'include_archived': includeArchived,
};
final _response = await _dio.request<Object>(
_path,
options: _options,
queryParameters: _queryParameters,
cancelToken: cancelToken,
onSendProgress: onSendProgress,
onReceiveProgress: onReceiveProgress,
);
List<GoalOut>? _responseData;
try {
final rawData = _response.data;
_responseData = rawData == null ? null : deserialize<List<GoalOut>, GoalOut>(rawData, 'List<GoalOut>', growable: true);
} catch (error, stackTrace) {
throw DioException(
requestOptions: _response.requestOptions,
response: _response,
type: DioExceptionType.unknown,
error: error,
stackTrace: stackTrace,
);
}
return Response<List<GoalOut>>(
data: _responseData,
headers: _response.headers,
isRedirect: _response.isRedirect,
requestOptions: _response.requestOptions,
redirects: _response.redirects,
statusCode: _response.statusCode,
statusMessage: _response.statusMessage,
extra: _response.extra,
);
}
/// Patch
///
///
/// Parameters:
/// * [goalId]
/// * [goalPatch]
/// * [cancelToken] - A [CancelToken] that can be used to cancel the operation
/// * [headers] - Can be used to add additional headers to the request
/// * [extras] - Can be used to add flags to the request
/// * [validateStatus] - A [ValidateStatus] callback that can be used to determine request success based on the HTTP status of the response
/// * [onSendProgress] - A [ProgressCallback] that can be used to get the send progress
/// * [onReceiveProgress] - A [ProgressCallback] that can be used to get the receive progress
///
/// Returns a [Future] containing a [Response] with a [GoalOut] as data
/// Throws [DioException] if API call or serialization fails
Future<Response<GoalOut>> goalsPatch({
required int goalId,
required GoalPatch goalPatch,
CancelToken? cancelToken,
Map<String, dynamic>? headers,
Map<String, dynamic>? extra,
ValidateStatus? validateStatus,
ProgressCallback? onSendProgress,
ProgressCallback? onReceiveProgress,
}) async {
final _path = r'/api/v1/goals/{goal_id}'.replaceAll('{' r'goal_id' '}', goalId.toString());
final _options = Options(
method: r'PATCH',
headers: <String, dynamic>{
...?headers,
},
extra: <String, dynamic>{
'secure': <Map<String, String>>[
{
'type': 'http',
'scheme': 'bearer',
'name': 'HTTPBearer',
},
],
...?extra,
},
contentType: 'application/json',
validateStatus: validateStatus,
);
dynamic _bodyData;
try {
_bodyData = jsonEncode(goalPatch);
} catch(error, stackTrace) {
throw DioException(
requestOptions: _options.compose(
_dio.options,
_path,
),
type: DioExceptionType.unknown,
error: error,
stackTrace: stackTrace,
);
}
final _response = await _dio.request<Object>(
_path,
data: _bodyData,
options: _options,
cancelToken: cancelToken,
onSendProgress: onSendProgress,
onReceiveProgress: onReceiveProgress,
);
GoalOut? _responseData;
try {
final rawData = _response.data;
_responseData = rawData == null ? null : deserialize<GoalOut, GoalOut>(rawData, 'GoalOut', growable: true);
} catch (error, stackTrace) {
throw DioException(
requestOptions: _response.requestOptions,
response: _response,
type: DioExceptionType.unknown,
error: error,
stackTrace: stackTrace,
);
}
return Response<GoalOut>(
data: _responseData,
headers: _response.headers,
isRedirect: _response.isRedirect,
requestOptions: _response.requestOptions,
redirects: _response.redirects,
statusCode: _response.statusCode,
statusMessage: _response.statusMessage,
extra: _response.extra,
);
}
/// Progress
///
///
/// Parameters:
/// * [goalId]
/// * [cancelToken] - A [CancelToken] that can be used to cancel the operation
/// * [headers] - Can be used to add additional headers to the request
/// * [extras] - Can be used to add flags to the request
/// * [validateStatus] - A [ValidateStatus] callback that can be used to determine request success based on the HTTP status of the response
/// * [onSendProgress] - A [ProgressCallback] that can be used to get the send progress
/// * [onReceiveProgress] - A [ProgressCallback] that can be used to get the receive progress
///
/// Returns a [Future] containing a [Response] with a [GoalProgressOut] as data
/// Throws [DioException] if API call or serialization fails
Future<Response<GoalProgressOut>> goalsProgress({
required int goalId,
CancelToken? cancelToken,
Map<String, dynamic>? headers,
Map<String, dynamic>? extra,
ValidateStatus? validateStatus,
ProgressCallback? onSendProgress,
ProgressCallback? onReceiveProgress,
}) async {
final _path = r'/api/v1/goals/{goal_id}/progress'.replaceAll('{' r'goal_id' '}', goalId.toString());
final _options = Options(
method: r'GET',
headers: <String, dynamic>{
...?headers,
},
extra: <String, dynamic>{
'secure': <Map<String, String>>[
{
'type': 'http',
'scheme': 'bearer',
'name': 'HTTPBearer',
},
],
...?extra,
},
validateStatus: validateStatus,
);
final _response = await _dio.request<Object>(
_path,
options: _options,
cancelToken: cancelToken,
onSendProgress: onSendProgress,
onReceiveProgress: onReceiveProgress,
);
GoalProgressOut? _responseData;
try {
final rawData = _response.data;
_responseData = rawData == null ? null : deserialize<GoalProgressOut, GoalProgressOut>(rawData, 'GoalProgressOut', growable: true);
} catch (error, stackTrace) {
throw DioException(
requestOptions: _response.requestOptions,
response: _response,
type: DioExceptionType.unknown,
error: error,
stackTrace: stackTrace,
);
}
return Response<GoalProgressOut>(
data: _responseData,
headers: _response.headers,
isRedirect: _response.isRedirect,
requestOptions: _response.requestOptions,
redirects: _response.redirects,
statusCode: _response.statusCode,
statusMessage: _response.statusMessage,
extra: _response.extra,
);
}
}
@@ -0,0 +1,448 @@
//
// AUTO-GENERATED FILE, DO NOT MODIFY!
//
import 'dart:async';
// ignore: unused_import
import 'dart:convert';
import 'package:fintracker_api/src/deserialize.dart';
import 'package:dio/dio.dart';
import 'package:fintracker_api/src/model/commit_request.dart';
import 'package:fintracker_api/src/model/import_preview.dart';
import 'package:fintracker_api/src/model/import_result.dart';
import 'package:fintracker_api/src/model/import_summary.dart';
import 'package:fintracker_api/src/model/problem.dart';
class ImportsApi {
final Dio _dio;
const ImportsApi(this._dio);
/// Commit
/// Write the file&#39;s events into the ledger and rebuild every metric.
///
/// Parameters:
/// * [importId]
/// * [commitRequest]
/// * [cancelToken] - A [CancelToken] that can be used to cancel the operation
/// * [headers] - Can be used to add additional headers to the request
/// * [extras] - Can be used to add flags to the request
/// * [validateStatus] - A [ValidateStatus] callback that can be used to determine request success based on the HTTP status of the response
/// * [onSendProgress] - A [ProgressCallback] that can be used to get the send progress
/// * [onReceiveProgress] - A [ProgressCallback] that can be used to get the receive progress
///
/// Returns a [Future] containing a [Response] with a [ImportResult] as data
/// Throws [DioException] if API call or serialization fails
Future<Response<ImportResult>> importsCommit({
required int importId,
required CommitRequest commitRequest,
CancelToken? cancelToken,
Map<String, dynamic>? headers,
Map<String, dynamic>? extra,
ValidateStatus? validateStatus,
ProgressCallback? onSendProgress,
ProgressCallback? onReceiveProgress,
}) async {
final _path = r'/api/v1/imports/{import_id}/commit'.replaceAll('{' r'import_id' '}', importId.toString());
final _options = Options(
method: r'POST',
headers: <String, dynamic>{
...?headers,
},
extra: <String, dynamic>{
'secure': <Map<String, String>>[
{
'type': 'http',
'scheme': 'bearer',
'name': 'HTTPBearer',
},
],
...?extra,
},
contentType: 'application/json',
validateStatus: validateStatus,
);
dynamic _bodyData;
try {
_bodyData = jsonEncode(commitRequest);
} catch(error, stackTrace) {
throw DioException(
requestOptions: _options.compose(
_dio.options,
_path,
),
type: DioExceptionType.unknown,
error: error,
stackTrace: stackTrace,
);
}
final _response = await _dio.request<Object>(
_path,
data: _bodyData,
options: _options,
cancelToken: cancelToken,
onSendProgress: onSendProgress,
onReceiveProgress: onReceiveProgress,
);
ImportResult? _responseData;
try {
final rawData = _response.data;
_responseData = rawData == null ? null : deserialize<ImportResult, ImportResult>(rawData, 'ImportResult', growable: true);
} catch (error, stackTrace) {
throw DioException(
requestOptions: _response.requestOptions,
response: _response,
type: DioExceptionType.unknown,
error: error,
stackTrace: stackTrace,
);
}
return Response<ImportResult>(
data: _responseData,
headers: _response.headers,
isRedirect: _response.isRedirect,
requestOptions: _response.requestOptions,
redirects: _response.redirects,
statusCode: _response.statusCode,
statusMessage: _response.statusMessage,
extra: _response.extra,
);
}
/// Create
/// Upload a report, parse it and show what committing it would do. Writes no event.
///
/// Parameters:
/// * [file] - the report itself
/// * [accountId] - target account, if known
/// * [parser] - force a parser from registry.names()
/// * [cancelToken] - A [CancelToken] that can be used to cancel the operation
/// * [headers] - Can be used to add additional headers to the request
/// * [extras] - Can be used to add flags to the request
/// * [validateStatus] - A [ValidateStatus] callback that can be used to determine request success based on the HTTP status of the response
/// * [onSendProgress] - A [ProgressCallback] that can be used to get the send progress
/// * [onReceiveProgress] - A [ProgressCallback] that can be used to get the receive progress
///
/// Returns a [Future] containing a [Response] with a [ImportPreview] as data
/// Throws [DioException] if API call or serialization fails
Future<Response<ImportPreview>> importsCreate({
required MultipartFile file,
int? accountId,
String? parser,
CancelToken? cancelToken,
Map<String, dynamic>? headers,
Map<String, dynamic>? extra,
ValidateStatus? validateStatus,
ProgressCallback? onSendProgress,
ProgressCallback? onReceiveProgress,
}) async {
final _path = r'/api/v1/imports';
final _options = Options(
method: r'POST',
headers: <String, dynamic>{
...?headers,
},
extra: <String, dynamic>{
'secure': <Map<String, String>>[
{
'type': 'http',
'scheme': 'bearer',
'name': 'HTTPBearer',
},
],
...?extra,
},
contentType: 'multipart/form-data',
validateStatus: validateStatus,
);
dynamic _bodyData;
try {
_bodyData = FormData.fromMap(<String, dynamic>{
r'account_id': accountId,
r'file': file,
r'parser': parser,
});
} catch(error, stackTrace) {
throw DioException(
requestOptions: _options.compose(
_dio.options,
_path,
),
type: DioExceptionType.unknown,
error: error,
stackTrace: stackTrace,
);
}
final _response = await _dio.request<Object>(
_path,
data: _bodyData,
options: _options,
cancelToken: cancelToken,
onSendProgress: onSendProgress,
onReceiveProgress: onReceiveProgress,
);
ImportPreview? _responseData;
try {
final rawData = _response.data;
_responseData = rawData == null ? null : deserialize<ImportPreview, ImportPreview>(rawData, 'ImportPreview', growable: true);
} catch (error, stackTrace) {
throw DioException(
requestOptions: _response.requestOptions,
response: _response,
type: DioExceptionType.unknown,
error: error,
stackTrace: stackTrace,
);
}
return Response<ImportPreview>(
data: _responseData,
headers: _response.headers,
isRedirect: _response.isRedirect,
requestOptions: _response.requestOptions,
redirects: _response.redirects,
statusCode: _response.statusCode,
statusMessage: _response.statusMessage,
extra: _response.extra,
);
}
/// Delete
/// Drop an uncommitted import. A committed one stays: &#x60;raw_*&#x60; is append-only.
///
/// Parameters:
/// * [importId]
/// * [cancelToken] - A [CancelToken] that can be used to cancel the operation
/// * [headers] - Can be used to add additional headers to the request
/// * [extras] - Can be used to add flags to the request
/// * [validateStatus] - A [ValidateStatus] callback that can be used to determine request success based on the HTTP status of the response
/// * [onSendProgress] - A [ProgressCallback] that can be used to get the send progress
/// * [onReceiveProgress] - A [ProgressCallback] that can be used to get the receive progress
///
/// Returns a [Future]
/// Throws [DioException] if API call or serialization fails
Future<Response<void>> importsDelete({
required int importId,
CancelToken? cancelToken,
Map<String, dynamic>? headers,
Map<String, dynamic>? extra,
ValidateStatus? validateStatus,
ProgressCallback? onSendProgress,
ProgressCallback? onReceiveProgress,
}) async {
final _path = r'/api/v1/imports/{import_id}'.replaceAll('{' r'import_id' '}', importId.toString());
final _options = Options(
method: r'DELETE',
headers: <String, dynamic>{
...?headers,
},
extra: <String, dynamic>{
'secure': <Map<String, String>>[
{
'type': 'http',
'scheme': 'bearer',
'name': 'HTTPBearer',
},
],
...?extra,
},
validateStatus: validateStatus,
);
final _response = await _dio.request<Object>(
_path,
options: _options,
cancelToken: cancelToken,
onSendProgress: onSendProgress,
onReceiveProgress: onReceiveProgress,
);
return _response;
}
/// Get
/// The preview again — recomputed for an uncommitted import, replayed for a committed one.
///
/// Parameters:
/// * [importId]
/// * [cancelToken] - A [CancelToken] that can be used to cancel the operation
/// * [headers] - Can be used to add additional headers to the request
/// * [extras] - Can be used to add flags to the request
/// * [validateStatus] - A [ValidateStatus] callback that can be used to determine request success based on the HTTP status of the response
/// * [onSendProgress] - A [ProgressCallback] that can be used to get the send progress
/// * [onReceiveProgress] - A [ProgressCallback] that can be used to get the receive progress
///
/// Returns a [Future] containing a [Response] with a [ImportPreview] as data
/// Throws [DioException] if API call or serialization fails
Future<Response<ImportPreview>> importsGet({
required int importId,
CancelToken? cancelToken,
Map<String, dynamic>? headers,
Map<String, dynamic>? extra,
ValidateStatus? validateStatus,
ProgressCallback? onSendProgress,
ProgressCallback? onReceiveProgress,
}) async {
final _path = r'/api/v1/imports/{import_id}'.replaceAll('{' r'import_id' '}', importId.toString());
final _options = Options(
method: r'GET',
headers: <String, dynamic>{
...?headers,
},
extra: <String, dynamic>{
'secure': <Map<String, String>>[
{
'type': 'http',
'scheme': 'bearer',
'name': 'HTTPBearer',
},
],
...?extra,
},
validateStatus: validateStatus,
);
final _response = await _dio.request<Object>(
_path,
options: _options,
cancelToken: cancelToken,
onSendProgress: onSendProgress,
onReceiveProgress: onReceiveProgress,
);
ImportPreview? _responseData;
try {
final rawData = _response.data;
_responseData = rawData == null ? null : deserialize<ImportPreview, ImportPreview>(rawData, 'ImportPreview', growable: true);
} catch (error, stackTrace) {
throw DioException(
requestOptions: _response.requestOptions,
response: _response,
type: DioExceptionType.unknown,
error: error,
stackTrace: stackTrace,
);
}
return Response<ImportPreview>(
data: _responseData,
headers: _response.headers,
isRedirect: _response.isRedirect,
requestOptions: _response.requestOptions,
redirects: _response.redirects,
statusCode: _response.statusCode,
statusMessage: _response.statusMessage,
extra: _response.extra,
);
}
/// List
/// Newest imports first, with the counters each was committed with.
///
/// Parameters:
/// * [status] - uploaded | parsed | committed | failed
/// * [limit]
/// * [offset]
/// * [cancelToken] - A [CancelToken] that can be used to cancel the operation
/// * [headers] - Can be used to add additional headers to the request
/// * [extras] - Can be used to add flags to the request
/// * [validateStatus] - A [ValidateStatus] callback that can be used to determine request success based on the HTTP status of the response
/// * [onSendProgress] - A [ProgressCallback] that can be used to get the send progress
/// * [onReceiveProgress] - A [ProgressCallback] that can be used to get the receive progress
///
/// Returns a [Future] containing a [Response] with a [List<ImportSummary>] as data
/// Throws [DioException] if API call or serialization fails
Future<Response<List<ImportSummary>>> importsList({
String? status,
int? limit = 50,
int? offset = 0,
CancelToken? cancelToken,
Map<String, dynamic>? headers,
Map<String, dynamic>? extra,
ValidateStatus? validateStatus,
ProgressCallback? onSendProgress,
ProgressCallback? onReceiveProgress,
}) async {
final _path = r'/api/v1/imports';
final _options = Options(
method: r'GET',
headers: <String, dynamic>{
...?headers,
},
extra: <String, dynamic>{
'secure': <Map<String, String>>[
{
'type': 'http',
'scheme': 'bearer',
'name': 'HTTPBearer',
},
],
...?extra,
},
validateStatus: validateStatus,
);
final _queryParameters = <String, dynamic>{
if (status != null) r'status': status,
if (limit != null) r'limit': limit,
if (offset != null) r'offset': offset,
};
final _response = await _dio.request<Object>(
_path,
options: _options,
queryParameters: _queryParameters,
cancelToken: cancelToken,
onSendProgress: onSendProgress,
onReceiveProgress: onReceiveProgress,
);
List<ImportSummary>? _responseData;
try {
final rawData = _response.data;
_responseData = rawData == null ? null : deserialize<List<ImportSummary>, ImportSummary>(rawData, 'List<ImportSummary>', growable: true);
} catch (error, stackTrace) {
throw DioException(
requestOptions: _response.requestOptions,
response: _response,
type: DioExceptionType.unknown,
error: error,
stackTrace: stackTrace,
);
}
return Response<List<ImportSummary>>(
data: _responseData,
headers: _response.headers,
isRedirect: _response.isRedirect,
requestOptions: _response.requestOptions,
redirects: _response.redirects,
statusCode: _response.statusCode,
statusMessage: _response.statusMessage,
extra: _response.extra,
);
}
}
@@ -0,0 +1,296 @@
//
// AUTO-GENERATED FILE, DO NOT MODIFY!
//
import 'dart:async';
// ignore: unused_import
import 'dart:convert';
import 'package:fintracker_api/src/deserialize.dart';
import 'package:dio/dio.dart';
import 'package:fintracker_api/src/model/calendar_out.dart';
import 'package:fintracker_api/src/model/forecast_out.dart';
import 'package:fintracker_api/src/model/history_out.dart';
import 'package:fintracker_api/src/model/problem.dart';
class IncomeApi {
final Dio _dio;
const IncomeApi(this._dio);
/// Calendar
/// Payments in a window, one row each; defaults to the next 12 months, forecast only.
///
/// Parameters:
/// * [scope] - all | account:<id> | portfolio:<id>
/// * [dateFrom]
/// * [dateTo]
/// * [includePaid]
/// * [cancelToken] - A [CancelToken] that can be used to cancel the operation
/// * [headers] - Can be used to add additional headers to the request
/// * [extras] - Can be used to add flags to the request
/// * [validateStatus] - A [ValidateStatus] callback that can be used to determine request success based on the HTTP status of the response
/// * [onSendProgress] - A [ProgressCallback] that can be used to get the send progress
/// * [onReceiveProgress] - A [ProgressCallback] that can be used to get the receive progress
///
/// Returns a [Future] containing a [Response] with a [CalendarOut] as data
/// Throws [DioException] if API call or serialization fails
Future<Response<CalendarOut>> incomeCalendar({
String? scope = 'all',
DateTime? dateFrom,
DateTime? dateTo,
bool? includePaid = false,
CancelToken? cancelToken,
Map<String, dynamic>? headers,
Map<String, dynamic>? extra,
ValidateStatus? validateStatus,
ProgressCallback? onSendProgress,
ProgressCallback? onReceiveProgress,
}) async {
final _path = r'/api/v1/income/calendar';
final _options = Options(
method: r'GET',
headers: <String, dynamic>{
...?headers,
},
extra: <String, dynamic>{
'secure': <Map<String, String>>[
{
'type': 'http',
'scheme': 'bearer',
'name': 'HTTPBearer',
},
],
...?extra,
},
validateStatus: validateStatus,
);
final _queryParameters = <String, dynamic>{
if (scope != null) r'scope': scope,
if (dateFrom != null) r'date_from': dateFrom,
if (dateTo != null) r'date_to': dateTo,
if (includePaid != null) r'include_paid': includePaid,
};
final _response = await _dio.request<Object>(
_path,
options: _options,
queryParameters: _queryParameters,
cancelToken: cancelToken,
onSendProgress: onSendProgress,
onReceiveProgress: onReceiveProgress,
);
CalendarOut? _responseData;
try {
final rawData = _response.data;
_responseData = rawData == null ? null : deserialize<CalendarOut, CalendarOut>(rawData, 'CalendarOut', growable: true);
} catch (error, stackTrace) {
throw DioException(
requestOptions: _response.requestOptions,
response: _response,
type: DioExceptionType.unknown,
error: error,
stackTrace: stackTrace,
);
}
return Response<CalendarOut>(
data: _responseData,
headers: _response.headers,
isRedirect: _response.isRedirect,
requestOptions: _response.requestOptions,
redirects: _response.redirects,
statusCode: _response.statusCode,
statusMessage: _response.statusMessage,
extra: _response.extra,
);
}
/// Forecast
/// Expected income per month, split by basis, plus the yield it implies.
///
/// Parameters:
/// * [scope] - all | account:<id> | portfolio:<id>
/// * [months]
/// * [cancelToken] - A [CancelToken] that can be used to cancel the operation
/// * [headers] - Can be used to add additional headers to the request
/// * [extras] - Can be used to add flags to the request
/// * [validateStatus] - A [ValidateStatus] callback that can be used to determine request success based on the HTTP status of the response
/// * [onSendProgress] - A [ProgressCallback] that can be used to get the send progress
/// * [onReceiveProgress] - A [ProgressCallback] that can be used to get the receive progress
///
/// Returns a [Future] containing a [Response] with a [ForecastOut] as data
/// Throws [DioException] if API call or serialization fails
Future<Response<ForecastOut>> incomeForecast({
String? scope = 'all',
int? months = 12,
CancelToken? cancelToken,
Map<String, dynamic>? headers,
Map<String, dynamic>? extra,
ValidateStatus? validateStatus,
ProgressCallback? onSendProgress,
ProgressCallback? onReceiveProgress,
}) async {
final _path = r'/api/v1/income/forecast';
final _options = Options(
method: r'GET',
headers: <String, dynamic>{
...?headers,
},
extra: <String, dynamic>{
'secure': <Map<String, String>>[
{
'type': 'http',
'scheme': 'bearer',
'name': 'HTTPBearer',
},
],
...?extra,
},
validateStatus: validateStatus,
);
final _queryParameters = <String, dynamic>{
if (scope != null) r'scope': scope,
if (months != null) r'months': months,
};
final _response = await _dio.request<Object>(
_path,
options: _options,
queryParameters: _queryParameters,
cancelToken: cancelToken,
onSendProgress: onSendProgress,
onReceiveProgress: onReceiveProgress,
);
ForecastOut? _responseData;
try {
final rawData = _response.data;
_responseData = rawData == null ? null : deserialize<ForecastOut, ForecastOut>(rawData, 'ForecastOut', growable: true);
} catch (error, stackTrace) {
throw DioException(
requestOptions: _response.requestOptions,
response: _response,
type: DioExceptionType.unknown,
error: error,
stackTrace: stackTrace,
);
}
return Response<ForecastOut>(
data: _responseData,
headers: _response.headers,
isRedirect: _response.isRedirect,
requestOptions: _response.requestOptions,
redirects: _response.redirects,
statusCode: _response.statusCode,
statusMessage: _response.statusMessage,
extra: _response.extra,
);
}
/// History
/// Income actually received, grouped by month, kind and currency. &#x60;group&#x60; exists for the contract&#39;s sake and accepts only &#x60;month&#x60;: the table is stored monthly, and a finer grouping would have to re-read the ledger, which is what the calendar&#39;s &#x60;paid&#x60; rows already do per payment.
///
/// Parameters:
/// * [scope] - all | account:<id> | portfolio:<id>
/// * [group] - month
/// * [dateFrom]
/// * [dateTo]
/// * [kind] - dividend | coupon | …
/// * [cancelToken] - A [CancelToken] that can be used to cancel the operation
/// * [headers] - Can be used to add additional headers to the request
/// * [extras] - Can be used to add flags to the request
/// * [validateStatus] - A [ValidateStatus] callback that can be used to determine request success based on the HTTP status of the response
/// * [onSendProgress] - A [ProgressCallback] that can be used to get the send progress
/// * [onReceiveProgress] - A [ProgressCallback] that can be used to get the receive progress
///
/// Returns a [Future] containing a [Response] with a [HistoryOut] as data
/// Throws [DioException] if API call or serialization fails
Future<Response<HistoryOut>> incomeHistory({
String? scope = 'all',
String? group = 'month',
DateTime? dateFrom,
DateTime? dateTo,
String? kind,
CancelToken? cancelToken,
Map<String, dynamic>? headers,
Map<String, dynamic>? extra,
ValidateStatus? validateStatus,
ProgressCallback? onSendProgress,
ProgressCallback? onReceiveProgress,
}) async {
final _path = r'/api/v1/income/history';
final _options = Options(
method: r'GET',
headers: <String, dynamic>{
...?headers,
},
extra: <String, dynamic>{
'secure': <Map<String, String>>[
{
'type': 'http',
'scheme': 'bearer',
'name': 'HTTPBearer',
},
],
...?extra,
},
validateStatus: validateStatus,
);
final _queryParameters = <String, dynamic>{
if (scope != null) r'scope': scope,
if (group != null) r'group': group,
if (dateFrom != null) r'date_from': dateFrom,
if (dateTo != null) r'date_to': dateTo,
if (kind != null) r'kind': kind,
};
final _response = await _dio.request<Object>(
_path,
options: _options,
queryParameters: _queryParameters,
cancelToken: cancelToken,
onSendProgress: onSendProgress,
onReceiveProgress: onReceiveProgress,
);
HistoryOut? _responseData;
try {
final rawData = _response.data;
_responseData = rawData == null ? null : deserialize<HistoryOut, HistoryOut>(rawData, 'HistoryOut', growable: true);
} catch (error, stackTrace) {
throw DioException(
requestOptions: _response.requestOptions,
response: _response,
type: DioExceptionType.unknown,
error: error,
stackTrace: stackTrace,
);
}
return Response<HistoryOut>(
data: _responseData,
headers: _response.headers,
isRedirect: _response.isRedirect,
requestOptions: _response.requestOptions,
redirects: _response.redirects,
statusCode: _response.statusCode,
statusMessage: _response.statusMessage,
extra: _response.extra,
);
}
}
@@ -11,6 +11,11 @@ import 'package:dio/dio.dart';
import 'package:fintracker_api/src/model/instrument_detail.dart';
import 'package:fintracker_api/src/model/instrument_out.dart';
import 'package:fintracker_api/src/model/pending_instrument_out.dart';
import 'package:fintracker_api/src/model/pending_resolve_request.dart';
import 'package:fintracker_api/src/model/pending_resolve_result.dart';
import 'package:fintracker_api/src/model/price_manual_in.dart';
import 'package:fintracker_api/src/model/price_manual_out.dart';
import 'package:fintracker_api/src/model/problem.dart';
class InstrumentsApi {
@@ -199,4 +204,291 @@ _responseData = rawData == null ? null : deserialize<List<InstrumentOut>, Instru
);
}
/// Pending
/// Instruments a report named that nothing in the master resolves to.
///
/// Parameters:
/// * [status] - pending | resolved | ignored | all
/// * [limit]
/// * [offset]
/// * [cancelToken] - A [CancelToken] that can be used to cancel the operation
/// * [headers] - Can be used to add additional headers to the request
/// * [extras] - Can be used to add flags to the request
/// * [validateStatus] - A [ValidateStatus] callback that can be used to determine request success based on the HTTP status of the response
/// * [onSendProgress] - A [ProgressCallback] that can be used to get the send progress
/// * [onReceiveProgress] - A [ProgressCallback] that can be used to get the receive progress
///
/// Returns a [Future] containing a [Response] with a [List<PendingInstrumentOut>] as data
/// Throws [DioException] if API call or serialization fails
Future<Response<List<PendingInstrumentOut>>> instrumentsPending({
String? status = 'pending',
int? limit = 100,
int? offset = 0,
CancelToken? cancelToken,
Map<String, dynamic>? headers,
Map<String, dynamic>? extra,
ValidateStatus? validateStatus,
ProgressCallback? onSendProgress,
ProgressCallback? onReceiveProgress,
}) async {
final _path = r'/api/v1/instruments/pending';
final _options = Options(
method: r'GET',
headers: <String, dynamic>{
...?headers,
},
extra: <String, dynamic>{
'secure': <Map<String, String>>[
{
'type': 'http',
'scheme': 'bearer',
'name': 'HTTPBearer',
},
],
...?extra,
},
validateStatus: validateStatus,
);
final _queryParameters = <String, dynamic>{
if (status != null) r'status': status,
if (limit != null) r'limit': limit,
if (offset != null) r'offset': offset,
};
final _response = await _dio.request<Object>(
_path,
options: _options,
queryParameters: _queryParameters,
cancelToken: cancelToken,
onSendProgress: onSendProgress,
onReceiveProgress: onReceiveProgress,
);
List<PendingInstrumentOut>? _responseData;
try {
final rawData = _response.data;
_responseData = rawData == null ? null : deserialize<List<PendingInstrumentOut>, PendingInstrumentOut>(rawData, 'List<PendingInstrumentOut>', growable: true);
} catch (error, stackTrace) {
throw DioException(
requestOptions: _response.requestOptions,
response: _response,
type: DioExceptionType.unknown,
error: error,
stackTrace: stackTrace,
);
}
return Response<List<PendingInstrumentOut>>(
data: _responseData,
headers: _response.headers,
isRedirect: _response.isRedirect,
requestOptions: _response.requestOptions,
redirects: _response.redirects,
statusCode: _response.statusCode,
statusMessage: _response.statusMessage,
extra: _response.extra,
);
}
/// Pending Resolve
/// Link, create or ignore — then bind the events that were waiting and rebuild the lots.
///
/// Parameters:
/// * [pendingId]
/// * [pendingResolveRequest]
/// * [cancelToken] - A [CancelToken] that can be used to cancel the operation
/// * [headers] - Can be used to add additional headers to the request
/// * [extras] - Can be used to add flags to the request
/// * [validateStatus] - A [ValidateStatus] callback that can be used to determine request success based on the HTTP status of the response
/// * [onSendProgress] - A [ProgressCallback] that can be used to get the send progress
/// * [onReceiveProgress] - A [ProgressCallback] that can be used to get the receive progress
///
/// Returns a [Future] containing a [Response] with a [PendingResolveResult] as data
/// Throws [DioException] if API call or serialization fails
Future<Response<PendingResolveResult>> instrumentsPendingResolve({
required int pendingId,
required PendingResolveRequest pendingResolveRequest,
CancelToken? cancelToken,
Map<String, dynamic>? headers,
Map<String, dynamic>? extra,
ValidateStatus? validateStatus,
ProgressCallback? onSendProgress,
ProgressCallback? onReceiveProgress,
}) async {
final _path = r'/api/v1/instruments/pending/{pending_id}/resolve'.replaceAll('{' r'pending_id' '}', pendingId.toString());
final _options = Options(
method: r'POST',
headers: <String, dynamic>{
...?headers,
},
extra: <String, dynamic>{
'secure': <Map<String, String>>[
{
'type': 'http',
'scheme': 'bearer',
'name': 'HTTPBearer',
},
],
...?extra,
},
contentType: 'application/json',
validateStatus: validateStatus,
);
dynamic _bodyData;
try {
_bodyData = jsonEncode(pendingResolveRequest);
} catch(error, stackTrace) {
throw DioException(
requestOptions: _options.compose(
_dio.options,
_path,
),
type: DioExceptionType.unknown,
error: error,
stackTrace: stackTrace,
);
}
final _response = await _dio.request<Object>(
_path,
data: _bodyData,
options: _options,
cancelToken: cancelToken,
onSendProgress: onSendProgress,
onReceiveProgress: onReceiveProgress,
);
PendingResolveResult? _responseData;
try {
final rawData = _response.data;
_responseData = rawData == null ? null : deserialize<PendingResolveResult, PendingResolveResult>(rawData, 'PendingResolveResult', growable: true);
} catch (error, stackTrace) {
throw DioException(
requestOptions: _response.requestOptions,
response: _response,
type: DioExceptionType.unknown,
error: error,
stackTrace: stackTrace,
);
}
return Response<PendingResolveResult>(
data: _responseData,
headers: _response.headers,
isRedirect: _response.isRedirect,
requestOptions: _response.requestOptions,
redirects: _response.redirects,
statusCode: _response.statusCode,
statusMessage: _response.statusMessage,
extra: _response.extra,
);
}
/// Set Manual Price
/// Set (or replace) the manual price of &#x60;instrument_id&#x60; on &#x60;body.d&#x60;. 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 &#x60;metric_*&#x60;; call &#x60;POST /metrics/refresh&#x60; after, same as &#x60;/rules/apply&#x60;.
///
/// Parameters:
/// * [instrumentId]
/// * [priceManualIn]
/// * [cancelToken] - A [CancelToken] that can be used to cancel the operation
/// * [headers] - Can be used to add additional headers to the request
/// * [extras] - Can be used to add flags to the request
/// * [validateStatus] - A [ValidateStatus] callback that can be used to determine request success based on the HTTP status of the response
/// * [onSendProgress] - A [ProgressCallback] that can be used to get the send progress
/// * [onReceiveProgress] - A [ProgressCallback] that can be used to get the receive progress
///
/// Returns a [Future] containing a [Response] with a [PriceManualOut] as data
/// Throws [DioException] if API call or serialization fails
Future<Response<PriceManualOut>> instrumentsSetManualPrice({
required int instrumentId,
required PriceManualIn priceManualIn,
CancelToken? cancelToken,
Map<String, dynamic>? headers,
Map<String, dynamic>? extra,
ValidateStatus? validateStatus,
ProgressCallback? onSendProgress,
ProgressCallback? onReceiveProgress,
}) async {
final _path = r'/api/v1/instruments/{instrument_id}/prices'.replaceAll('{' r'instrument_id' '}', instrumentId.toString());
final _options = Options(
method: r'POST',
headers: <String, dynamic>{
...?headers,
},
extra: <String, dynamic>{
'secure': <Map<String, String>>[
{
'type': 'http',
'scheme': 'bearer',
'name': 'HTTPBearer',
},
],
...?extra,
},
contentType: 'application/json',
validateStatus: validateStatus,
);
dynamic _bodyData;
try {
_bodyData = jsonEncode(priceManualIn);
} catch(error, stackTrace) {
throw DioException(
requestOptions: _options.compose(
_dio.options,
_path,
),
type: DioExceptionType.unknown,
error: error,
stackTrace: stackTrace,
);
}
final _response = await _dio.request<Object>(
_path,
data: _bodyData,
options: _options,
cancelToken: cancelToken,
onSendProgress: onSendProgress,
onReceiveProgress: onReceiveProgress,
);
PriceManualOut? _responseData;
try {
final rawData = _response.data;
_responseData = rawData == null ? null : deserialize<PriceManualOut, PriceManualOut>(rawData, 'PriceManualOut', growable: true);
} catch (error, stackTrace) {
throw DioException(
requestOptions: _response.requestOptions,
response: _response,
type: DioExceptionType.unknown,
error: error,
stackTrace: stackTrace,
);
}
return Response<PriceManualOut>(
data: _responseData,
headers: _response.headers,
isRedirect: _response.isRedirect,
requestOptions: _response.requestOptions,
redirects: _response.redirects,
statusCode: _response.statusCode,
statusMessage: _response.statusMessage,
extra: _response.extra,
);
}
}
@@ -0,0 +1,249 @@
//
// AUTO-GENERATED FILE, DO NOT MODIFY!
//
import 'dart:async';
// ignore: unused_import
import 'dart:convert';
import 'package:fintracker_api/src/deserialize.dart';
import 'package:dio/dio.dart';
import 'package:fintracker_api/src/model/link_create.dart';
import 'package:fintracker_api/src/model/link_out.dart';
import 'package:fintracker_api/src/model/problem.dart';
import 'package:fintracker_api/src/model/unmatched_out.dart';
class LinksApi {
final Dio _dio;
const LinksApi(this._dio);
/// Create
/// Confirm a pairing the matcher missed. Never touched by the automatic rebuild afterwards.
///
/// Parameters:
/// * [linkCreate]
/// * [cancelToken] - A [CancelToken] that can be used to cancel the operation
/// * [headers] - Can be used to add additional headers to the request
/// * [extras] - Can be used to add flags to the request
/// * [validateStatus] - A [ValidateStatus] callback that can be used to determine request success based on the HTTP status of the response
/// * [onSendProgress] - A [ProgressCallback] that can be used to get the send progress
/// * [onReceiveProgress] - A [ProgressCallback] that can be used to get the receive progress
///
/// Returns a [Future] containing a [Response] with a [LinkOut] as data
/// Throws [DioException] if API call or serialization fails
Future<Response<LinkOut>> linksCreate({
required LinkCreate linkCreate,
CancelToken? cancelToken,
Map<String, dynamic>? headers,
Map<String, dynamic>? extra,
ValidateStatus? validateStatus,
ProgressCallback? onSendProgress,
ProgressCallback? onReceiveProgress,
}) async {
final _path = r'/api/v1/links';
final _options = Options(
method: r'POST',
headers: <String, dynamic>{
...?headers,
},
extra: <String, dynamic>{
'secure': <Map<String, String>>[
{
'type': 'http',
'scheme': 'bearer',
'name': 'HTTPBearer',
},
],
...?extra,
},
contentType: 'application/json',
validateStatus: validateStatus,
);
dynamic _bodyData;
try {
_bodyData = jsonEncode(linkCreate);
} catch(error, stackTrace) {
throw DioException(
requestOptions: _options.compose(
_dio.options,
_path,
),
type: DioExceptionType.unknown,
error: error,
stackTrace: stackTrace,
);
}
final _response = await _dio.request<Object>(
_path,
data: _bodyData,
options: _options,
cancelToken: cancelToken,
onSendProgress: onSendProgress,
onReceiveProgress: onReceiveProgress,
);
LinkOut? _responseData;
try {
final rawData = _response.data;
_responseData = rawData == null ? null : deserialize<LinkOut, LinkOut>(rawData, 'LinkOut', growable: true);
} catch (error, stackTrace) {
throw DioException(
requestOptions: _response.requestOptions,
response: _response,
type: DioExceptionType.unknown,
error: error,
stackTrace: stackTrace,
);
}
return Response<LinkOut>(
data: _responseData,
headers: _response.headers,
isRedirect: _response.isRedirect,
requestOptions: _response.requestOptions,
redirects: _response.redirects,
statusCode: _response.statusCode,
statusMessage: _response.statusMessage,
extra: _response.extra,
);
}
/// Delete
/// Undo a link, manual or automatic. &#x60;flow_type&#x60; reverts on the next &#x60;POST /metrics/refresh&#x60;, when &#x60;classify&#x60; rebuilds it from the rules and &#x60;matching&#x60; no longer overwrites it.
///
/// Parameters:
/// * [linkId]
/// * [cancelToken] - A [CancelToken] that can be used to cancel the operation
/// * [headers] - Can be used to add additional headers to the request
/// * [extras] - Can be used to add flags to the request
/// * [validateStatus] - A [ValidateStatus] callback that can be used to determine request success based on the HTTP status of the response
/// * [onSendProgress] - A [ProgressCallback] that can be used to get the send progress
/// * [onReceiveProgress] - A [ProgressCallback] that can be used to get the receive progress
///
/// Returns a [Future]
/// Throws [DioException] if API call or serialization fails
Future<Response<void>> linksDelete({
required int linkId,
CancelToken? cancelToken,
Map<String, dynamic>? headers,
Map<String, dynamic>? extra,
ValidateStatus? validateStatus,
ProgressCallback? onSendProgress,
ProgressCallback? onReceiveProgress,
}) async {
final _path = r'/api/v1/links/{link_id}'.replaceAll('{' r'link_id' '}', linkId.toString());
final _options = Options(
method: r'DELETE',
headers: <String, dynamic>{
...?headers,
},
extra: <String, dynamic>{
'secure': <Map<String, String>>[
{
'type': 'http',
'scheme': 'bearer',
'name': 'HTTPBearer',
},
],
...?extra,
},
validateStatus: validateStatus,
);
final _response = await _dio.request<Object>(
_path,
options: _options,
cancelToken: cancelToken,
onSendProgress: onSendProgress,
onReceiveProgress: onReceiveProgress,
);
return _response;
}
/// Unmatched
/// Every candidate that survives matching without a link, on either side.
///
/// Parameters:
/// * [cancelToken] - A [CancelToken] that can be used to cancel the operation
/// * [headers] - Can be used to add additional headers to the request
/// * [extras] - Can be used to add flags to the request
/// * [validateStatus] - A [ValidateStatus] callback that can be used to determine request success based on the HTTP status of the response
/// * [onSendProgress] - A [ProgressCallback] that can be used to get the send progress
/// * [onReceiveProgress] - A [ProgressCallback] that can be used to get the receive progress
///
/// Returns a [Future] containing a [Response] with a [UnmatchedOut] as data
/// Throws [DioException] if API call or serialization fails
Future<Response<UnmatchedOut>> linksUnmatched({
CancelToken? cancelToken,
Map<String, dynamic>? headers,
Map<String, dynamic>? extra,
ValidateStatus? validateStatus,
ProgressCallback? onSendProgress,
ProgressCallback? onReceiveProgress,
}) async {
final _path = r'/api/v1/links/unmatched';
final _options = Options(
method: r'GET',
headers: <String, dynamic>{
...?headers,
},
extra: <String, dynamic>{
'secure': <Map<String, String>>[
{
'type': 'http',
'scheme': 'bearer',
'name': 'HTTPBearer',
},
],
...?extra,
},
validateStatus: validateStatus,
);
final _response = await _dio.request<Object>(
_path,
options: _options,
cancelToken: cancelToken,
onSendProgress: onSendProgress,
onReceiveProgress: onReceiveProgress,
);
UnmatchedOut? _responseData;
try {
final rawData = _response.data;
_responseData = rawData == null ? null : deserialize<UnmatchedOut, UnmatchedOut>(rawData, 'UnmatchedOut', growable: true);
} catch (error, stackTrace) {
throw DioException(
requestOptions: _response.requestOptions,
response: _response,
type: DioExceptionType.unknown,
error: error,
stackTrace: stackTrace,
);
}
return Response<UnmatchedOut>(
data: _responseData,
headers: _response.headers,
isRedirect: _response.isRedirect,
requestOptions: _response.requestOptions,
redirects: _response.redirects,
statusCode: _response.statusCode,
statusMessage: _response.statusMessage,
extra: _response.extra,
);
}
}
@@ -0,0 +1,296 @@
//
// AUTO-GENERATED FILE, DO NOT MODIFY!
//
import 'dart:async';
// ignore: unused_import
import 'dart:convert';
import 'package:fintracker_api/src/deserialize.dart';
import 'package:dio/dio.dart';
import 'package:fintracker_api/src/model/cash_available.dart';
import 'package:fintracker_api/src/model/problem.dart';
import 'package:fintracker_api/src/model/rebalance_out.dart';
import 'package:fintracker_api/src/model/targets_in.dart';
import 'package:fintracker_api/src/model/targets_out.dart';
class RebalanceApi {
final Dio _dio;
const RebalanceApi(this._dio);
/// Rebalance
///
///
/// Parameters:
/// * [portfolioId]
/// * [dimension] - asset_class | sector | country | currency
/// * [cashAvailable] - переопределяет остаток на счетах для what-if
/// * [cancelToken] - A [CancelToken] that can be used to cancel the operation
/// * [headers] - Can be used to add additional headers to the request
/// * [extras] - Can be used to add flags to the request
/// * [validateStatus] - A [ValidateStatus] callback that can be used to determine request success based on the HTTP status of the response
/// * [onSendProgress] - A [ProgressCallback] that can be used to get the send progress
/// * [onReceiveProgress] - A [ProgressCallback] that can be used to get the receive progress
///
/// Returns a [Future] containing a [Response] with a [RebalanceOut] as data
/// Throws [DioException] if API call or serialization fails
Future<Response<RebalanceOut>> rebalanceRebalance({
required int portfolioId,
String? dimension = 'asset_class',
CashAvailable? cashAvailable,
CancelToken? cancelToken,
Map<String, dynamic>? headers,
Map<String, dynamic>? extra,
ValidateStatus? validateStatus,
ProgressCallback? onSendProgress,
ProgressCallback? onReceiveProgress,
}) async {
final _path = r'/api/v1/portfolios/{portfolio_id}/rebalance'.replaceAll('{' r'portfolio_id' '}', portfolioId.toString());
final _options = Options(
method: r'GET',
headers: <String, dynamic>{
...?headers,
},
extra: <String, dynamic>{
'secure': <Map<String, String>>[
{
'type': 'http',
'scheme': 'bearer',
'name': 'HTTPBearer',
},
],
...?extra,
},
validateStatus: validateStatus,
);
final _queryParameters = <String, dynamic>{
if (dimension != null) r'dimension': dimension,
if (cashAvailable != null) r'cash_available': cashAvailable,
};
final _response = await _dio.request<Object>(
_path,
options: _options,
queryParameters: _queryParameters,
cancelToken: cancelToken,
onSendProgress: onSendProgress,
onReceiveProgress: onReceiveProgress,
);
RebalanceOut? _responseData;
try {
final rawData = _response.data;
_responseData = rawData == null ? null : deserialize<RebalanceOut, RebalanceOut>(rawData, 'RebalanceOut', growable: true);
} catch (error, stackTrace) {
throw DioException(
requestOptions: _response.requestOptions,
response: _response,
type: DioExceptionType.unknown,
error: error,
stackTrace: stackTrace,
);
}
return Response<RebalanceOut>(
data: _responseData,
headers: _response.headers,
isRedirect: _response.isRedirect,
requestOptions: _response.requestOptions,
redirects: _response.redirects,
statusCode: _response.statusCode,
statusMessage: _response.statusMessage,
extra: _response.extra,
);
}
/// Set Targets
/// Replace the whole set for one dimension. The weights must add up to 1 within &#x60;WEIGHT_TOLERANCE&#x60;; 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.
///
/// Parameters:
/// * [portfolioId]
/// * [targetsIn]
/// * [cancelToken] - A [CancelToken] that can be used to cancel the operation
/// * [headers] - Can be used to add additional headers to the request
/// * [extras] - Can be used to add flags to the request
/// * [validateStatus] - A [ValidateStatus] callback that can be used to determine request success based on the HTTP status of the response
/// * [onSendProgress] - A [ProgressCallback] that can be used to get the send progress
/// * [onReceiveProgress] - A [ProgressCallback] that can be used to get the receive progress
///
/// Returns a [Future] containing a [Response] with a [TargetsOut] as data
/// Throws [DioException] if API call or serialization fails
Future<Response<TargetsOut>> rebalanceSetTargets({
required int portfolioId,
required TargetsIn targetsIn,
CancelToken? cancelToken,
Map<String, dynamic>? headers,
Map<String, dynamic>? extra,
ValidateStatus? validateStatus,
ProgressCallback? onSendProgress,
ProgressCallback? onReceiveProgress,
}) async {
final _path = r'/api/v1/portfolios/{portfolio_id}/targets'.replaceAll('{' r'portfolio_id' '}', portfolioId.toString());
final _options = Options(
method: r'PUT',
headers: <String, dynamic>{
...?headers,
},
extra: <String, dynamic>{
'secure': <Map<String, String>>[
{
'type': 'http',
'scheme': 'bearer',
'name': 'HTTPBearer',
},
],
...?extra,
},
contentType: 'application/json',
validateStatus: validateStatus,
);
dynamic _bodyData;
try {
_bodyData = jsonEncode(targetsIn);
} catch(error, stackTrace) {
throw DioException(
requestOptions: _options.compose(
_dio.options,
_path,
),
type: DioExceptionType.unknown,
error: error,
stackTrace: stackTrace,
);
}
final _response = await _dio.request<Object>(
_path,
data: _bodyData,
options: _options,
cancelToken: cancelToken,
onSendProgress: onSendProgress,
onReceiveProgress: onReceiveProgress,
);
TargetsOut? _responseData;
try {
final rawData = _response.data;
_responseData = rawData == null ? null : deserialize<TargetsOut, TargetsOut>(rawData, 'TargetsOut', growable: true);
} catch (error, stackTrace) {
throw DioException(
requestOptions: _response.requestOptions,
response: _response,
type: DioExceptionType.unknown,
error: error,
stackTrace: stackTrace,
);
}
return Response<TargetsOut>(
data: _responseData,
headers: _response.headers,
isRedirect: _response.isRedirect,
requestOptions: _response.requestOptions,
redirects: _response.redirects,
statusCode: _response.statusCode,
statusMessage: _response.statusMessage,
extra: _response.extra,
);
}
/// Targets
///
///
/// Parameters:
/// * [portfolioId]
/// * [dimension] - asset_class | sector | country | currency
/// * [cancelToken] - A [CancelToken] that can be used to cancel the operation
/// * [headers] - Can be used to add additional headers to the request
/// * [extras] - Can be used to add flags to the request
/// * [validateStatus] - A [ValidateStatus] callback that can be used to determine request success based on the HTTP status of the response
/// * [onSendProgress] - A [ProgressCallback] that can be used to get the send progress
/// * [onReceiveProgress] - A [ProgressCallback] that can be used to get the receive progress
///
/// Returns a [Future] containing a [Response] with a [TargetsOut] as data
/// Throws [DioException] if API call or serialization fails
Future<Response<TargetsOut>> rebalanceTargets({
required int portfolioId,
String? dimension = 'asset_class',
CancelToken? cancelToken,
Map<String, dynamic>? headers,
Map<String, dynamic>? extra,
ValidateStatus? validateStatus,
ProgressCallback? onSendProgress,
ProgressCallback? onReceiveProgress,
}) async {
final _path = r'/api/v1/portfolios/{portfolio_id}/targets'.replaceAll('{' r'portfolio_id' '}', portfolioId.toString());
final _options = Options(
method: r'GET',
headers: <String, dynamic>{
...?headers,
},
extra: <String, dynamic>{
'secure': <Map<String, String>>[
{
'type': 'http',
'scheme': 'bearer',
'name': 'HTTPBearer',
},
],
...?extra,
},
validateStatus: validateStatus,
);
final _queryParameters = <String, dynamic>{
if (dimension != null) r'dimension': dimension,
};
final _response = await _dio.request<Object>(
_path,
options: _options,
queryParameters: _queryParameters,
cancelToken: cancelToken,
onSendProgress: onSendProgress,
onReceiveProgress: onReceiveProgress,
);
TargetsOut? _responseData;
try {
final rawData = _response.data;
_responseData = rawData == null ? null : deserialize<TargetsOut, TargetsOut>(rawData, 'TargetsOut', growable: true);
} catch (error, stackTrace) {
throw DioException(
requestOptions: _response.requestOptions,
response: _response,
type: DioExceptionType.unknown,
error: error,
stackTrace: stackTrace,
);
}
return Response<TargetsOut>(
data: _responseData,
headers: _response.headers,
isRedirect: _response.isRedirect,
requestOptions: _response.requestOptions,
redirects: _response.redirects,
statusCode: _response.statusCode,
statusMessage: _response.statusMessage,
extra: _response.extra,
);
}
}
@@ -0,0 +1,194 @@
//
// AUTO-GENERATED FILE, DO NOT MODIFY!
//
import 'dart:async';
// ignore: unused_import
import 'dart:convert';
import 'package:fintracker_api/src/deserialize.dart';
import 'package:dio/dio.dart';
import 'package:fintracker_api/src/model/problem.dart';
import 'package:fintracker_api/src/model/tax_lots_out.dart';
import 'package:fintracker_api/src/model/tax_year_out.dart';
class TaxApi {
final Dio _dio;
const TaxApi(this._dio);
/// Lots
/// Open lots with the date after which a sale falls under the long-term exemption. &#x60;year&#x60; selects the rate the \&quot;what if I sold today\&quot; figure is computed at; the lots themselves are always the ones open right now. &#x60;lot&#x60; is rebuilt from the ledger on every refresh and holds today&#39;s state only, so there is no honest way to answer \&quot;which lots were open on 31 December two years ago\&quot; — and inventing one would be worse than the limitation.
///
/// Parameters:
/// * [year]
/// * [accountId]
/// * [cancelToken] - A [CancelToken] that can be used to cancel the operation
/// * [headers] - Can be used to add additional headers to the request
/// * [extras] - Can be used to add flags to the request
/// * [validateStatus] - A [ValidateStatus] callback that can be used to determine request success based on the HTTP status of the response
/// * [onSendProgress] - A [ProgressCallback] that can be used to get the send progress
/// * [onReceiveProgress] - A [ProgressCallback] that can be used to get the receive progress
///
/// Returns a [Future] containing a [Response] with a [TaxLotsOut] as data
/// Throws [DioException] if API call or serialization fails
Future<Response<TaxLotsOut>> taxLots({
int? year,
int? accountId,
CancelToken? cancelToken,
Map<String, dynamic>? headers,
Map<String, dynamic>? extra,
ValidateStatus? validateStatus,
ProgressCallback? onSendProgress,
ProgressCallback? onReceiveProgress,
}) async {
final _path = r'/api/v1/tax/lots';
final _options = Options(
method: r'GET',
headers: <String, dynamic>{
...?headers,
},
extra: <String, dynamic>{
'secure': <Map<String, String>>[
{
'type': 'http',
'scheme': 'bearer',
'name': 'HTTPBearer',
},
],
...?extra,
},
validateStatus: validateStatus,
);
final _queryParameters = <String, dynamic>{
if (year != null) r'year': year,
if (accountId != null) r'account_id': accountId,
};
final _response = await _dio.request<Object>(
_path,
options: _options,
queryParameters: _queryParameters,
cancelToken: cancelToken,
onSendProgress: onSendProgress,
onReceiveProgress: onReceiveProgress,
);
TaxLotsOut? _responseData;
try {
final rawData = _response.data;
_responseData = rawData == null ? null : deserialize<TaxLotsOut, TaxLotsOut>(rawData, 'TaxLotsOut', growable: true);
} catch (error, stackTrace) {
throw DioException(
requestOptions: _response.requestOptions,
response: _response,
type: DioExceptionType.unknown,
error: error,
stackTrace: stackTrace,
);
}
return Response<TaxLotsOut>(
data: _responseData,
headers: _response.headers,
isRedirect: _response.isRedirect,
requestOptions: _response.requestOptions,
redirects: _response.redirects,
statusCode: _response.statusCode,
statusMessage: _response.statusMessage,
extra: _response.extra,
);
}
/// Summary
/// The year&#39;s estimated tax position, per account and in total.
///
/// Parameters:
/// * [year]
/// * [accountId]
/// * [cancelToken] - A [CancelToken] that can be used to cancel the operation
/// * [headers] - Can be used to add additional headers to the request
/// * [extras] - Can be used to add flags to the request
/// * [validateStatus] - A [ValidateStatus] callback that can be used to determine request success based on the HTTP status of the response
/// * [onSendProgress] - A [ProgressCallback] that can be used to get the send progress
/// * [onReceiveProgress] - A [ProgressCallback] that can be used to get the receive progress
///
/// Returns a [Future] containing a [Response] with a [TaxYearOut] as data
/// Throws [DioException] if API call or serialization fails
Future<Response<TaxYearOut>> taxSummary({
int? year,
int? accountId,
CancelToken? cancelToken,
Map<String, dynamic>? headers,
Map<String, dynamic>? extra,
ValidateStatus? validateStatus,
ProgressCallback? onSendProgress,
ProgressCallback? onReceiveProgress,
}) async {
final _path = r'/api/v1/tax';
final _options = Options(
method: r'GET',
headers: <String, dynamic>{
...?headers,
},
extra: <String, dynamic>{
'secure': <Map<String, String>>[
{
'type': 'http',
'scheme': 'bearer',
'name': 'HTTPBearer',
},
],
...?extra,
},
validateStatus: validateStatus,
);
final _queryParameters = <String, dynamic>{
if (year != null) r'year': year,
if (accountId != null) r'account_id': accountId,
};
final _response = await _dio.request<Object>(
_path,
options: _options,
queryParameters: _queryParameters,
cancelToken: cancelToken,
onSendProgress: onSendProgress,
onReceiveProgress: onReceiveProgress,
);
TaxYearOut? _responseData;
try {
final rawData = _response.data;
_responseData = rawData == null ? null : deserialize<TaxYearOut, TaxYearOut>(rawData, 'TaxYearOut', growable: true);
} catch (error, stackTrace) {
throw DioException(
requestOptions: _response.requestOptions,
response: _response,
type: DioExceptionType.unknown,
error: error,
stackTrace: stackTrace,
);
}
return Response<TaxYearOut>(
data: _responseData,
headers: _response.headers,
isRedirect: _response.isRedirect,
requestOptions: _response.requestOptions,
redirects: _response.redirects,
statusCode: _response.statusCode,
statusMessage: _response.statusMessage,
extra: _response.extra,
);
}
}
@@ -1,22 +1,60 @@
import 'package:fintracker_api/src/model/account_balance.dart';
import 'package:fintracker_api/src/model/account_out.dart';
import 'package:fintracker_api/src/model/account_patch.dart';
import 'package:fintracker_api/src/model/account_suggestion.dart';
import 'package:fintracker_api/src/model/allocation_bucket.dart';
import 'package:fintracker_api/src/model/benchmark_comparison.dart';
import 'package:fintracker_api/src/model/benchmark_comparison_out.dart';
import 'package:fintracker_api/src/model/benchmark_create.dart';
import 'package:fintracker_api/src/model/benchmark_out.dart';
import 'package:fintracker_api/src/model/benchmark_patch.dart';
import 'package:fintracker_api/src/model/benchmark_return_out.dart';
import 'package:fintracker_api/src/model/calendar_entry.dart';
import 'package:fintracker_api/src/model/calendar_out.dart';
import 'package:fintracker_api/src/model/cash_available.dart';
import 'package:fintracker_api/src/model/cash_flow_broker_month.dart';
import 'package:fintracker_api/src/model/cash_flow_month.dart';
import 'package:fintracker_api/src/model/category_out.dart';
import 'package:fintracker_api/src/model/commit_request.dart';
import 'package:fintracker_api/src/model/data_quality_row.dart';
import 'package:fintracker_api/src/model/event_out.dart';
import 'package:fintracker_api/src/model/event_page.dart';
import 'package:fintracker_api/src/model/forecast_month.dart';
import 'package:fintracker_api/src/model/forecast_out.dart';
import 'package:fintracker_api/src/model/goal_create.dart';
import 'package:fintracker_api/src/model/goal_out.dart';
import 'package:fintracker_api/src/model/goal_patch.dart';
import 'package:fintracker_api/src/model/goal_progress_out.dart';
import 'package:fintracker_api/src/model/health.dart';
import 'package:fintracker_api/src/model/history_out.dart';
import 'package:fintracker_api/src/model/history_row.dart';
import 'package:fintracker_api/src/model/history_totals.dart';
import 'package:fintracker_api/src/model/holding_out.dart';
import 'package:fintracker_api/src/model/import_counts.dart';
import 'package:fintracker_api/src/model/import_preview.dart';
import 'package:fintracker_api/src/model/import_result.dart';
import 'package:fintracker_api/src/model/import_summary.dart';
import 'package:fintracker_api/src/model/instrument_detail.dart';
import 'package:fintracker_api/src/model/instrument_out.dart';
import 'package:fintracker_api/src/model/link_create.dart';
import 'package:fintracker_api/src/model/link_out.dart';
import 'package:fintracker_api/src/model/login_request.dart';
import 'package:fintracker_api/src/model/lot_out.dart';
import 'package:fintracker_api/src/model/net_worth_breakdown.dart';
import 'package:fintracker_api/src/model/net_worth_day.dart';
import 'package:fintracker_api/src/model/new_instrument.dart';
import 'package:fintracker_api/src/model/pending_instrument_out.dart';
import 'package:fintracker_api/src/model/pending_resolve_request.dart';
import 'package:fintracker_api/src/model/pending_resolve_result.dart';
import 'package:fintracker_api/src/model/price_manual_in.dart';
import 'package:fintracker_api/src/model/price_manual_out.dart';
import 'package:fintracker_api/src/model/price_point.dart';
import 'package:fintracker_api/src/model/problem.dart';
import 'package:fintracker_api/src/model/rebalance_bucket_out.dart';
import 'package:fintracker_api/src/model/rebalance_out.dart';
import 'package:fintracker_api/src/model/reconciliation_cash.dart';
import 'package:fintracker_api/src/model/reconciliation_out.dart';
import 'package:fintracker_api/src/model/reconciliation_position.dart';
import 'package:fintracker_api/src/model/refresh_log_out.dart';
import 'package:fintracker_api/src/model/refresh_request.dart';
import 'package:fintracker_api/src/model/returns_out.dart';
@@ -24,15 +62,29 @@ import 'package:fintracker_api/src/model/rule_create.dart';
import 'package:fintracker_api/src/model/rule_out.dart';
import 'package:fintracker_api/src/model/rule_patch.dart';
import 'package:fintracker_api/src/model/runway_out.dart';
import 'package:fintracker_api/src/model/sample_event_out.dart';
import 'package:fintracker_api/src/model/scope_out.dart';
import 'package:fintracker_api/src/model/source_status.dart';
import 'package:fintracker_api/src/model/spending_row.dart';
import 'package:fintracker_api/src/model/summary_out.dart';
import 'package:fintracker_api/src/model/sync_job_out.dart';
import 'package:fintracker_api/src/model/sync_run_out.dart';
import 'package:fintracker_api/src/model/target_in.dart';
import 'package:fintracker_api/src/model/target_out.dart';
import 'package:fintracker_api/src/model/targets_in.dart';
import 'package:fintracker_api/src/model/targets_out.dart';
import 'package:fintracker_api/src/model/tax_account_out.dart';
import 'package:fintracker_api/src/model/tax_lot_out.dart';
import 'package:fintracker_api/src/model/tax_lots_out.dart';
import 'package:fintracker_api/src/model/tax_totals.dart';
import 'package:fintracker_api/src/model/tax_year_out.dart';
import 'package:fintracker_api/src/model/token_pair.dart';
import 'package:fintracker_api/src/model/trade_out.dart';
import 'package:fintracker_api/src/model/transaction_out.dart';
import 'package:fintracker_api/src/model/transaction_page.dart';
import 'package:fintracker_api/src/model/unmatched_broker_out.dart';
import 'package:fintracker_api/src/model/unmatched_out.dart';
import 'package:fintracker_api/src/model/unmatched_zm_out.dart';
import 'package:fintracker_api/src/model/user_out.dart';
import 'package:fintracker_api/src/model/value_day.dart';
@@ -66,18 +118,42 @@ final _regMap = RegExp(r'^Map<String,(.*)>$');
case 'AccountRole':
case 'AccountSuggestion':
return AccountSuggestion.fromJson(value as Map<String, dynamic>) as ReturnType;
case 'AllocationBucket':
return AllocationBucket.fromJson(value as Map<String, dynamic>) as ReturnType;
case 'AllocationDimension':
case 'BenchmarkComparison':
return BenchmarkComparison.fromJson(value as Map<String, dynamic>) as ReturnType;
case 'BenchmarkComparisonOut':
return BenchmarkComparisonOut.fromJson(value as Map<String, dynamic>) as ReturnType;
case 'BenchmarkCreate':
return BenchmarkCreate.fromJson(value as Map<String, dynamic>) as ReturnType;
case 'BenchmarkOut':
return BenchmarkOut.fromJson(value as Map<String, dynamic>) as ReturnType;
case 'BenchmarkPatch':
return BenchmarkPatch.fromJson(value as Map<String, dynamic>) as ReturnType;
case 'BenchmarkReturnOut':
return BenchmarkReturnOut.fromJson(value as Map<String, dynamic>) as ReturnType;
case 'Broker':
case 'CalendarEntry':
return CalendarEntry.fromJson(value as Map<String, dynamic>) as ReturnType;
case 'CalendarOut':
return CalendarOut.fromJson(value as Map<String, dynamic>) as ReturnType;
case 'CashAvailable':
return CashAvailable.fromJson(value as Map<String, dynamic>) as ReturnType;
case 'CashFlowBrokerMonth':
return CashFlowBrokerMonth.fromJson(value as Map<String, dynamic>) as ReturnType;
case 'CashFlowMonth':
return CashFlowMonth.fromJson(value as Map<String, dynamic>) as ReturnType;
case 'CategoryOut':
return CategoryOut.fromJson(value as Map<String, dynamic>) as ReturnType;
case 'CommitRequest':
return CommitRequest.fromJson(value as Map<String, dynamic>) as ReturnType;
case 'DataQualityRow':
return DataQualityRow.fromJson(value as Map<String, dynamic>) as ReturnType;
case 'EventKind':
@@ -96,10 +172,36 @@ final _regMap = RegExp(r'^Map<String,(.*)>$');
case 'FlowType':
case 'ForecastMonth':
return ForecastMonth.fromJson(value as Map<String, dynamic>) as ReturnType;
case 'ForecastOut':
return ForecastOut.fromJson(value as Map<String, dynamic>) as ReturnType;
case 'GoalCreate':
return GoalCreate.fromJson(value as Map<String, dynamic>) as ReturnType;
case 'GoalOut':
return GoalOut.fromJson(value as Map<String, dynamic>) as ReturnType;
case 'GoalPatch':
return GoalPatch.fromJson(value as Map<String, dynamic>) as ReturnType;
case 'GoalProgressOut':
return GoalProgressOut.fromJson(value as Map<String, dynamic>) as ReturnType;
case 'Health':
return Health.fromJson(value as Map<String, dynamic>) as ReturnType;
case 'HistoryOut':
return HistoryOut.fromJson(value as Map<String, dynamic>) as ReturnType;
case 'HistoryRow':
return HistoryRow.fromJson(value as Map<String, dynamic>) as ReturnType;
case 'HistoryTotals':
return HistoryTotals.fromJson(value as Map<String, dynamic>) as ReturnType;
case 'HoldingOut':
return HoldingOut.fromJson(value as Map<String, dynamic>) as ReturnType;
case 'ImportCounts':
return ImportCounts.fromJson(value as Map<String, dynamic>) as ReturnType;
case 'ImportPreview':
return ImportPreview.fromJson(value as Map<String, dynamic>) as ReturnType;
case 'ImportResult':
return ImportResult.fromJson(value as Map<String, dynamic>) as ReturnType;
case 'ImportSummary':
return ImportSummary.fromJson(value as Map<String, dynamic>) as ReturnType;
case 'InstrumentDetail':
return InstrumentDetail.fromJson(value as Map<String, dynamic>) as ReturnType;
case 'InstrumentOut':
@@ -107,6 +209,10 @@ final _regMap = RegExp(r'^Map<String,(.*)>$');
case 'JobStatus':
case 'LinkCreate':
return LinkCreate.fromJson(value as Map<String, dynamic>) as ReturnType;
case 'LinkOut':
return LinkOut.fromJson(value as Map<String, dynamic>) as ReturnType;
case 'LoginRequest':
return LoginRequest.fromJson(value as Map<String, dynamic>) as ReturnType;
case 'LotOut':
@@ -115,10 +221,32 @@ final _regMap = RegExp(r'^Map<String,(.*)>$');
return NetWorthBreakdown.fromJson(value as Map<String, dynamic>) as ReturnType;
case 'NetWorthDay':
return NetWorthDay.fromJson(value as Map<String, dynamic>) as ReturnType;
case 'NewInstrument':
return NewInstrument.fromJson(value as Map<String, dynamic>) as ReturnType;
case 'PendingInstrumentOut':
return PendingInstrumentOut.fromJson(value as Map<String, dynamic>) as ReturnType;
case 'PendingResolveRequest':
return PendingResolveRequest.fromJson(value as Map<String, dynamic>) as ReturnType;
case 'PendingResolveResult':
return PendingResolveResult.fromJson(value as Map<String, dynamic>) as ReturnType;
case 'PriceManualIn':
return PriceManualIn.fromJson(value as Map<String, dynamic>) as ReturnType;
case 'PriceManualOut':
return PriceManualOut.fromJson(value as Map<String, dynamic>) as ReturnType;
case 'PricePoint':
return PricePoint.fromJson(value as Map<String, dynamic>) as ReturnType;
case 'Problem':
return Problem.fromJson(value as Map<String, dynamic>) as ReturnType;
case 'RebalanceBucketOut':
return RebalanceBucketOut.fromJson(value as Map<String, dynamic>) as ReturnType;
case 'RebalanceOut':
return RebalanceOut.fromJson(value as Map<String, dynamic>) as ReturnType;
case 'ReconciliationCash':
return ReconciliationCash.fromJson(value as Map<String, dynamic>) as ReturnType;
case 'ReconciliationOut':
return ReconciliationOut.fromJson(value as Map<String, dynamic>) as ReturnType;
case 'ReconciliationPosition':
return ReconciliationPosition.fromJson(value as Map<String, dynamic>) as ReturnType;
case 'RefreshLogOut':
return RefreshLogOut.fromJson(value as Map<String, dynamic>) as ReturnType;
case 'RefreshRequest':
@@ -142,6 +270,8 @@ final _regMap = RegExp(r'^Map<String,(.*)>$');
case 'RunwayOut':
return RunwayOut.fromJson(value as Map<String, dynamic>) as ReturnType;
case 'SampleEventOut':
return SampleEventOut.fromJson(value as Map<String, dynamic>) as ReturnType;
case 'ScopeOut':
return ScopeOut.fromJson(value as Map<String, dynamic>) as ReturnType;
case 'SourceStatus':
@@ -154,12 +284,38 @@ final _regMap = RegExp(r'^Map<String,(.*)>$');
return SyncJobOut.fromJson(value as Map<String, dynamic>) as ReturnType;
case 'SyncRunOut':
return SyncRunOut.fromJson(value as Map<String, dynamic>) as ReturnType;
case 'TargetIn':
return TargetIn.fromJson(value as Map<String, dynamic>) as ReturnType;
case 'TargetOut':
return TargetOut.fromJson(value as Map<String, dynamic>) as ReturnType;
case 'TargetsIn':
return TargetsIn.fromJson(value as Map<String, dynamic>) as ReturnType;
case 'TargetsOut':
return TargetsOut.fromJson(value as Map<String, dynamic>) as ReturnType;
case 'TaxAccountOut':
return TaxAccountOut.fromJson(value as Map<String, dynamic>) as ReturnType;
case 'TaxLotOut':
return TaxLotOut.fromJson(value as Map<String, dynamic>) as ReturnType;
case 'TaxLotsOut':
return TaxLotsOut.fromJson(value as Map<String, dynamic>) as ReturnType;
case 'TaxTotals':
return TaxTotals.fromJson(value as Map<String, dynamic>) as ReturnType;
case 'TaxYearOut':
return TaxYearOut.fromJson(value as Map<String, dynamic>) as ReturnType;
case 'TokenPair':
return TokenPair.fromJson(value as Map<String, dynamic>) as ReturnType;
case 'TradeOut':
return TradeOut.fromJson(value as Map<String, dynamic>) as ReturnType;
case 'TransactionOut':
return TransactionOut.fromJson(value as Map<String, dynamic>) as ReturnType;
case 'TransactionPage':
return TransactionPage.fromJson(value as Map<String, dynamic>) as ReturnType;
case 'UnmatchedBrokerOut':
return UnmatchedBrokerOut.fromJson(value as Map<String, dynamic>) as ReturnType;
case 'UnmatchedOut':
return UnmatchedOut.fromJson(value as Map<String, dynamic>) as ReturnType;
case 'UnmatchedZmOut':
return UnmatchedZmOut.fromJson(value as Map<String, dynamic>) as ReturnType;
case 'UserOut':
return UserOut.fromJson(value as Map<String, dynamic>) as ReturnType;
case 'ValueDay':
@@ -385,6 +385,7 @@ const _$EventSourceEnumMap = {
EventSource.tinvestApi: 'tinvest_api',
EventSource.reportSber: 'report_sber',
EventSource.reportVtb: 'report_vtb',
EventSource.csv: 'csv',
EventSource.manual: 'manual',
EventSource.unknownDefaultOpenApi: 'unknown_default_open_api',
};
@@ -160,6 +160,7 @@ const _$EventSourceEnumMap = {
EventSource.tinvestApi: 'tinvest_api',
EventSource.reportSber: 'report_sber',
EventSource.reportVtb: 'report_vtb',
EventSource.csv: 'csv',
EventSource.manual: 'manual',
EventSource.unknownDefaultOpenApi: 'unknown_default_open_api',
};
@@ -0,0 +1,106 @@
//
// AUTO-GENERATED FILE, DO NOT MODIFY!
//
// ignore_for_file: unused_element
import 'package:copy_with_extension/copy_with_extension.dart';
import 'package:json_annotation/json_annotation.dart';
part 'account_suggestion.g.dart';
@CopyWith()
@JsonSerializable(
checked: true,
createToJson: true,
disallowUnrecognizedKeys: false,
explicitToJson: true,
)
class AccountSuggestion {
/// Returns a new [AccountSuggestion] instance.
AccountSuggestion({
required this.broker,
required this.id,
required this.name,
required this.sourceId,
});
@JsonKey(
name: r'broker',
required: true,
includeIfNull: true,
)
final String? broker;
@JsonKey(
name: r'id',
required: true,
includeIfNull: false,
)
final int id;
@JsonKey(
name: r'name',
required: true,
includeIfNull: false,
)
final String name;
@JsonKey(
name: r'source_id',
required: true,
includeIfNull: false,
)
final String sourceId;
@override
bool operator ==(Object other) => identical(this, other) || other is AccountSuggestion &&
other.broker == broker &&
other.id == id &&
other.name == name &&
other.sourceId == sourceId;
@override
int get hashCode =>
(broker == null ? 0 : broker.hashCode) +
id.hashCode +
name.hashCode +
sourceId.hashCode;
factory AccountSuggestion.fromJson(Map<String, dynamic> json) => _$AccountSuggestionFromJson(json);
Map<String, dynamic> toJson() => _$AccountSuggestionToJson(this);
@override
String toString() {
return toJson().toString();
}
}
@@ -0,0 +1,116 @@
// GENERATED CODE - DO NOT MODIFY BY HAND
part of 'account_suggestion.dart';
// **************************************************************************
// CopyWithGenerator
// **************************************************************************
abstract class _$AccountSuggestionCWProxy {
AccountSuggestion broker(String? broker);
AccountSuggestion id(int id);
AccountSuggestion name(String name);
AccountSuggestion sourceId(String sourceId);
/// This function **does support** nullification of nullable fields. All `null` values passed to `non-nullable` fields will be ignored. You can also use `AccountSuggestion(...).copyWith.fieldName(...)` to override fields one at a time with nullification support.
///
/// Usage
/// ```dart
/// AccountSuggestion(...).copyWith(id: 12, name: "My name")
/// ````
AccountSuggestion call({
String? broker,
int id,
String name,
String sourceId,
});
}
/// Proxy class for `copyWith` functionality. This is a callable class and can be used as follows: `instanceOfAccountSuggestion.copyWith(...)`. Additionally contains functions for specific fields e.g. `instanceOfAccountSuggestion.copyWith.fieldName(...)`
class _$AccountSuggestionCWProxyImpl implements _$AccountSuggestionCWProxy {
const _$AccountSuggestionCWProxyImpl(this._value);
final AccountSuggestion _value;
@override
AccountSuggestion broker(String? broker) => this(broker: broker);
@override
AccountSuggestion id(int id) => this(id: id);
@override
AccountSuggestion name(String name) => this(name: name);
@override
AccountSuggestion sourceId(String sourceId) => this(sourceId: sourceId);
@override
/// This function **does support** nullification of nullable fields. All `null` values passed to `non-nullable` fields will be ignored. You can also use `AccountSuggestion(...).copyWith.fieldName(...)` to override fields one at a time with nullification support.
///
/// Usage
/// ```dart
/// AccountSuggestion(...).copyWith(id: 12, name: "My name")
/// ````
AccountSuggestion call({
Object? broker = const $CopyWithPlaceholder(),
Object? id = const $CopyWithPlaceholder(),
Object? name = const $CopyWithPlaceholder(),
Object? sourceId = const $CopyWithPlaceholder(),
}) {
return AccountSuggestion(
broker: broker == const $CopyWithPlaceholder()
? _value.broker
// ignore: cast_nullable_to_non_nullable
: broker as String?,
id: id == const $CopyWithPlaceholder()
? _value.id
// ignore: cast_nullable_to_non_nullable
: id as int,
name: name == const $CopyWithPlaceholder()
? _value.name
// ignore: cast_nullable_to_non_nullable
: name as String,
sourceId: sourceId == const $CopyWithPlaceholder()
? _value.sourceId
// ignore: cast_nullable_to_non_nullable
: sourceId as String,
);
}
}
extension $AccountSuggestionCopyWith on AccountSuggestion {
/// Returns a callable class that can be used as follows: `instanceOfAccountSuggestion.copyWith(...)` or like so:`instanceOfAccountSuggestion.copyWith.fieldName(...)`.
// ignore: library_private_types_in_public_api
_$AccountSuggestionCWProxy get copyWith =>
_$AccountSuggestionCWProxyImpl(this);
}
// **************************************************************************
// JsonSerializableGenerator
// **************************************************************************
AccountSuggestion _$AccountSuggestionFromJson(Map<String, dynamic> json) =>
$checkedCreate('AccountSuggestion', json, ($checkedConvert) {
$checkKeys(
json,
requiredKeys: const ['broker', 'id', 'name', 'source_id'],
);
final val = AccountSuggestion(
broker: $checkedConvert('broker', (v) => v as String?),
id: $checkedConvert('id', (v) => (v as num).toInt()),
name: $checkedConvert('name', (v) => v as String),
sourceId: $checkedConvert('source_id', (v) => v as String),
);
return val;
}, fieldKeyMap: const {'sourceId': 'source_id'});
Map<String, dynamic> _$AccountSuggestionToJson(AccountSuggestion instance) =>
<String, dynamic>{
'broker': instance.broker,
'id': instance.id,
'name': instance.name,
'source_id': instance.sourceId,
};
@@ -0,0 +1,59 @@
//
// AUTO-GENERATED FILE, DO NOT MODIFY!
//
// ignore_for_file: unused_element
import 'package:fintracker_api/src/model/benchmark_comparison_out.dart';
import 'package:copy_with_extension/copy_with_extension.dart';
import 'package:json_annotation/json_annotation.dart';
part 'benchmark_comparison.g.dart';
@CopyWith()
@JsonSerializable(
checked: true,
createToJson: true,
disallowUnrecognizedKeys: false,
explicitToJson: true,
)
class BenchmarkComparison {
/// Returns a new [BenchmarkComparison] instance.
BenchmarkComparison({
required this.rows,
});
@JsonKey(
name: r'rows',
required: true,
includeIfNull: false,
)
final List<BenchmarkComparisonOut> rows;
@override
bool operator ==(Object other) => identical(this, other) || other is BenchmarkComparison &&
other.rows == rows;
@override
int get hashCode =>
rows.hashCode;
factory BenchmarkComparison.fromJson(Map<String, dynamic> json) => _$BenchmarkComparisonFromJson(json);
Map<String, dynamic> toJson() => _$BenchmarkComparisonToJson(this);
@override
String toString() {
return toJson().toString();
}
}
@@ -0,0 +1,78 @@
// GENERATED CODE - DO NOT MODIFY BY HAND
part of 'benchmark_comparison.dart';
// **************************************************************************
// CopyWithGenerator
// **************************************************************************
abstract class _$BenchmarkComparisonCWProxy {
BenchmarkComparison rows(List<BenchmarkComparisonOut> rows);
/// This function **does support** nullification of nullable fields. All `null` values passed to `non-nullable` fields will be ignored. You can also use `BenchmarkComparison(...).copyWith.fieldName(...)` to override fields one at a time with nullification support.
///
/// Usage
/// ```dart
/// BenchmarkComparison(...).copyWith(id: 12, name: "My name")
/// ````
BenchmarkComparison call({List<BenchmarkComparisonOut> rows});
}
/// Proxy class for `copyWith` functionality. This is a callable class and can be used as follows: `instanceOfBenchmarkComparison.copyWith(...)`. Additionally contains functions for specific fields e.g. `instanceOfBenchmarkComparison.copyWith.fieldName(...)`
class _$BenchmarkComparisonCWProxyImpl implements _$BenchmarkComparisonCWProxy {
const _$BenchmarkComparisonCWProxyImpl(this._value);
final BenchmarkComparison _value;
@override
BenchmarkComparison rows(List<BenchmarkComparisonOut> rows) =>
this(rows: rows);
@override
/// This function **does support** nullification of nullable fields. All `null` values passed to `non-nullable` fields will be ignored. You can also use `BenchmarkComparison(...).copyWith.fieldName(...)` to override fields one at a time with nullification support.
///
/// Usage
/// ```dart
/// BenchmarkComparison(...).copyWith(id: 12, name: "My name")
/// ````
BenchmarkComparison call({Object? rows = const $CopyWithPlaceholder()}) {
return BenchmarkComparison(
rows: rows == const $CopyWithPlaceholder()
? _value.rows
// ignore: cast_nullable_to_non_nullable
: rows as List<BenchmarkComparisonOut>,
);
}
}
extension $BenchmarkComparisonCopyWith on BenchmarkComparison {
/// Returns a callable class that can be used as follows: `instanceOfBenchmarkComparison.copyWith(...)` or like so:`instanceOfBenchmarkComparison.copyWith.fieldName(...)`.
// ignore: library_private_types_in_public_api
_$BenchmarkComparisonCWProxy get copyWith =>
_$BenchmarkComparisonCWProxyImpl(this);
}
// **************************************************************************
// JsonSerializableGenerator
// **************************************************************************
BenchmarkComparison _$BenchmarkComparisonFromJson(Map<String, dynamic> json) =>
$checkedCreate('BenchmarkComparison', json, ($checkedConvert) {
$checkKeys(json, requiredKeys: const ['rows']);
final val = BenchmarkComparison(
rows: $checkedConvert(
'rows',
(v) => (v as List<dynamic>)
.map(
(e) =>
BenchmarkComparisonOut.fromJson(e as Map<String, dynamic>),
)
.toList(),
),
);
return val;
});
Map<String, dynamic> _$BenchmarkComparisonToJson(
BenchmarkComparison instance,
) => <String, dynamic>{'rows': instance.rows.map((e) => e.toJson()).toList()};
@@ -0,0 +1,157 @@
//
// AUTO-GENERATED FILE, DO NOT MODIFY!
//
// ignore_for_file: unused_element
import 'package:fintracker_api/src/model/benchmark_return_out.dart';
import 'package:copy_with_extension/copy_with_extension.dart';
import 'package:json_annotation/json_annotation.dart';
part 'benchmark_comparison_out.g.dart';
@CopyWith()
@JsonSerializable(
checked: true,
createToJson: true,
disallowUnrecognizedKeys: false,
explicitToJson: true,
)
class BenchmarkComparisonOut {
/// Returns a new [BenchmarkComparisonOut] instance.
BenchmarkComparisonOut({
required this.benchmarks,
required this.dateFrom,
required this.dateTo,
required this.period,
required this.portfolioDaysSkipped,
required this.portfolioTwr,
required this.portfolioTwrAnnualized,
});
@JsonKey(
name: r'benchmarks',
required: true,
includeIfNull: false,
)
final List<BenchmarkReturnOut> benchmarks;
@JsonKey(
name: r'date_from',
required: true,
includeIfNull: false,
)
final DateTime dateFrom;
@JsonKey(
name: r'date_to',
required: true,
includeIfNull: false,
)
final DateTime dateTo;
@JsonKey(
name: r'period',
required: true,
includeIfNull: false,
)
final String period;
@JsonKey(
name: r'portfolio_days_skipped',
required: true,
includeIfNull: false,
)
final int portfolioDaysSkipped;
/// decimal as string
@JsonKey(
name: r'portfolio_twr',
required: true,
includeIfNull: true,
)
final String? portfolioTwr;
/// decimal as string
@JsonKey(
name: r'portfolio_twr_annualized',
required: true,
includeIfNull: true,
)
final String? portfolioTwrAnnualized;
@override
bool operator ==(Object other) => identical(this, other) || other is BenchmarkComparisonOut &&
other.benchmarks == benchmarks &&
other.dateFrom == dateFrom &&
other.dateTo == dateTo &&
other.period == period &&
other.portfolioDaysSkipped == portfolioDaysSkipped &&
other.portfolioTwr == portfolioTwr &&
other.portfolioTwrAnnualized == portfolioTwrAnnualized;
@override
int get hashCode =>
benchmarks.hashCode +
dateFrom.hashCode +
dateTo.hashCode +
period.hashCode +
portfolioDaysSkipped.hashCode +
(portfolioTwr == null ? 0 : portfolioTwr.hashCode) +
(portfolioTwrAnnualized == null ? 0 : portfolioTwrAnnualized.hashCode);
factory BenchmarkComparisonOut.fromJson(Map<String, dynamic> json) => _$BenchmarkComparisonOutFromJson(json);
Map<String, dynamic> toJson() => _$BenchmarkComparisonOutToJson(this);
@override
String toString() {
return toJson().toString();
}
}
@@ -0,0 +1,198 @@
// GENERATED CODE - DO NOT MODIFY BY HAND
part of 'benchmark_comparison_out.dart';
// **************************************************************************
// CopyWithGenerator
// **************************************************************************
abstract class _$BenchmarkComparisonOutCWProxy {
BenchmarkComparisonOut benchmarks(List<BenchmarkReturnOut> benchmarks);
BenchmarkComparisonOut dateFrom(DateTime dateFrom);
BenchmarkComparisonOut dateTo(DateTime dateTo);
BenchmarkComparisonOut period(String period);
BenchmarkComparisonOut portfolioDaysSkipped(int portfolioDaysSkipped);
BenchmarkComparisonOut portfolioTwr(String? portfolioTwr);
BenchmarkComparisonOut portfolioTwrAnnualized(String? portfolioTwrAnnualized);
/// This function **does support** nullification of nullable fields. All `null` values passed to `non-nullable` fields will be ignored. You can also use `BenchmarkComparisonOut(...).copyWith.fieldName(...)` to override fields one at a time with nullification support.
///
/// Usage
/// ```dart
/// BenchmarkComparisonOut(...).copyWith(id: 12, name: "My name")
/// ````
BenchmarkComparisonOut call({
List<BenchmarkReturnOut> benchmarks,
DateTime dateFrom,
DateTime dateTo,
String period,
int portfolioDaysSkipped,
String? portfolioTwr,
String? portfolioTwrAnnualized,
});
}
/// Proxy class for `copyWith` functionality. This is a callable class and can be used as follows: `instanceOfBenchmarkComparisonOut.copyWith(...)`. Additionally contains functions for specific fields e.g. `instanceOfBenchmarkComparisonOut.copyWith.fieldName(...)`
class _$BenchmarkComparisonOutCWProxyImpl
implements _$BenchmarkComparisonOutCWProxy {
const _$BenchmarkComparisonOutCWProxyImpl(this._value);
final BenchmarkComparisonOut _value;
@override
BenchmarkComparisonOut benchmarks(List<BenchmarkReturnOut> benchmarks) =>
this(benchmarks: benchmarks);
@override
BenchmarkComparisonOut dateFrom(DateTime dateFrom) =>
this(dateFrom: dateFrom);
@override
BenchmarkComparisonOut dateTo(DateTime dateTo) => this(dateTo: dateTo);
@override
BenchmarkComparisonOut period(String period) => this(period: period);
@override
BenchmarkComparisonOut portfolioDaysSkipped(int portfolioDaysSkipped) =>
this(portfolioDaysSkipped: portfolioDaysSkipped);
@override
BenchmarkComparisonOut portfolioTwr(String? portfolioTwr) =>
this(portfolioTwr: portfolioTwr);
@override
BenchmarkComparisonOut portfolioTwrAnnualized(
String? portfolioTwrAnnualized,
) => this(portfolioTwrAnnualized: portfolioTwrAnnualized);
@override
/// This function **does support** nullification of nullable fields. All `null` values passed to `non-nullable` fields will be ignored. You can also use `BenchmarkComparisonOut(...).copyWith.fieldName(...)` to override fields one at a time with nullification support.
///
/// Usage
/// ```dart
/// BenchmarkComparisonOut(...).copyWith(id: 12, name: "My name")
/// ````
BenchmarkComparisonOut call({
Object? benchmarks = const $CopyWithPlaceholder(),
Object? dateFrom = const $CopyWithPlaceholder(),
Object? dateTo = const $CopyWithPlaceholder(),
Object? period = const $CopyWithPlaceholder(),
Object? portfolioDaysSkipped = const $CopyWithPlaceholder(),
Object? portfolioTwr = const $CopyWithPlaceholder(),
Object? portfolioTwrAnnualized = const $CopyWithPlaceholder(),
}) {
return BenchmarkComparisonOut(
benchmarks: benchmarks == const $CopyWithPlaceholder()
? _value.benchmarks
// ignore: cast_nullable_to_non_nullable
: benchmarks as List<BenchmarkReturnOut>,
dateFrom: dateFrom == const $CopyWithPlaceholder()
? _value.dateFrom
// ignore: cast_nullable_to_non_nullable
: dateFrom as DateTime,
dateTo: dateTo == const $CopyWithPlaceholder()
? _value.dateTo
// ignore: cast_nullable_to_non_nullable
: dateTo as DateTime,
period: period == const $CopyWithPlaceholder()
? _value.period
// ignore: cast_nullable_to_non_nullable
: period as String,
portfolioDaysSkipped: portfolioDaysSkipped == const $CopyWithPlaceholder()
? _value.portfolioDaysSkipped
// ignore: cast_nullable_to_non_nullable
: portfolioDaysSkipped as int,
portfolioTwr: portfolioTwr == const $CopyWithPlaceholder()
? _value.portfolioTwr
// ignore: cast_nullable_to_non_nullable
: portfolioTwr as String?,
portfolioTwrAnnualized:
portfolioTwrAnnualized == const $CopyWithPlaceholder()
? _value.portfolioTwrAnnualized
// ignore: cast_nullable_to_non_nullable
: portfolioTwrAnnualized as String?,
);
}
}
extension $BenchmarkComparisonOutCopyWith on BenchmarkComparisonOut {
/// Returns a callable class that can be used as follows: `instanceOfBenchmarkComparisonOut.copyWith(...)` or like so:`instanceOfBenchmarkComparisonOut.copyWith.fieldName(...)`.
// ignore: library_private_types_in_public_api
_$BenchmarkComparisonOutCWProxy get copyWith =>
_$BenchmarkComparisonOutCWProxyImpl(this);
}
// **************************************************************************
// JsonSerializableGenerator
// **************************************************************************
BenchmarkComparisonOut _$BenchmarkComparisonOutFromJson(
Map<String, dynamic> json,
) => $checkedCreate(
'BenchmarkComparisonOut',
json,
($checkedConvert) {
$checkKeys(
json,
requiredKeys: const [
'benchmarks',
'date_from',
'date_to',
'period',
'portfolio_days_skipped',
'portfolio_twr',
'portfolio_twr_annualized',
],
);
final val = BenchmarkComparisonOut(
benchmarks: $checkedConvert(
'benchmarks',
(v) => (v as List<dynamic>)
.map((e) => BenchmarkReturnOut.fromJson(e as Map<String, dynamic>))
.toList(),
),
dateFrom: $checkedConvert(
'date_from',
(v) => DateTime.parse(v as String),
),
dateTo: $checkedConvert('date_to', (v) => DateTime.parse(v as String)),
period: $checkedConvert('period', (v) => v as String),
portfolioDaysSkipped: $checkedConvert(
'portfolio_days_skipped',
(v) => (v as num).toInt(),
),
portfolioTwr: $checkedConvert('portfolio_twr', (v) => v as String?),
portfolioTwrAnnualized: $checkedConvert(
'portfolio_twr_annualized',
(v) => v as String?,
),
);
return val;
},
fieldKeyMap: const {
'dateFrom': 'date_from',
'dateTo': 'date_to',
'portfolioDaysSkipped': 'portfolio_days_skipped',
'portfolioTwr': 'portfolio_twr',
'portfolioTwrAnnualized': 'portfolio_twr_annualized',
},
);
Map<String, dynamic> _$BenchmarkComparisonOutToJson(
BenchmarkComparisonOut instance,
) => <String, dynamic>{
'benchmarks': instance.benchmarks.map((e) => e.toJson()).toList(),
'date_from': instance.dateFrom.toIso8601String(),
'date_to': instance.dateTo.toIso8601String(),
'period': instance.period,
'portfolio_days_skipped': instance.portfolioDaysSkipped,
'portfolio_twr': instance.portfolioTwr,
'portfolio_twr_annualized': instance.portfolioTwrAnnualized,
};
@@ -0,0 +1,170 @@
//
// AUTO-GENERATED FILE, DO NOT MODIFY!
//
// ignore_for_file: unused_element
import 'package:copy_with_extension/copy_with_extension.dart';
import 'package:json_annotation/json_annotation.dart';
part 'benchmark_create.g.dart';
@CopyWith()
@JsonSerializable(
checked: true,
createToJson: true,
disallowUnrecognizedKeys: false,
explicitToJson: true,
)
class BenchmarkCreate {
/// Returns a new [BenchmarkCreate] instance.
BenchmarkCreate({
required this.code,
this.currency = 'RUB',
this.instrumentId,
this.isActive = true,
this.isDefault = false,
required this.kind,
required this.name,
this.source_ = 'moex',
});
@JsonKey(
name: r'code',
required: true,
includeIfNull: false,
)
final String code;
@JsonKey(
defaultValue: 'RUB',
name: r'currency',
required: false,
includeIfNull: false,
)
final String? currency;
@JsonKey(
name: r'instrument_id',
required: false,
includeIfNull: false,
)
final int? instrumentId;
@JsonKey(
defaultValue: true,
name: r'is_active',
required: false,
includeIfNull: false,
)
final bool? isActive;
@JsonKey(
defaultValue: false,
name: r'is_default',
required: false,
includeIfNull: false,
)
final bool? isDefault;
@JsonKey(
name: r'kind',
required: true,
includeIfNull: false,
)
final String kind;
@JsonKey(
name: r'name',
required: true,
includeIfNull: false,
)
final String name;
@JsonKey(
defaultValue: 'moex',
name: r'source',
required: false,
includeIfNull: false,
)
final String? source_;
@override
bool operator ==(Object other) => identical(this, other) || other is BenchmarkCreate &&
other.code == code &&
other.currency == currency &&
other.instrumentId == instrumentId &&
other.isActive == isActive &&
other.isDefault == isDefault &&
other.kind == kind &&
other.name == name &&
other.source_ == source_;
@override
int get hashCode =>
code.hashCode +
currency.hashCode +
(instrumentId == null ? 0 : instrumentId.hashCode) +
isActive.hashCode +
isDefault.hashCode +
kind.hashCode +
name.hashCode +
source_.hashCode;
factory BenchmarkCreate.fromJson(Map<String, dynamic> json) => _$BenchmarkCreateFromJson(json);
Map<String, dynamic> toJson() => _$BenchmarkCreateToJson(this);
@override
String toString() {
return toJson().toString();
}
}
@@ -0,0 +1,178 @@
// GENERATED CODE - DO NOT MODIFY BY HAND
part of 'benchmark_create.dart';
// **************************************************************************
// CopyWithGenerator
// **************************************************************************
abstract class _$BenchmarkCreateCWProxy {
BenchmarkCreate code(String code);
BenchmarkCreate currency(String? currency);
BenchmarkCreate instrumentId(int? instrumentId);
BenchmarkCreate isActive(bool? isActive);
BenchmarkCreate isDefault(bool? isDefault);
BenchmarkCreate kind(String kind);
BenchmarkCreate name(String name);
BenchmarkCreate source_(String? source_);
/// This function **does support** nullification of nullable fields. All `null` values passed to `non-nullable` fields will be ignored. You can also use `BenchmarkCreate(...).copyWith.fieldName(...)` to override fields one at a time with nullification support.
///
/// Usage
/// ```dart
/// BenchmarkCreate(...).copyWith(id: 12, name: "My name")
/// ````
BenchmarkCreate call({
String code,
String? currency,
int? instrumentId,
bool? isActive,
bool? isDefault,
String kind,
String name,
String? source_,
});
}
/// Proxy class for `copyWith` functionality. This is a callable class and can be used as follows: `instanceOfBenchmarkCreate.copyWith(...)`. Additionally contains functions for specific fields e.g. `instanceOfBenchmarkCreate.copyWith.fieldName(...)`
class _$BenchmarkCreateCWProxyImpl implements _$BenchmarkCreateCWProxy {
const _$BenchmarkCreateCWProxyImpl(this._value);
final BenchmarkCreate _value;
@override
BenchmarkCreate code(String code) => this(code: code);
@override
BenchmarkCreate currency(String? currency) => this(currency: currency);
@override
BenchmarkCreate instrumentId(int? instrumentId) =>
this(instrumentId: instrumentId);
@override
BenchmarkCreate isActive(bool? isActive) => this(isActive: isActive);
@override
BenchmarkCreate isDefault(bool? isDefault) => this(isDefault: isDefault);
@override
BenchmarkCreate kind(String kind) => this(kind: kind);
@override
BenchmarkCreate name(String name) => this(name: name);
@override
BenchmarkCreate source_(String? source_) => this(source_: source_);
@override
/// This function **does support** nullification of nullable fields. All `null` values passed to `non-nullable` fields will be ignored. You can also use `BenchmarkCreate(...).copyWith.fieldName(...)` to override fields one at a time with nullification support.
///
/// Usage
/// ```dart
/// BenchmarkCreate(...).copyWith(id: 12, name: "My name")
/// ````
BenchmarkCreate call({
Object? code = const $CopyWithPlaceholder(),
Object? currency = const $CopyWithPlaceholder(),
Object? instrumentId = const $CopyWithPlaceholder(),
Object? isActive = const $CopyWithPlaceholder(),
Object? isDefault = const $CopyWithPlaceholder(),
Object? kind = const $CopyWithPlaceholder(),
Object? name = const $CopyWithPlaceholder(),
Object? source_ = const $CopyWithPlaceholder(),
}) {
return BenchmarkCreate(
code: code == const $CopyWithPlaceholder()
? _value.code
// ignore: cast_nullable_to_non_nullable
: code as String,
currency: currency == const $CopyWithPlaceholder()
? _value.currency
// ignore: cast_nullable_to_non_nullable
: currency as String?,
instrumentId: instrumentId == const $CopyWithPlaceholder()
? _value.instrumentId
// ignore: cast_nullable_to_non_nullable
: instrumentId as int?,
isActive: isActive == const $CopyWithPlaceholder()
? _value.isActive
// ignore: cast_nullable_to_non_nullable
: isActive as bool?,
isDefault: isDefault == const $CopyWithPlaceholder()
? _value.isDefault
// ignore: cast_nullable_to_non_nullable
: isDefault as bool?,
kind: kind == const $CopyWithPlaceholder()
? _value.kind
// ignore: cast_nullable_to_non_nullable
: kind as String,
name: name == const $CopyWithPlaceholder()
? _value.name
// ignore: cast_nullable_to_non_nullable
: name as String,
source_: source_ == const $CopyWithPlaceholder()
? _value.source_
// ignore: cast_nullable_to_non_nullable
: source_ as String?,
);
}
}
extension $BenchmarkCreateCopyWith on BenchmarkCreate {
/// Returns a callable class that can be used as follows: `instanceOfBenchmarkCreate.copyWith(...)` or like so:`instanceOfBenchmarkCreate.copyWith.fieldName(...)`.
// ignore: library_private_types_in_public_api
_$BenchmarkCreateCWProxy get copyWith => _$BenchmarkCreateCWProxyImpl(this);
}
// **************************************************************************
// JsonSerializableGenerator
// **************************************************************************
BenchmarkCreate _$BenchmarkCreateFromJson(Map<String, dynamic> json) =>
$checkedCreate(
'BenchmarkCreate',
json,
($checkedConvert) {
$checkKeys(json, requiredKeys: const ['code', 'kind', 'name']);
final val = BenchmarkCreate(
code: $checkedConvert('code', (v) => v as String),
currency: $checkedConvert('currency', (v) => v as String? ?? 'RUB'),
instrumentId: $checkedConvert(
'instrument_id',
(v) => (v as num?)?.toInt(),
),
isActive: $checkedConvert('is_active', (v) => v as bool? ?? true),
isDefault: $checkedConvert('is_default', (v) => v as bool? ?? false),
kind: $checkedConvert('kind', (v) => v as String),
name: $checkedConvert('name', (v) => v as String),
source_: $checkedConvert('source', (v) => v as String? ?? 'moex'),
);
return val;
},
fieldKeyMap: const {
'instrumentId': 'instrument_id',
'isActive': 'is_active',
'isDefault': 'is_default',
'source_': 'source',
},
);
Map<String, dynamic> _$BenchmarkCreateToJson(BenchmarkCreate instance) =>
<String, dynamic>{
'code': instance.code,
'currency': ?instance.currency,
'instrument_id': ?instance.instrumentId,
'is_active': ?instance.isActive,
'is_default': ?instance.isDefault,
'kind': instance.kind,
'name': instance.name,
'source': ?instance.source_,
};
@@ -0,0 +1,218 @@
//
// AUTO-GENERATED FILE, DO NOT MODIFY!
//
// ignore_for_file: unused_element
import 'package:copy_with_extension/copy_with_extension.dart';
import 'package:json_annotation/json_annotation.dart';
part 'benchmark_out.g.dart';
@CopyWith()
@JsonSerializable(
checked: true,
createToJson: true,
disallowUnrecognizedKeys: false,
explicitToJson: true,
)
class BenchmarkOut {
/// Returns a new [BenchmarkOut] instance.
BenchmarkOut({
required this.code,
required this.currency,
required this.historyFrom,
required this.historyTo,
required this.id,
required this.instrumentId,
required this.isActive,
required this.isDefault,
required this.kind,
required this.name,
required this.source_,
});
@JsonKey(
name: r'code',
required: true,
includeIfNull: false,
)
final String code;
@JsonKey(
name: r'currency',
required: true,
includeIfNull: false,
)
final String currency;
@JsonKey(
name: r'history_from',
required: true,
includeIfNull: true,
)
final DateTime? historyFrom;
@JsonKey(
name: r'history_to',
required: true,
includeIfNull: true,
)
final DateTime? historyTo;
@JsonKey(
name: r'id',
required: true,
includeIfNull: false,
)
final int id;
@JsonKey(
name: r'instrument_id',
required: true,
includeIfNull: true,
)
final int? instrumentId;
@JsonKey(
name: r'is_active',
required: true,
includeIfNull: false,
)
final bool isActive;
@JsonKey(
name: r'is_default',
required: true,
includeIfNull: false,
)
final bool isDefault;
@JsonKey(
name: r'kind',
required: true,
includeIfNull: false,
)
final String kind;
@JsonKey(
name: r'name',
required: true,
includeIfNull: false,
)
final String name;
@JsonKey(
name: r'source',
required: true,
includeIfNull: false,
)
final String source_;
@override
bool operator ==(Object other) => identical(this, other) || other is BenchmarkOut &&
other.code == code &&
other.currency == currency &&
other.historyFrom == historyFrom &&
other.historyTo == historyTo &&
other.id == id &&
other.instrumentId == instrumentId &&
other.isActive == isActive &&
other.isDefault == isDefault &&
other.kind == kind &&
other.name == name &&
other.source_ == source_;
@override
int get hashCode =>
code.hashCode +
currency.hashCode +
(historyFrom == null ? 0 : historyFrom.hashCode) +
(historyTo == null ? 0 : historyTo.hashCode) +
id.hashCode +
(instrumentId == null ? 0 : instrumentId.hashCode) +
isActive.hashCode +
isDefault.hashCode +
kind.hashCode +
name.hashCode +
source_.hashCode;
factory BenchmarkOut.fromJson(Map<String, dynamic> json) => _$BenchmarkOutFromJson(json);
Map<String, dynamic> toJson() => _$BenchmarkOutToJson(this);
@override
String toString() {
return toJson().toString();
}
}
@@ -0,0 +1,241 @@
// GENERATED CODE - DO NOT MODIFY BY HAND
part of 'benchmark_out.dart';
// **************************************************************************
// CopyWithGenerator
// **************************************************************************
abstract class _$BenchmarkOutCWProxy {
BenchmarkOut code(String code);
BenchmarkOut currency(String currency);
BenchmarkOut historyFrom(DateTime? historyFrom);
BenchmarkOut historyTo(DateTime? historyTo);
BenchmarkOut id(int id);
BenchmarkOut instrumentId(int? instrumentId);
BenchmarkOut isActive(bool isActive);
BenchmarkOut isDefault(bool isDefault);
BenchmarkOut kind(String kind);
BenchmarkOut name(String name);
BenchmarkOut source_(String source_);
/// This function **does support** nullification of nullable fields. All `null` values passed to `non-nullable` fields will be ignored. You can also use `BenchmarkOut(...).copyWith.fieldName(...)` to override fields one at a time with nullification support.
///
/// Usage
/// ```dart
/// BenchmarkOut(...).copyWith(id: 12, name: "My name")
/// ````
BenchmarkOut call({
String code,
String currency,
DateTime? historyFrom,
DateTime? historyTo,
int id,
int? instrumentId,
bool isActive,
bool isDefault,
String kind,
String name,
String source_,
});
}
/// Proxy class for `copyWith` functionality. This is a callable class and can be used as follows: `instanceOfBenchmarkOut.copyWith(...)`. Additionally contains functions for specific fields e.g. `instanceOfBenchmarkOut.copyWith.fieldName(...)`
class _$BenchmarkOutCWProxyImpl implements _$BenchmarkOutCWProxy {
const _$BenchmarkOutCWProxyImpl(this._value);
final BenchmarkOut _value;
@override
BenchmarkOut code(String code) => this(code: code);
@override
BenchmarkOut currency(String currency) => this(currency: currency);
@override
BenchmarkOut historyFrom(DateTime? historyFrom) =>
this(historyFrom: historyFrom);
@override
BenchmarkOut historyTo(DateTime? historyTo) => this(historyTo: historyTo);
@override
BenchmarkOut id(int id) => this(id: id);
@override
BenchmarkOut instrumentId(int? instrumentId) =>
this(instrumentId: instrumentId);
@override
BenchmarkOut isActive(bool isActive) => this(isActive: isActive);
@override
BenchmarkOut isDefault(bool isDefault) => this(isDefault: isDefault);
@override
BenchmarkOut kind(String kind) => this(kind: kind);
@override
BenchmarkOut name(String name) => this(name: name);
@override
BenchmarkOut source_(String source_) => this(source_: source_);
@override
/// This function **does support** nullification of nullable fields. All `null` values passed to `non-nullable` fields will be ignored. You can also use `BenchmarkOut(...).copyWith.fieldName(...)` to override fields one at a time with nullification support.
///
/// Usage
/// ```dart
/// BenchmarkOut(...).copyWith(id: 12, name: "My name")
/// ````
BenchmarkOut call({
Object? code = const $CopyWithPlaceholder(),
Object? currency = const $CopyWithPlaceholder(),
Object? historyFrom = const $CopyWithPlaceholder(),
Object? historyTo = const $CopyWithPlaceholder(),
Object? id = const $CopyWithPlaceholder(),
Object? instrumentId = const $CopyWithPlaceholder(),
Object? isActive = const $CopyWithPlaceholder(),
Object? isDefault = const $CopyWithPlaceholder(),
Object? kind = const $CopyWithPlaceholder(),
Object? name = const $CopyWithPlaceholder(),
Object? source_ = const $CopyWithPlaceholder(),
}) {
return BenchmarkOut(
code: code == const $CopyWithPlaceholder()
? _value.code
// ignore: cast_nullable_to_non_nullable
: code as String,
currency: currency == const $CopyWithPlaceholder()
? _value.currency
// ignore: cast_nullable_to_non_nullable
: currency as String,
historyFrom: historyFrom == const $CopyWithPlaceholder()
? _value.historyFrom
// ignore: cast_nullable_to_non_nullable
: historyFrom as DateTime?,
historyTo: historyTo == const $CopyWithPlaceholder()
? _value.historyTo
// ignore: cast_nullable_to_non_nullable
: historyTo as DateTime?,
id: id == const $CopyWithPlaceholder()
? _value.id
// ignore: cast_nullable_to_non_nullable
: id as int,
instrumentId: instrumentId == const $CopyWithPlaceholder()
? _value.instrumentId
// ignore: cast_nullable_to_non_nullable
: instrumentId as int?,
isActive: isActive == const $CopyWithPlaceholder()
? _value.isActive
// ignore: cast_nullable_to_non_nullable
: isActive as bool,
isDefault: isDefault == const $CopyWithPlaceholder()
? _value.isDefault
// ignore: cast_nullable_to_non_nullable
: isDefault as bool,
kind: kind == const $CopyWithPlaceholder()
? _value.kind
// ignore: cast_nullable_to_non_nullable
: kind as String,
name: name == const $CopyWithPlaceholder()
? _value.name
// ignore: cast_nullable_to_non_nullable
: name as String,
source_: source_ == const $CopyWithPlaceholder()
? _value.source_
// ignore: cast_nullable_to_non_nullable
: source_ as String,
);
}
}
extension $BenchmarkOutCopyWith on BenchmarkOut {
/// Returns a callable class that can be used as follows: `instanceOfBenchmarkOut.copyWith(...)` or like so:`instanceOfBenchmarkOut.copyWith.fieldName(...)`.
// ignore: library_private_types_in_public_api
_$BenchmarkOutCWProxy get copyWith => _$BenchmarkOutCWProxyImpl(this);
}
// **************************************************************************
// JsonSerializableGenerator
// **************************************************************************
BenchmarkOut _$BenchmarkOutFromJson(Map<String, dynamic> json) =>
$checkedCreate(
'BenchmarkOut',
json,
($checkedConvert) {
$checkKeys(
json,
requiredKeys: const [
'code',
'currency',
'history_from',
'history_to',
'id',
'instrument_id',
'is_active',
'is_default',
'kind',
'name',
'source',
],
);
final val = BenchmarkOut(
code: $checkedConvert('code', (v) => v as String),
currency: $checkedConvert('currency', (v) => v as String),
historyFrom: $checkedConvert(
'history_from',
(v) => v == null ? null : DateTime.parse(v as String),
),
historyTo: $checkedConvert(
'history_to',
(v) => v == null ? null : DateTime.parse(v as String),
),
id: $checkedConvert('id', (v) => (v as num).toInt()),
instrumentId: $checkedConvert(
'instrument_id',
(v) => (v as num?)?.toInt(),
),
isActive: $checkedConvert('is_active', (v) => v as bool),
isDefault: $checkedConvert('is_default', (v) => v as bool),
kind: $checkedConvert('kind', (v) => v as String),
name: $checkedConvert('name', (v) => v as String),
source_: $checkedConvert('source', (v) => v as String),
);
return val;
},
fieldKeyMap: const {
'historyFrom': 'history_from',
'historyTo': 'history_to',
'instrumentId': 'instrument_id',
'isActive': 'is_active',
'isDefault': 'is_default',
'source_': 'source',
},
);
Map<String, dynamic> _$BenchmarkOutToJson(BenchmarkOut instance) =>
<String, dynamic>{
'code': instance.code,
'currency': instance.currency,
'history_from': instance.historyFrom?.toIso8601String(),
'history_to': instance.historyTo?.toIso8601String(),
'id': instance.id,
'instrument_id': instance.instrumentId,
'is_active': instance.isActive,
'is_default': instance.isDefault,
'kind': instance.kind,
'name': instance.name,
'source': instance.source_,
};
@@ -0,0 +1,170 @@
//
// AUTO-GENERATED FILE, DO NOT MODIFY!
//
// ignore_for_file: unused_element
import 'package:copy_with_extension/copy_with_extension.dart';
import 'package:json_annotation/json_annotation.dart';
part 'benchmark_patch.g.dart';
@CopyWith()
@JsonSerializable(
checked: true,
createToJson: true,
disallowUnrecognizedKeys: false,
explicitToJson: true,
)
class BenchmarkPatch {
/// Returns a new [BenchmarkPatch] instance.
BenchmarkPatch({
this.code,
this.currency,
this.instrumentId,
this.isActive,
this.isDefault,
this.kind,
this.name,
this.source_,
});
@JsonKey(
name: r'code',
required: false,
includeIfNull: false,
)
final String? code;
@JsonKey(
name: r'currency',
required: false,
includeIfNull: false,
)
final String? currency;
@JsonKey(
name: r'instrument_id',
required: false,
includeIfNull: false,
)
final int? instrumentId;
@JsonKey(
name: r'is_active',
required: false,
includeIfNull: false,
)
final bool? isActive;
@JsonKey(
name: r'is_default',
required: false,
includeIfNull: false,
)
final bool? isDefault;
@JsonKey(
name: r'kind',
required: false,
includeIfNull: false,
)
final String? kind;
@JsonKey(
name: r'name',
required: false,
includeIfNull: false,
)
final String? name;
@JsonKey(
name: r'source',
required: false,
includeIfNull: false,
)
final String? source_;
@override
bool operator ==(Object other) => identical(this, other) || other is BenchmarkPatch &&
other.code == code &&
other.currency == currency &&
other.instrumentId == instrumentId &&
other.isActive == isActive &&
other.isDefault == isDefault &&
other.kind == kind &&
other.name == name &&
other.source_ == source_;
@override
int get hashCode =>
(code == null ? 0 : code.hashCode) +
(currency == null ? 0 : currency.hashCode) +
(instrumentId == null ? 0 : instrumentId.hashCode) +
(isActive == null ? 0 : isActive.hashCode) +
(isDefault == null ? 0 : isDefault.hashCode) +
(kind == null ? 0 : kind.hashCode) +
(name == null ? 0 : name.hashCode) +
(source_ == null ? 0 : source_.hashCode);
factory BenchmarkPatch.fromJson(Map<String, dynamic> json) => _$BenchmarkPatchFromJson(json);
Map<String, dynamic> toJson() => _$BenchmarkPatchToJson(this);
@override
String toString() {
return toJson().toString();
}
}
@@ -0,0 +1,177 @@
// GENERATED CODE - DO NOT MODIFY BY HAND
part of 'benchmark_patch.dart';
// **************************************************************************
// CopyWithGenerator
// **************************************************************************
abstract class _$BenchmarkPatchCWProxy {
BenchmarkPatch code(String? code);
BenchmarkPatch currency(String? currency);
BenchmarkPatch instrumentId(int? instrumentId);
BenchmarkPatch isActive(bool? isActive);
BenchmarkPatch isDefault(bool? isDefault);
BenchmarkPatch kind(String? kind);
BenchmarkPatch name(String? name);
BenchmarkPatch source_(String? source_);
/// This function **does support** nullification of nullable fields. All `null` values passed to `non-nullable` fields will be ignored. You can also use `BenchmarkPatch(...).copyWith.fieldName(...)` to override fields one at a time with nullification support.
///
/// Usage
/// ```dart
/// BenchmarkPatch(...).copyWith(id: 12, name: "My name")
/// ````
BenchmarkPatch call({
String? code,
String? currency,
int? instrumentId,
bool? isActive,
bool? isDefault,
String? kind,
String? name,
String? source_,
});
}
/// Proxy class for `copyWith` functionality. This is a callable class and can be used as follows: `instanceOfBenchmarkPatch.copyWith(...)`. Additionally contains functions for specific fields e.g. `instanceOfBenchmarkPatch.copyWith.fieldName(...)`
class _$BenchmarkPatchCWProxyImpl implements _$BenchmarkPatchCWProxy {
const _$BenchmarkPatchCWProxyImpl(this._value);
final BenchmarkPatch _value;
@override
BenchmarkPatch code(String? code) => this(code: code);
@override
BenchmarkPatch currency(String? currency) => this(currency: currency);
@override
BenchmarkPatch instrumentId(int? instrumentId) =>
this(instrumentId: instrumentId);
@override
BenchmarkPatch isActive(bool? isActive) => this(isActive: isActive);
@override
BenchmarkPatch isDefault(bool? isDefault) => this(isDefault: isDefault);
@override
BenchmarkPatch kind(String? kind) => this(kind: kind);
@override
BenchmarkPatch name(String? name) => this(name: name);
@override
BenchmarkPatch source_(String? source_) => this(source_: source_);
@override
/// This function **does support** nullification of nullable fields. All `null` values passed to `non-nullable` fields will be ignored. You can also use `BenchmarkPatch(...).copyWith.fieldName(...)` to override fields one at a time with nullification support.
///
/// Usage
/// ```dart
/// BenchmarkPatch(...).copyWith(id: 12, name: "My name")
/// ````
BenchmarkPatch call({
Object? code = const $CopyWithPlaceholder(),
Object? currency = const $CopyWithPlaceholder(),
Object? instrumentId = const $CopyWithPlaceholder(),
Object? isActive = const $CopyWithPlaceholder(),
Object? isDefault = const $CopyWithPlaceholder(),
Object? kind = const $CopyWithPlaceholder(),
Object? name = const $CopyWithPlaceholder(),
Object? source_ = const $CopyWithPlaceholder(),
}) {
return BenchmarkPatch(
code: code == const $CopyWithPlaceholder()
? _value.code
// ignore: cast_nullable_to_non_nullable
: code as String?,
currency: currency == const $CopyWithPlaceholder()
? _value.currency
// ignore: cast_nullable_to_non_nullable
: currency as String?,
instrumentId: instrumentId == const $CopyWithPlaceholder()
? _value.instrumentId
// ignore: cast_nullable_to_non_nullable
: instrumentId as int?,
isActive: isActive == const $CopyWithPlaceholder()
? _value.isActive
// ignore: cast_nullable_to_non_nullable
: isActive as bool?,
isDefault: isDefault == const $CopyWithPlaceholder()
? _value.isDefault
// ignore: cast_nullable_to_non_nullable
: isDefault as bool?,
kind: kind == const $CopyWithPlaceholder()
? _value.kind
// ignore: cast_nullable_to_non_nullable
: kind as String?,
name: name == const $CopyWithPlaceholder()
? _value.name
// ignore: cast_nullable_to_non_nullable
: name as String?,
source_: source_ == const $CopyWithPlaceholder()
? _value.source_
// ignore: cast_nullable_to_non_nullable
: source_ as String?,
);
}
}
extension $BenchmarkPatchCopyWith on BenchmarkPatch {
/// Returns a callable class that can be used as follows: `instanceOfBenchmarkPatch.copyWith(...)` or like so:`instanceOfBenchmarkPatch.copyWith.fieldName(...)`.
// ignore: library_private_types_in_public_api
_$BenchmarkPatchCWProxy get copyWith => _$BenchmarkPatchCWProxyImpl(this);
}
// **************************************************************************
// JsonSerializableGenerator
// **************************************************************************
BenchmarkPatch _$BenchmarkPatchFromJson(Map<String, dynamic> json) =>
$checkedCreate(
'BenchmarkPatch',
json,
($checkedConvert) {
final val = BenchmarkPatch(
code: $checkedConvert('code', (v) => v as String?),
currency: $checkedConvert('currency', (v) => v as String?),
instrumentId: $checkedConvert(
'instrument_id',
(v) => (v as num?)?.toInt(),
),
isActive: $checkedConvert('is_active', (v) => v as bool?),
isDefault: $checkedConvert('is_default', (v) => v as bool?),
kind: $checkedConvert('kind', (v) => v as String?),
name: $checkedConvert('name', (v) => v as String?),
source_: $checkedConvert('source', (v) => v as String?),
);
return val;
},
fieldKeyMap: const {
'instrumentId': 'instrument_id',
'isActive': 'is_active',
'isDefault': 'is_default',
'source_': 'source',
},
);
Map<String, dynamic> _$BenchmarkPatchToJson(BenchmarkPatch instance) =>
<String, dynamic>{
'code': ?instance.code,
'currency': ?instance.currency,
'instrument_id': ?instance.instrumentId,
'is_active': ?instance.isActive,
'is_default': ?instance.isDefault,
'kind': ?instance.kind,
'name': ?instance.name,
'source': ?instance.source_,
};
@@ -0,0 +1,173 @@
//
// AUTO-GENERATED FILE, DO NOT MODIFY!
//
// ignore_for_file: unused_element
import 'package:copy_with_extension/copy_with_extension.dart';
import 'package:json_annotation/json_annotation.dart';
part 'benchmark_return_out.g.dart';
@CopyWith()
@JsonSerializable(
checked: true,
createToJson: true,
disallowUnrecognizedKeys: false,
explicitToJson: true,
)
class BenchmarkReturnOut {
/// Returns a new [BenchmarkReturnOut] instance.
BenchmarkReturnOut({
required this.benchmarkId,
required this.code,
required this.daysSkipped,
required this.excess,
required this.kind,
required this.name,
required this.twr,
required this.twrAnnualized,
});
@JsonKey(
name: r'benchmark_id',
required: true,
includeIfNull: false,
)
final int benchmarkId;
@JsonKey(
name: r'code',
required: true,
includeIfNull: false,
)
final String code;
@JsonKey(
name: r'days_skipped',
required: true,
includeIfNull: false,
)
final int daysSkipped;
/// decimal as string
@JsonKey(
name: r'excess',
required: true,
includeIfNull: true,
)
final String? excess;
@JsonKey(
name: r'kind',
required: true,
includeIfNull: false,
)
final String kind;
@JsonKey(
name: r'name',
required: true,
includeIfNull: false,
)
final String name;
/// decimal as string
@JsonKey(
name: r'twr',
required: true,
includeIfNull: true,
)
final String? twr;
/// decimal as string
@JsonKey(
name: r'twr_annualized',
required: true,
includeIfNull: true,
)
final String? twrAnnualized;
@override
bool operator ==(Object other) => identical(this, other) || other is BenchmarkReturnOut &&
other.benchmarkId == benchmarkId &&
other.code == code &&
other.daysSkipped == daysSkipped &&
other.excess == excess &&
other.kind == kind &&
other.name == name &&
other.twr == twr &&
other.twrAnnualized == twrAnnualized;
@override
int get hashCode =>
benchmarkId.hashCode +
code.hashCode +
daysSkipped.hashCode +
(excess == null ? 0 : excess.hashCode) +
kind.hashCode +
name.hashCode +
(twr == null ? 0 : twr.hashCode) +
(twrAnnualized == null ? 0 : twrAnnualized.hashCode);
factory BenchmarkReturnOut.fromJson(Map<String, dynamic> json) => _$BenchmarkReturnOutFromJson(json);
Map<String, dynamic> toJson() => _$BenchmarkReturnOutToJson(this);
@override
String toString() {
return toJson().toString();
}
}
@@ -0,0 +1,190 @@
// GENERATED CODE - DO NOT MODIFY BY HAND
part of 'benchmark_return_out.dart';
// **************************************************************************
// CopyWithGenerator
// **************************************************************************
abstract class _$BenchmarkReturnOutCWProxy {
BenchmarkReturnOut benchmarkId(int benchmarkId);
BenchmarkReturnOut code(String code);
BenchmarkReturnOut daysSkipped(int daysSkipped);
BenchmarkReturnOut excess(String? excess);
BenchmarkReturnOut kind(String kind);
BenchmarkReturnOut name(String name);
BenchmarkReturnOut twr(String? twr);
BenchmarkReturnOut twrAnnualized(String? twrAnnualized);
/// This function **does support** nullification of nullable fields. All `null` values passed to `non-nullable` fields will be ignored. You can also use `BenchmarkReturnOut(...).copyWith.fieldName(...)` to override fields one at a time with nullification support.
///
/// Usage
/// ```dart
/// BenchmarkReturnOut(...).copyWith(id: 12, name: "My name")
/// ````
BenchmarkReturnOut call({
int benchmarkId,
String code,
int daysSkipped,
String? excess,
String kind,
String name,
String? twr,
String? twrAnnualized,
});
}
/// Proxy class for `copyWith` functionality. This is a callable class and can be used as follows: `instanceOfBenchmarkReturnOut.copyWith(...)`. Additionally contains functions for specific fields e.g. `instanceOfBenchmarkReturnOut.copyWith.fieldName(...)`
class _$BenchmarkReturnOutCWProxyImpl implements _$BenchmarkReturnOutCWProxy {
const _$BenchmarkReturnOutCWProxyImpl(this._value);
final BenchmarkReturnOut _value;
@override
BenchmarkReturnOut benchmarkId(int benchmarkId) =>
this(benchmarkId: benchmarkId);
@override
BenchmarkReturnOut code(String code) => this(code: code);
@override
BenchmarkReturnOut daysSkipped(int daysSkipped) =>
this(daysSkipped: daysSkipped);
@override
BenchmarkReturnOut excess(String? excess) => this(excess: excess);
@override
BenchmarkReturnOut kind(String kind) => this(kind: kind);
@override
BenchmarkReturnOut name(String name) => this(name: name);
@override
BenchmarkReturnOut twr(String? twr) => this(twr: twr);
@override
BenchmarkReturnOut twrAnnualized(String? twrAnnualized) =>
this(twrAnnualized: twrAnnualized);
@override
/// This function **does support** nullification of nullable fields. All `null` values passed to `non-nullable` fields will be ignored. You can also use `BenchmarkReturnOut(...).copyWith.fieldName(...)` to override fields one at a time with nullification support.
///
/// Usage
/// ```dart
/// BenchmarkReturnOut(...).copyWith(id: 12, name: "My name")
/// ````
BenchmarkReturnOut call({
Object? benchmarkId = const $CopyWithPlaceholder(),
Object? code = const $CopyWithPlaceholder(),
Object? daysSkipped = const $CopyWithPlaceholder(),
Object? excess = const $CopyWithPlaceholder(),
Object? kind = const $CopyWithPlaceholder(),
Object? name = const $CopyWithPlaceholder(),
Object? twr = const $CopyWithPlaceholder(),
Object? twrAnnualized = const $CopyWithPlaceholder(),
}) {
return BenchmarkReturnOut(
benchmarkId: benchmarkId == const $CopyWithPlaceholder()
? _value.benchmarkId
// ignore: cast_nullable_to_non_nullable
: benchmarkId as int,
code: code == const $CopyWithPlaceholder()
? _value.code
// ignore: cast_nullable_to_non_nullable
: code as String,
daysSkipped: daysSkipped == const $CopyWithPlaceholder()
? _value.daysSkipped
// ignore: cast_nullable_to_non_nullable
: daysSkipped as int,
excess: excess == const $CopyWithPlaceholder()
? _value.excess
// ignore: cast_nullable_to_non_nullable
: excess as String?,
kind: kind == const $CopyWithPlaceholder()
? _value.kind
// ignore: cast_nullable_to_non_nullable
: kind as String,
name: name == const $CopyWithPlaceholder()
? _value.name
// ignore: cast_nullable_to_non_nullable
: name as String,
twr: twr == const $CopyWithPlaceholder()
? _value.twr
// ignore: cast_nullable_to_non_nullable
: twr as String?,
twrAnnualized: twrAnnualized == const $CopyWithPlaceholder()
? _value.twrAnnualized
// ignore: cast_nullable_to_non_nullable
: twrAnnualized as String?,
);
}
}
extension $BenchmarkReturnOutCopyWith on BenchmarkReturnOut {
/// Returns a callable class that can be used as follows: `instanceOfBenchmarkReturnOut.copyWith(...)` or like so:`instanceOfBenchmarkReturnOut.copyWith.fieldName(...)`.
// ignore: library_private_types_in_public_api
_$BenchmarkReturnOutCWProxy get copyWith =>
_$BenchmarkReturnOutCWProxyImpl(this);
}
// **************************************************************************
// JsonSerializableGenerator
// **************************************************************************
BenchmarkReturnOut _$BenchmarkReturnOutFromJson(
Map<String, dynamic> json,
) => $checkedCreate(
'BenchmarkReturnOut',
json,
($checkedConvert) {
$checkKeys(
json,
requiredKeys: const [
'benchmark_id',
'code',
'days_skipped',
'excess',
'kind',
'name',
'twr',
'twr_annualized',
],
);
final val = BenchmarkReturnOut(
benchmarkId: $checkedConvert('benchmark_id', (v) => (v as num).toInt()),
code: $checkedConvert('code', (v) => v as String),
daysSkipped: $checkedConvert('days_skipped', (v) => (v as num).toInt()),
excess: $checkedConvert('excess', (v) => v as String?),
kind: $checkedConvert('kind', (v) => v as String),
name: $checkedConvert('name', (v) => v as String),
twr: $checkedConvert('twr', (v) => v as String?),
twrAnnualized: $checkedConvert('twr_annualized', (v) => v as String?),
);
return val;
},
fieldKeyMap: const {
'benchmarkId': 'benchmark_id',
'daysSkipped': 'days_skipped',
'twrAnnualized': 'twr_annualized',
},
);
Map<String, dynamic> _$BenchmarkReturnOutToJson(BenchmarkReturnOut instance) =>
<String, dynamic>{
'benchmark_id': instance.benchmarkId,
'code': instance.code,
'days_skipped': instance.daysSkipped,
'excess': instance.excess,
'kind': instance.kind,
'name': instance.name,
'twr': instance.twr,
'twr_annualized': instance.twrAnnualized,
};
@@ -0,0 +1,255 @@
//
// AUTO-GENERATED FILE, DO NOT MODIFY!
//
// ignore_for_file: unused_element
import 'package:copy_with_extension/copy_with_extension.dart';
import 'package:json_annotation/json_annotation.dart';
part 'calendar_entry.g.dart';
@CopyWith()
@JsonSerializable(
checked: true,
createToJson: true,
disallowUnrecognizedKeys: false,
explicitToJson: true,
)
class CalendarEntry {
/// Returns a new [CalendarEntry] instance.
CalendarEntry({
required this.amount,
required this.amountRub,
required this.basis,
required this.currency,
required this.expectedDate,
required this.instrumentId,
required this.kind,
required this.name,
required this.perUnit,
required this.qty,
required this.recordDate,
required this.taxWithheld,
required this.ticker,
});
/// decimal as string
@JsonKey(
name: r'amount',
required: true,
includeIfNull: false,
)
final String amount;
/// decimal as string
@JsonKey(
name: r'amount_rub',
required: true,
includeIfNull: true,
)
final String? amountRub;
@JsonKey(
name: r'basis',
required: true,
includeIfNull: false,
)
final String basis;
@JsonKey(
name: r'currency',
required: true,
includeIfNull: false,
)
final String currency;
@JsonKey(
name: r'expected_date',
required: true,
includeIfNull: false,
)
final DateTime expectedDate;
@JsonKey(
name: r'instrument_id',
required: true,
includeIfNull: false,
)
final int instrumentId;
@JsonKey(
name: r'kind',
required: true,
includeIfNull: false,
)
final String kind;
@JsonKey(
name: r'name',
required: true,
includeIfNull: false,
)
final String name;
/// decimal as string
@JsonKey(
name: r'per_unit',
required: true,
includeIfNull: true,
)
final String? perUnit;
/// decimal as string
@JsonKey(
name: r'qty',
required: true,
includeIfNull: false,
)
final String qty;
@JsonKey(
name: r'record_date',
required: true,
includeIfNull: true,
)
final DateTime? recordDate;
/// decimal as string
@JsonKey(
name: r'tax_withheld',
required: true,
includeIfNull: true,
)
final String? taxWithheld;
@JsonKey(
name: r'ticker',
required: true,
includeIfNull: true,
)
final String? ticker;
@override
bool operator ==(Object other) => identical(this, other) || other is CalendarEntry &&
other.amount == amount &&
other.amountRub == amountRub &&
other.basis == basis &&
other.currency == currency &&
other.expectedDate == expectedDate &&
other.instrumentId == instrumentId &&
other.kind == kind &&
other.name == name &&
other.perUnit == perUnit &&
other.qty == qty &&
other.recordDate == recordDate &&
other.taxWithheld == taxWithheld &&
other.ticker == ticker;
@override
int get hashCode =>
amount.hashCode +
(amountRub == null ? 0 : amountRub.hashCode) +
basis.hashCode +
currency.hashCode +
expectedDate.hashCode +
instrumentId.hashCode +
kind.hashCode +
name.hashCode +
(perUnit == null ? 0 : perUnit.hashCode) +
qty.hashCode +
(recordDate == null ? 0 : recordDate.hashCode) +
(taxWithheld == null ? 0 : taxWithheld.hashCode) +
(ticker == null ? 0 : ticker.hashCode);
factory CalendarEntry.fromJson(Map<String, dynamic> json) => _$CalendarEntryFromJson(json);
Map<String, dynamic> toJson() => _$CalendarEntryToJson(this);
@override
String toString() {
return toJson().toString();
}
}
@@ -0,0 +1,271 @@
// GENERATED CODE - DO NOT MODIFY BY HAND
part of 'calendar_entry.dart';
// **************************************************************************
// CopyWithGenerator
// **************************************************************************
abstract class _$CalendarEntryCWProxy {
CalendarEntry amount(String amount);
CalendarEntry amountRub(String? amountRub);
CalendarEntry basis(String basis);
CalendarEntry currency(String currency);
CalendarEntry expectedDate(DateTime expectedDate);
CalendarEntry instrumentId(int instrumentId);
CalendarEntry kind(String kind);
CalendarEntry name(String name);
CalendarEntry perUnit(String? perUnit);
CalendarEntry qty(String qty);
CalendarEntry recordDate(DateTime? recordDate);
CalendarEntry taxWithheld(String? taxWithheld);
CalendarEntry ticker(String? ticker);
/// This function **does support** nullification of nullable fields. All `null` values passed to `non-nullable` fields will be ignored. You can also use `CalendarEntry(...).copyWith.fieldName(...)` to override fields one at a time with nullification support.
///
/// Usage
/// ```dart
/// CalendarEntry(...).copyWith(id: 12, name: "My name")
/// ````
CalendarEntry call({
String amount,
String? amountRub,
String basis,
String currency,
DateTime expectedDate,
int instrumentId,
String kind,
String name,
String? perUnit,
String qty,
DateTime? recordDate,
String? taxWithheld,
String? ticker,
});
}
/// Proxy class for `copyWith` functionality. This is a callable class and can be used as follows: `instanceOfCalendarEntry.copyWith(...)`. Additionally contains functions for specific fields e.g. `instanceOfCalendarEntry.copyWith.fieldName(...)`
class _$CalendarEntryCWProxyImpl implements _$CalendarEntryCWProxy {
const _$CalendarEntryCWProxyImpl(this._value);
final CalendarEntry _value;
@override
CalendarEntry amount(String amount) => this(amount: amount);
@override
CalendarEntry amountRub(String? amountRub) => this(amountRub: amountRub);
@override
CalendarEntry basis(String basis) => this(basis: basis);
@override
CalendarEntry currency(String currency) => this(currency: currency);
@override
CalendarEntry expectedDate(DateTime expectedDate) =>
this(expectedDate: expectedDate);
@override
CalendarEntry instrumentId(int instrumentId) =>
this(instrumentId: instrumentId);
@override
CalendarEntry kind(String kind) => this(kind: kind);
@override
CalendarEntry name(String name) => this(name: name);
@override
CalendarEntry perUnit(String? perUnit) => this(perUnit: perUnit);
@override
CalendarEntry qty(String qty) => this(qty: qty);
@override
CalendarEntry recordDate(DateTime? recordDate) =>
this(recordDate: recordDate);
@override
CalendarEntry taxWithheld(String? taxWithheld) =>
this(taxWithheld: taxWithheld);
@override
CalendarEntry ticker(String? ticker) => this(ticker: ticker);
@override
/// This function **does support** nullification of nullable fields. All `null` values passed to `non-nullable` fields will be ignored. You can also use `CalendarEntry(...).copyWith.fieldName(...)` to override fields one at a time with nullification support.
///
/// Usage
/// ```dart
/// CalendarEntry(...).copyWith(id: 12, name: "My name")
/// ````
CalendarEntry call({
Object? amount = const $CopyWithPlaceholder(),
Object? amountRub = const $CopyWithPlaceholder(),
Object? basis = const $CopyWithPlaceholder(),
Object? currency = const $CopyWithPlaceholder(),
Object? expectedDate = const $CopyWithPlaceholder(),
Object? instrumentId = const $CopyWithPlaceholder(),
Object? kind = const $CopyWithPlaceholder(),
Object? name = const $CopyWithPlaceholder(),
Object? perUnit = const $CopyWithPlaceholder(),
Object? qty = const $CopyWithPlaceholder(),
Object? recordDate = const $CopyWithPlaceholder(),
Object? taxWithheld = const $CopyWithPlaceholder(),
Object? ticker = const $CopyWithPlaceholder(),
}) {
return CalendarEntry(
amount: amount == const $CopyWithPlaceholder()
? _value.amount
// ignore: cast_nullable_to_non_nullable
: amount as String,
amountRub: amountRub == const $CopyWithPlaceholder()
? _value.amountRub
// ignore: cast_nullable_to_non_nullable
: amountRub as String?,
basis: basis == const $CopyWithPlaceholder()
? _value.basis
// ignore: cast_nullable_to_non_nullable
: basis as String,
currency: currency == const $CopyWithPlaceholder()
? _value.currency
// ignore: cast_nullable_to_non_nullable
: currency as String,
expectedDate: expectedDate == const $CopyWithPlaceholder()
? _value.expectedDate
// ignore: cast_nullable_to_non_nullable
: expectedDate as DateTime,
instrumentId: instrumentId == const $CopyWithPlaceholder()
? _value.instrumentId
// ignore: cast_nullable_to_non_nullable
: instrumentId as int,
kind: kind == const $CopyWithPlaceholder()
? _value.kind
// ignore: cast_nullable_to_non_nullable
: kind as String,
name: name == const $CopyWithPlaceholder()
? _value.name
// ignore: cast_nullable_to_non_nullable
: name as String,
perUnit: perUnit == const $CopyWithPlaceholder()
? _value.perUnit
// ignore: cast_nullable_to_non_nullable
: perUnit as String?,
qty: qty == const $CopyWithPlaceholder()
? _value.qty
// ignore: cast_nullable_to_non_nullable
: qty as String,
recordDate: recordDate == const $CopyWithPlaceholder()
? _value.recordDate
// ignore: cast_nullable_to_non_nullable
: recordDate as DateTime?,
taxWithheld: taxWithheld == const $CopyWithPlaceholder()
? _value.taxWithheld
// ignore: cast_nullable_to_non_nullable
: taxWithheld as String?,
ticker: ticker == const $CopyWithPlaceholder()
? _value.ticker
// ignore: cast_nullable_to_non_nullable
: ticker as String?,
);
}
}
extension $CalendarEntryCopyWith on CalendarEntry {
/// Returns a callable class that can be used as follows: `instanceOfCalendarEntry.copyWith(...)` or like so:`instanceOfCalendarEntry.copyWith.fieldName(...)`.
// ignore: library_private_types_in_public_api
_$CalendarEntryCWProxy get copyWith => _$CalendarEntryCWProxyImpl(this);
}
// **************************************************************************
// JsonSerializableGenerator
// **************************************************************************
CalendarEntry _$CalendarEntryFromJson(Map<String, dynamic> json) =>
$checkedCreate(
'CalendarEntry',
json,
($checkedConvert) {
$checkKeys(
json,
requiredKeys: const [
'amount',
'amount_rub',
'basis',
'currency',
'expected_date',
'instrument_id',
'kind',
'name',
'per_unit',
'qty',
'record_date',
'tax_withheld',
'ticker',
],
);
final val = CalendarEntry(
amount: $checkedConvert('amount', (v) => v as String),
amountRub: $checkedConvert('amount_rub', (v) => v as String?),
basis: $checkedConvert('basis', (v) => v as String),
currency: $checkedConvert('currency', (v) => v as String),
expectedDate: $checkedConvert(
'expected_date',
(v) => DateTime.parse(v as String),
),
instrumentId: $checkedConvert(
'instrument_id',
(v) => (v as num).toInt(),
),
kind: $checkedConvert('kind', (v) => v as String),
name: $checkedConvert('name', (v) => v as String),
perUnit: $checkedConvert('per_unit', (v) => v as String?),
qty: $checkedConvert('qty', (v) => v as String),
recordDate: $checkedConvert(
'record_date',
(v) => v == null ? null : DateTime.parse(v as String),
),
taxWithheld: $checkedConvert('tax_withheld', (v) => v as String?),
ticker: $checkedConvert('ticker', (v) => v as String?),
);
return val;
},
fieldKeyMap: const {
'amountRub': 'amount_rub',
'expectedDate': 'expected_date',
'instrumentId': 'instrument_id',
'perUnit': 'per_unit',
'recordDate': 'record_date',
'taxWithheld': 'tax_withheld',
},
);
Map<String, dynamic> _$CalendarEntryToJson(CalendarEntry instance) =>
<String, dynamic>{
'amount': instance.amount,
'amount_rub': instance.amountRub,
'basis': instance.basis,
'currency': instance.currency,
'expected_date': instance.expectedDate.toIso8601String(),
'instrument_id': instance.instrumentId,
'kind': instance.kind,
'name': instance.name,
'per_unit': instance.perUnit,
'qty': instance.qty,
'record_date': instance.recordDate?.toIso8601String(),
'tax_withheld': instance.taxWithheld,
'ticker': instance.ticker,
};
@@ -0,0 +1,124 @@
//
// AUTO-GENERATED FILE, DO NOT MODIFY!
//
// ignore_for_file: unused_element
import 'package:fintracker_api/src/model/calendar_entry.dart';
import 'package:copy_with_extension/copy_with_extension.dart';
import 'package:json_annotation/json_annotation.dart';
part 'calendar_out.g.dart';
@CopyWith()
@JsonSerializable(
checked: true,
createToJson: true,
disallowUnrecognizedKeys: false,
explicitToJson: true,
)
class CalendarOut {
/// Returns a new [CalendarOut] instance.
CalendarOut({
required this.asOf,
required this.byBasis,
required this.currency,
required this.entries,
required this.totalExpectedRub,
});
@JsonKey(
name: r'as_of',
required: true,
includeIfNull: false,
)
final DateTime asOf;
@JsonKey(
name: r'by_basis',
required: true,
includeIfNull: false,
)
final Map<String, String> byBasis;
@JsonKey(
name: r'currency',
required: true,
includeIfNull: false,
)
final String currency;
@JsonKey(
name: r'entries',
required: true,
includeIfNull: false,
)
final List<CalendarEntry> entries;
/// decimal as string
@JsonKey(
name: r'total_expected_rub',
required: true,
includeIfNull: false,
)
final String totalExpectedRub;
@override
bool operator ==(Object other) => identical(this, other) || other is CalendarOut &&
other.asOf == asOf &&
other.byBasis == byBasis &&
other.currency == currency &&
other.entries == entries &&
other.totalExpectedRub == totalExpectedRub;
@override
int get hashCode =>
asOf.hashCode +
byBasis.hashCode +
currency.hashCode +
entries.hashCode +
totalExpectedRub.hashCode;
factory CalendarOut.fromJson(Map<String, dynamic> json) => _$CalendarOutFromJson(json);
Map<String, dynamic> toJson() => _$CalendarOutToJson(this);
@override
String toString() {
return toJson().toString();
}
}
@@ -0,0 +1,154 @@
// GENERATED CODE - DO NOT MODIFY BY HAND
part of 'calendar_out.dart';
// **************************************************************************
// CopyWithGenerator
// **************************************************************************
abstract class _$CalendarOutCWProxy {
CalendarOut asOf(DateTime asOf);
CalendarOut byBasis(Map<String, String> byBasis);
CalendarOut currency(String currency);
CalendarOut entries(List<CalendarEntry> entries);
CalendarOut totalExpectedRub(String totalExpectedRub);
/// This function **does support** nullification of nullable fields. All `null` values passed to `non-nullable` fields will be ignored. You can also use `CalendarOut(...).copyWith.fieldName(...)` to override fields one at a time with nullification support.
///
/// Usage
/// ```dart
/// CalendarOut(...).copyWith(id: 12, name: "My name")
/// ````
CalendarOut call({
DateTime asOf,
Map<String, String> byBasis,
String currency,
List<CalendarEntry> entries,
String totalExpectedRub,
});
}
/// Proxy class for `copyWith` functionality. This is a callable class and can be used as follows: `instanceOfCalendarOut.copyWith(...)`. Additionally contains functions for specific fields e.g. `instanceOfCalendarOut.copyWith.fieldName(...)`
class _$CalendarOutCWProxyImpl implements _$CalendarOutCWProxy {
const _$CalendarOutCWProxyImpl(this._value);
final CalendarOut _value;
@override
CalendarOut asOf(DateTime asOf) => this(asOf: asOf);
@override
CalendarOut byBasis(Map<String, String> byBasis) => this(byBasis: byBasis);
@override
CalendarOut currency(String currency) => this(currency: currency);
@override
CalendarOut entries(List<CalendarEntry> entries) => this(entries: entries);
@override
CalendarOut totalExpectedRub(String totalExpectedRub) =>
this(totalExpectedRub: totalExpectedRub);
@override
/// This function **does support** nullification of nullable fields. All `null` values passed to `non-nullable` fields will be ignored. You can also use `CalendarOut(...).copyWith.fieldName(...)` to override fields one at a time with nullification support.
///
/// Usage
/// ```dart
/// CalendarOut(...).copyWith(id: 12, name: "My name")
/// ````
CalendarOut call({
Object? asOf = const $CopyWithPlaceholder(),
Object? byBasis = const $CopyWithPlaceholder(),
Object? currency = const $CopyWithPlaceholder(),
Object? entries = const $CopyWithPlaceholder(),
Object? totalExpectedRub = const $CopyWithPlaceholder(),
}) {
return CalendarOut(
asOf: asOf == const $CopyWithPlaceholder()
? _value.asOf
// ignore: cast_nullable_to_non_nullable
: asOf as DateTime,
byBasis: byBasis == const $CopyWithPlaceholder()
? _value.byBasis
// ignore: cast_nullable_to_non_nullable
: byBasis as Map<String, String>,
currency: currency == const $CopyWithPlaceholder()
? _value.currency
// ignore: cast_nullable_to_non_nullable
: currency as String,
entries: entries == const $CopyWithPlaceholder()
? _value.entries
// ignore: cast_nullable_to_non_nullable
: entries as List<CalendarEntry>,
totalExpectedRub: totalExpectedRub == const $CopyWithPlaceholder()
? _value.totalExpectedRub
// ignore: cast_nullable_to_non_nullable
: totalExpectedRub as String,
);
}
}
extension $CalendarOutCopyWith on CalendarOut {
/// Returns a callable class that can be used as follows: `instanceOfCalendarOut.copyWith(...)` or like so:`instanceOfCalendarOut.copyWith.fieldName(...)`.
// ignore: library_private_types_in_public_api
_$CalendarOutCWProxy get copyWith => _$CalendarOutCWProxyImpl(this);
}
// **************************************************************************
// JsonSerializableGenerator
// **************************************************************************
CalendarOut _$CalendarOutFromJson(Map<String, dynamic> json) => $checkedCreate(
'CalendarOut',
json,
($checkedConvert) {
$checkKeys(
json,
requiredKeys: const [
'as_of',
'by_basis',
'currency',
'entries',
'total_expected_rub',
],
);
final val = CalendarOut(
asOf: $checkedConvert('as_of', (v) => DateTime.parse(v as String)),
byBasis: $checkedConvert(
'by_basis',
(v) => Map<String, String>.from(v as Map),
),
currency: $checkedConvert('currency', (v) => v as String),
entries: $checkedConvert(
'entries',
(v) => (v as List<dynamic>)
.map((e) => CalendarEntry.fromJson(e as Map<String, dynamic>))
.toList(),
),
totalExpectedRub: $checkedConvert(
'total_expected_rub',
(v) => v as String,
),
);
return val;
},
fieldKeyMap: const {
'asOf': 'as_of',
'byBasis': 'by_basis',
'totalExpectedRub': 'total_expected_rub',
},
);
Map<String, dynamic> _$CalendarOutToJson(CalendarOut instance) =>
<String, dynamic>{
'as_of': instance.asOf.toIso8601String(),
'by_basis': instance.byBasis,
'currency': instance.currency,
'entries': instance.entries.map((e) => e.toJson()).toList(),
'total_expected_rub': instance.totalExpectedRub,
};
@@ -0,0 +1,42 @@
//
// AUTO-GENERATED FILE, DO NOT MODIFY!
//
// ignore_for_file: unused_element
import 'package:copy_with_extension/copy_with_extension.dart';
import 'package:json_annotation/json_annotation.dart';
part 'cash_available.g.dart';
@CopyWith()
@JsonSerializable(
checked: true,
createToJson: true,
disallowUnrecognizedKeys: false,
explicitToJson: true,
)
class CashAvailable {
/// Returns a new [CashAvailable] instance.
CashAvailable({
});
@override
bool operator ==(Object other) => identical(this, other) || other is CashAvailable &&
@override
int get hashCode =>
factory CashAvailable.fromJson(Map<String, dynamic> json) => _$CashAvailableFromJson(json);
Map<String, dynamic> toJson() => _$CashAvailableToJson(this);
@override
String toString() {
return toJson().toString();
}
}
@@ -0,0 +1,125 @@
//
// AUTO-GENERATED FILE, DO NOT MODIFY!
//
// ignore_for_file: unused_element
import 'package:copy_with_extension/copy_with_extension.dart';
import 'package:json_annotation/json_annotation.dart';
part 'cash_flow_broker_month.g.dart';
@CopyWith()
@JsonSerializable(
checked: true,
createToJson: true,
disallowUnrecognizedKeys: false,
explicitToJson: true,
)
class CashFlowBrokerMonth {
/// Returns a new [CashFlowBrokerMonth] instance.
CashFlowBrokerMonth({
required this.depositsRub,
required this.eventCount,
required this.month,
required this.netRub,
required this.withdrawalsRub,
});
/// decimal as string
@JsonKey(
name: r'deposits_rub',
required: true,
includeIfNull: false,
)
final String depositsRub;
@JsonKey(
name: r'event_count',
required: true,
includeIfNull: false,
)
final int eventCount;
@JsonKey(
name: r'month',
required: true,
includeIfNull: false,
)
final DateTime month;
/// decimal as string
@JsonKey(
name: r'net_rub',
required: true,
includeIfNull: false,
)
final String netRub;
/// decimal as string
@JsonKey(
name: r'withdrawals_rub',
required: true,
includeIfNull: false,
)
final String withdrawalsRub;
@override
bool operator ==(Object other) => identical(this, other) || other is CashFlowBrokerMonth &&
other.depositsRub == depositsRub &&
other.eventCount == eventCount &&
other.month == month &&
other.netRub == netRub &&
other.withdrawalsRub == withdrawalsRub;
@override
int get hashCode =>
depositsRub.hashCode +
eventCount.hashCode +
month.hashCode +
netRub.hashCode +
withdrawalsRub.hashCode;
factory CashFlowBrokerMonth.fromJson(Map<String, dynamic> json) => _$CashFlowBrokerMonthFromJson(json);
Map<String, dynamic> toJson() => _$CashFlowBrokerMonthToJson(this);
@override
String toString() {
return toJson().toString();
}
}
@@ -0,0 +1,152 @@
// GENERATED CODE - DO NOT MODIFY BY HAND
part of 'cash_flow_broker_month.dart';
// **************************************************************************
// CopyWithGenerator
// **************************************************************************
abstract class _$CashFlowBrokerMonthCWProxy {
CashFlowBrokerMonth depositsRub(String depositsRub);
CashFlowBrokerMonth eventCount(int eventCount);
CashFlowBrokerMonth month(DateTime month);
CashFlowBrokerMonth netRub(String netRub);
CashFlowBrokerMonth withdrawalsRub(String withdrawalsRub);
/// This function **does support** nullification of nullable fields. All `null` values passed to `non-nullable` fields will be ignored. You can also use `CashFlowBrokerMonth(...).copyWith.fieldName(...)` to override fields one at a time with nullification support.
///
/// Usage
/// ```dart
/// CashFlowBrokerMonth(...).copyWith(id: 12, name: "My name")
/// ````
CashFlowBrokerMonth call({
String depositsRub,
int eventCount,
DateTime month,
String netRub,
String withdrawalsRub,
});
}
/// Proxy class for `copyWith` functionality. This is a callable class and can be used as follows: `instanceOfCashFlowBrokerMonth.copyWith(...)`. Additionally contains functions for specific fields e.g. `instanceOfCashFlowBrokerMonth.copyWith.fieldName(...)`
class _$CashFlowBrokerMonthCWProxyImpl implements _$CashFlowBrokerMonthCWProxy {
const _$CashFlowBrokerMonthCWProxyImpl(this._value);
final CashFlowBrokerMonth _value;
@override
CashFlowBrokerMonth depositsRub(String depositsRub) =>
this(depositsRub: depositsRub);
@override
CashFlowBrokerMonth eventCount(int eventCount) =>
this(eventCount: eventCount);
@override
CashFlowBrokerMonth month(DateTime month) => this(month: month);
@override
CashFlowBrokerMonth netRub(String netRub) => this(netRub: netRub);
@override
CashFlowBrokerMonth withdrawalsRub(String withdrawalsRub) =>
this(withdrawalsRub: withdrawalsRub);
@override
/// This function **does support** nullification of nullable fields. All `null` values passed to `non-nullable` fields will be ignored. You can also use `CashFlowBrokerMonth(...).copyWith.fieldName(...)` to override fields one at a time with nullification support.
///
/// Usage
/// ```dart
/// CashFlowBrokerMonth(...).copyWith(id: 12, name: "My name")
/// ````
CashFlowBrokerMonth call({
Object? depositsRub = const $CopyWithPlaceholder(),
Object? eventCount = const $CopyWithPlaceholder(),
Object? month = const $CopyWithPlaceholder(),
Object? netRub = const $CopyWithPlaceholder(),
Object? withdrawalsRub = const $CopyWithPlaceholder(),
}) {
return CashFlowBrokerMonth(
depositsRub: depositsRub == const $CopyWithPlaceholder()
? _value.depositsRub
// ignore: cast_nullable_to_non_nullable
: depositsRub as String,
eventCount: eventCount == const $CopyWithPlaceholder()
? _value.eventCount
// ignore: cast_nullable_to_non_nullable
: eventCount as int,
month: month == const $CopyWithPlaceholder()
? _value.month
// ignore: cast_nullable_to_non_nullable
: month as DateTime,
netRub: netRub == const $CopyWithPlaceholder()
? _value.netRub
// ignore: cast_nullable_to_non_nullable
: netRub as String,
withdrawalsRub: withdrawalsRub == const $CopyWithPlaceholder()
? _value.withdrawalsRub
// ignore: cast_nullable_to_non_nullable
: withdrawalsRub as String,
);
}
}
extension $CashFlowBrokerMonthCopyWith on CashFlowBrokerMonth {
/// Returns a callable class that can be used as follows: `instanceOfCashFlowBrokerMonth.copyWith(...)` or like so:`instanceOfCashFlowBrokerMonth.copyWith.fieldName(...)`.
// ignore: library_private_types_in_public_api
_$CashFlowBrokerMonthCWProxy get copyWith =>
_$CashFlowBrokerMonthCWProxyImpl(this);
}
// **************************************************************************
// JsonSerializableGenerator
// **************************************************************************
CashFlowBrokerMonth _$CashFlowBrokerMonthFromJson(Map<String, dynamic> json) =>
$checkedCreate(
'CashFlowBrokerMonth',
json,
($checkedConvert) {
$checkKeys(
json,
requiredKeys: const [
'deposits_rub',
'event_count',
'month',
'net_rub',
'withdrawals_rub',
],
);
final val = CashFlowBrokerMonth(
depositsRub: $checkedConvert('deposits_rub', (v) => v as String),
eventCount: $checkedConvert('event_count', (v) => (v as num).toInt()),
month: $checkedConvert('month', (v) => DateTime.parse(v as String)),
netRub: $checkedConvert('net_rub', (v) => v as String),
withdrawalsRub: $checkedConvert(
'withdrawals_rub',
(v) => v as String,
),
);
return val;
},
fieldKeyMap: const {
'depositsRub': 'deposits_rub',
'eventCount': 'event_count',
'netRub': 'net_rub',
'withdrawalsRub': 'withdrawals_rub',
},
);
Map<String, dynamic> _$CashFlowBrokerMonthToJson(
CashFlowBrokerMonth instance,
) => <String, dynamic>{
'deposits_rub': instance.depositsRub,
'event_count': instance.eventCount,
'month': instance.month.toIso8601String(),
'net_rub': instance.netRub,
'withdrawals_rub': instance.withdrawalsRub,
};
@@ -0,0 +1,90 @@
//
// AUTO-GENERATED FILE, DO NOT MODIFY!
//
// ignore_for_file: unused_element
import 'package:copy_with_extension/copy_with_extension.dart';
import 'package:json_annotation/json_annotation.dart';
part 'commit_request.g.dart';
@CopyWith()
@JsonSerializable(
checked: true,
createToJson: true,
disallowUnrecognizedKeys: false,
explicitToJson: true,
)
class CommitRequest {
/// Returns a new [CommitRequest] instance.
CommitRequest({
this.accountId,
this.confirmDuplicates = false,
this.dryRun = false,
});
@JsonKey(
name: r'account_id',
required: false,
includeIfNull: false,
)
final int? accountId;
@JsonKey(
defaultValue: false,
name: r'confirm_duplicates',
required: false,
includeIfNull: false,
)
final bool? confirmDuplicates;
@JsonKey(
defaultValue: false,
name: r'dry_run',
required: false,
includeIfNull: false,
)
final bool? dryRun;
@override
bool operator ==(Object other) => identical(this, other) || other is CommitRequest &&
other.accountId == accountId &&
other.confirmDuplicates == confirmDuplicates &&
other.dryRun == dryRun;
@override
int get hashCode =>
(accountId == null ? 0 : accountId.hashCode) +
confirmDuplicates.hashCode +
dryRun.hashCode;
factory CommitRequest.fromJson(Map<String, dynamic> json) => _$CommitRequestFromJson(json);
Map<String, dynamic> toJson() => _$CommitRequestToJson(this);
@override
String toString() {
return toJson().toString();
}
}
@@ -0,0 +1,107 @@
// GENERATED CODE - DO NOT MODIFY BY HAND
part of 'commit_request.dart';
// **************************************************************************
// CopyWithGenerator
// **************************************************************************
abstract class _$CommitRequestCWProxy {
CommitRequest accountId(int? accountId);
CommitRequest confirmDuplicates(bool? confirmDuplicates);
CommitRequest dryRun(bool? dryRun);
/// This function **does support** nullification of nullable fields. All `null` values passed to `non-nullable` fields will be ignored. You can also use `CommitRequest(...).copyWith.fieldName(...)` to override fields one at a time with nullification support.
///
/// Usage
/// ```dart
/// CommitRequest(...).copyWith(id: 12, name: "My name")
/// ````
CommitRequest call({int? accountId, bool? confirmDuplicates, bool? dryRun});
}
/// Proxy class for `copyWith` functionality. This is a callable class and can be used as follows: `instanceOfCommitRequest.copyWith(...)`. Additionally contains functions for specific fields e.g. `instanceOfCommitRequest.copyWith.fieldName(...)`
class _$CommitRequestCWProxyImpl implements _$CommitRequestCWProxy {
const _$CommitRequestCWProxyImpl(this._value);
final CommitRequest _value;
@override
CommitRequest accountId(int? accountId) => this(accountId: accountId);
@override
CommitRequest confirmDuplicates(bool? confirmDuplicates) =>
this(confirmDuplicates: confirmDuplicates);
@override
CommitRequest dryRun(bool? dryRun) => this(dryRun: dryRun);
@override
/// This function **does support** nullification of nullable fields. All `null` values passed to `non-nullable` fields will be ignored. You can also use `CommitRequest(...).copyWith.fieldName(...)` to override fields one at a time with nullification support.
///
/// Usage
/// ```dart
/// CommitRequest(...).copyWith(id: 12, name: "My name")
/// ````
CommitRequest call({
Object? accountId = const $CopyWithPlaceholder(),
Object? confirmDuplicates = const $CopyWithPlaceholder(),
Object? dryRun = const $CopyWithPlaceholder(),
}) {
return CommitRequest(
accountId: accountId == const $CopyWithPlaceholder()
? _value.accountId
// ignore: cast_nullable_to_non_nullable
: accountId as int?,
confirmDuplicates: confirmDuplicates == const $CopyWithPlaceholder()
? _value.confirmDuplicates
// ignore: cast_nullable_to_non_nullable
: confirmDuplicates as bool?,
dryRun: dryRun == const $CopyWithPlaceholder()
? _value.dryRun
// ignore: cast_nullable_to_non_nullable
: dryRun as bool?,
);
}
}
extension $CommitRequestCopyWith on CommitRequest {
/// Returns a callable class that can be used as follows: `instanceOfCommitRequest.copyWith(...)` or like so:`instanceOfCommitRequest.copyWith.fieldName(...)`.
// ignore: library_private_types_in_public_api
_$CommitRequestCWProxy get copyWith => _$CommitRequestCWProxyImpl(this);
}
// **************************************************************************
// JsonSerializableGenerator
// **************************************************************************
CommitRequest _$CommitRequestFromJson(Map<String, dynamic> json) =>
$checkedCreate(
'CommitRequest',
json,
($checkedConvert) {
final val = CommitRequest(
accountId: $checkedConvert('account_id', (v) => (v as num?)?.toInt()),
confirmDuplicates: $checkedConvert(
'confirm_duplicates',
(v) => v as bool? ?? false,
),
dryRun: $checkedConvert('dry_run', (v) => v as bool? ?? false),
);
return val;
},
fieldKeyMap: const {
'accountId': 'account_id',
'confirmDuplicates': 'confirm_duplicates',
'dryRun': 'dry_run',
},
);
Map<String, dynamic> _$CommitRequestToJson(CommitRequest instance) =>
<String, dynamic>{
'account_id': ?instance.accountId,
'confirm_duplicates': ?instance.confirmDuplicates,
'dry_run': ?instance.dryRun,
};

Some files were not shown because too many files have changed in this diff Show More