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

openapi-generator-cli -g dart-dio. Генерируется, но коммитится: CI ловит дрейф
openapi/openapi.json, а приложение собирается без запуска генератора.
Пересобирается через just gen-client после любого изменения роутов.
This commit is contained in:
Dmitry
2026-09-18 13:44:09 +03:00
parent ce0966fca2
commit 90ba198c2a
176 changed files with 15733 additions and 0 deletions
@@ -0,0 +1,5 @@
# keep our config and ignore-file; everything else is regenerated
openapi-config.yaml
.openapi-generator-ignore
README.md
.gitignore
@@ -0,0 +1,129 @@
analysis_options.yaml
build.yaml
doc/AccountBalance.md
doc/AccountKind.md
doc/AccountOut.md
doc/AccountPatch.md
doc/AccountRole.md
doc/AccountsApi.md
doc/AuthApi.md
doc/Broker.md
doc/CashFlowMonth.md
doc/CashflowApi.md
doc/CategoriesApi.md
doc/CategoryOut.md
doc/DataQualityRow.md
doc/EventSource.md
doc/FlowType.md
doc/Health.md
doc/HealthApi.md
doc/JobStatus.md
doc/LoginRequest.md
doc/MetricsApi.md
doc/NetWorthBreakdown.md
doc/NetWorthDay.md
doc/NetworthApi.md
doc/Problem.md
doc/RefreshLogOut.md
doc/RefreshRequest.md
doc/RuleCreate.md
doc/RuleKind.md
doc/RuleMatchType.md
doc/RuleOut.md
doc/RulePatch.md
doc/RulesApi.md
doc/RunStatus.md
doc/RunwayOut.md
doc/SourceStatus.md
doc/SpendingRow.md
doc/SyncApi.md
doc/SyncJobOut.md
doc/SyncRunOut.md
doc/TokenPair.md
doc/TransactionOut.md
doc/TransactionPage.md
doc/TransactionsApi.md
doc/UserOut.md
lib/fintracker_api.dart
lib/src/api.dart
lib/src/api/accounts_api.dart
lib/src/api/auth_api.dart
lib/src/api/cashflow_api.dart
lib/src/api/categories_api.dart
lib/src/api/health_api.dart
lib/src/api/metrics_api.dart
lib/src/api/networth_api.dart
lib/src/api/rules_api.dart
lib/src/api/sync_api.dart
lib/src/api/transactions_api.dart
lib/src/auth/api_key_auth.dart
lib/src/auth/auth.dart
lib/src/auth/basic_auth.dart
lib/src/auth/bearer_auth.dart
lib/src/auth/oauth.dart
lib/src/deserialize.dart
lib/src/model/account_balance.dart
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/broker.dart
lib/src/model/cash_flow_month.dart
lib/src/model/category_out.dart
lib/src/model/data_quality_row.dart
lib/src/model/event_source.dart
lib/src/model/flow_type.dart
lib/src/model/health.dart
lib/src/model/job_status.dart
lib/src/model/login_request.dart
lib/src/model/net_worth_breakdown.dart
lib/src/model/net_worth_day.dart
lib/src/model/problem.dart
lib/src/model/refresh_log_out.dart
lib/src/model/refresh_request.dart
lib/src/model/rule_create.dart
lib/src/model/rule_kind.dart
lib/src/model/rule_match_type.dart
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/source_status.dart
lib/src/model/spending_row.dart
lib/src/model/sync_job_out.dart
lib/src/model/sync_run_out.dart
lib/src/model/token_pair.dart
lib/src/model/transaction_out.dart
lib/src/model/transaction_page.dart
lib/src/model/user_out.dart
pubspec.yaml
test/account_balance_test.dart
test/account_kind_test.dart
test/account_out_test.dart
test/account_patch_test.dart
test/account_role_test.dart
test/accounts_api_test.dart
test/broker_test.dart
test/cash_flow_month_test.dart
test/cashflow_api_test.dart
test/categories_api_test.dart
test/category_out_test.dart
test/data_quality_row_test.dart
test/event_source_test.dart
test/flow_type_test.dart
test/metrics_api_test.dart
test/net_worth_breakdown_test.dart
test/net_worth_day_test.dart
test/networth_api_test.dart
test/refresh_log_out_test.dart
test/rule_create_test.dart
test/rule_kind_test.dart
test/rule_match_type_test.dart
test/rule_out_test.dart
test/rule_patch_test.dart
test/rules_api_test.dart
test/runway_out_test.dart
test/spending_row_test.dart
test/transaction_out_test.dart
test/transaction_page_test.dart
test/transactions_api_test.dart
@@ -0,0 +1 @@
7.25.0
@@ -0,0 +1,10 @@
analyzer:
language:
strict-inference: true
strict-raw-types: true
strict-casts: false
exclude:
- test/*.dart
- lib/src/model/*.g.dart
errors:
deprecated_member_use_from_same_package: ignore
+18
View File
@@ -0,0 +1,18 @@
targets:
$default:
builders:
json_serializable:
options:
# Options configure how source code is generated for every
# `@JsonSerializable`-annotated class in the package.
#
# The default value for each is listed.
any_map: false
checked: true
create_factory: true
create_to_json: true
disallow_unrecognized_keys: true
explicit_to_json: true
field_rename: none
ignore_unannotated: false
include_if_null: false
@@ -0,0 +1,20 @@
# fintracker_api.model.AccountBalance
## Load the model package
```dart
import 'package:fintracker_api/api.dart';
```
## Properties
Name | Type | Description | Notes
------------ | ------------- | ------------- | -------------
**accountId** | **int** | |
**balance** | **String** | decimal as string |
**balanceRub** | **String** | decimal as string |
**currency** | **String** | |
**name** | **String** | |
**role** | [**AccountRole**](AccountRole.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,14 @@
# fintracker_api.model.AccountKind
## 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)
+31
View File
@@ -0,0 +1,31 @@
# fintracker_api.model.AccountOut
## Load the model package
```dart
import 'package:fintracker_api/api.dart';
```
## Properties
Name | Type | Description | Notes
------------ | ------------- | ------------- | -------------
**archived** | **bool** | |
**balance** | **String** | decimal as string |
**balanceAsOf** | [**DateTime**](DateTime.md) | |
**broker** | [**Broker**](Broker.md) | |
**creditLimit** | **String** | decimal as string |
**currency** | **String** | |
**id** | **int** | |
**includeInNetWorth** | **bool** | |
**kind** | [**AccountKind**](AccountKind.md) | |
**mirrorOfAccountId** | **int** | |
**name** | **String** | |
**openedAt** | [**DateTime**](DateTime.md) | |
**primaryEventSource** | [**EventSource**](EventSource.md) | |
**role** | [**AccountRole**](AccountRole.md) | |
**source_** | **String** | |
**sourceId** | **String** | |
**startBalance** | **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,19 @@
# fintracker_api.model.AccountPatch
## Load the model package
```dart
import 'package:fintracker_api/api.dart';
```
## Properties
Name | Type | Description | Notes
------------ | ------------- | ------------- | -------------
**includeInNetWorth** | **bool** | | [optional]
**mirrorOfAccountId** | **int** | | [optional]
**name** | **String** | | [optional]
**primaryEventSource** | [**EventSource**](EventSource.md) | | [optional]
**role** | [**AccountRole**](AccountRole.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,14 @@
# fintracker_api.model.AccountRole
## 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,99 @@
# fintracker_api.api.AccountsApi
## Load the API package
```dart
import 'package:fintracker_api/api.dart';
```
All URIs are relative to *http://localhost*
Method | HTTP request | Description
------------- | ------------- | -------------
[**accountsList**](AccountsApi.md#accountslist) | **GET** /api/v1/accounts | List
[**accountsPatch**](AccountsApi.md#accountspatch) | **PATCH** /api/v1/accounts/{account_id} | Patch
# **accountsList**
> List<AccountOut> accountsList()
List
Every account, archived ones included — the client decides what to show.
### Example
```dart
import 'package:fintracker_api/api.dart';
final api = FintrackerApi().getAccountsApi();
try {
final response = api.accountsList();
print(response);
} on DioException catch (e) {
print('Exception when calling AccountsApi->accountsList: $e\n');
}
```
### Parameters
This endpoint does not need any parameter.
### Return type
[**List&lt;AccountOut&gt;**](AccountOut.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)
# **accountsPatch**
> AccountOut accountsPatch(accountId, accountPatch)
Patch
Update the user-owned fields. Everything else is overwritten by the next sync.
### Example
```dart
import 'package:fintracker_api/api.dart';
final api = FintrackerApi().getAccountsApi();
final int accountId = 56; // int |
final AccountPatch accountPatch = ; // AccountPatch |
try {
final response = api.accountsPatch(accountId, accountPatch);
print(response);
} on DioException catch (e) {
print('Exception when calling AccountsApi->accountsPatch: $e\n');
}
```
### Parameters
Name | Type | Description | Notes
------------- | ------------- | ------------- | -------------
**accountId** | **int**| |
**accountPatch** | [**AccountPatch**](AccountPatch.md)| |
### Return type
[**AccountOut**](AccountOut.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)
+176
View File
@@ -0,0 +1,176 @@
# fintracker_api.api.AuthApi
## Load the API package
```dart
import 'package:fintracker_api/api.dart';
```
All URIs are relative to *http://localhost*
Method | HTTP request | Description
------------- | ------------- | -------------
[**authLogin**](AuthApi.md#authlogin) | **POST** /api/v1/auth/login | Login
[**authLogout**](AuthApi.md#authlogout) | **POST** /api/v1/auth/logout | Logout
[**authMe**](AuthApi.md#authme) | **GET** /api/v1/auth/me | Me
[**authRefresh**](AuthApi.md#authrefresh) | **POST** /api/v1/auth/refresh | Refresh
# **authLogin**
> TokenPair authLogin(loginRequest)
Login
### Example
```dart
import 'package:fintracker_api/api.dart';
final api = FintrackerApi().getAuthApi();
final LoginRequest loginRequest = ; // LoginRequest |
try {
final response = api.authLogin(loginRequest);
print(response);
} on DioException catch (e) {
print('Exception when calling AuthApi->authLogin: $e\n');
}
```
### Parameters
Name | Type | Description | Notes
------------- | ------------- | ------------- | -------------
**loginRequest** | [**LoginRequest**](LoginRequest.md)| |
### Return type
[**TokenPair**](TokenPair.md)
### Authorization
No authorization required
### 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)
# **authLogout**
> authLogout(refreshRequest)
Logout
### Example
```dart
import 'package:fintracker_api/api.dart';
final api = FintrackerApi().getAuthApi();
final RefreshRequest refreshRequest = ; // RefreshRequest |
try {
api.authLogout(refreshRequest);
} on DioException catch (e) {
print('Exception when calling AuthApi->authLogout: $e\n');
}
```
### Parameters
Name | Type | Description | Notes
------------- | ------------- | ------------- | -------------
**refreshRequest** | [**RefreshRequest**](RefreshRequest.md)| |
### Return type
void (empty response body)
### Authorization
No authorization required
### HTTP request headers
- **Content-Type**: application/json
- **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)
# **authMe**
> UserOut authMe()
Me
### Example
```dart
import 'package:fintracker_api/api.dart';
final api = FintrackerApi().getAuthApi();
try {
final response = api.authMe();
print(response);
} on DioException catch (e) {
print('Exception when calling AuthApi->authMe: $e\n');
}
```
### Parameters
This endpoint does not need any parameter.
### Return type
[**UserOut**](UserOut.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)
# **authRefresh**
> TokenPair authRefresh(refreshRequest)
Refresh
### Example
```dart
import 'package:fintracker_api/api.dart';
final api = FintrackerApi().getAuthApi();
final RefreshRequest refreshRequest = ; // RefreshRequest |
try {
final response = api.authRefresh(refreshRequest);
print(response);
} on DioException catch (e) {
print('Exception when calling AuthApi->authRefresh: $e\n');
}
```
### Parameters
Name | Type | Description | Notes
------------- | ------------- | ------------- | -------------
**refreshRequest** | [**RefreshRequest**](RefreshRequest.md)| |
### Return type
[**TokenPair**](TokenPair.md)
### Authorization
No authorization required
### 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)
+14
View File
@@ -0,0 +1,14 @@
# fintracker_api.model.Broker
## 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,22 @@
# fintracker_api.model.CashFlowMonth
## Load the model package
```dart
import 'package:fintracker_api/api.dart';
```
## Properties
Name | Type | Description | Notes
------------ | ------------- | ------------- | -------------
**baselineRub** | **String** | decimal as string |
**expenseRub** | **String** | decimal as string |
**incomeRub** | **String** | decimal as string |
**month** | [**DateTime**](DateTime.md) | |
**oneOffRub** | **String** | decimal as string |
**savingsRate** | **String** | decimal as string |
**savingsTransferRub** | **String** | decimal as string |
**txnCount** | **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)
+141
View File
@@ -0,0 +1,141 @@
# fintracker_api.api.CashflowApi
## Load the API package
```dart
import 'package:fintracker_api/api.dart';
```
All URIs are relative to *http://localhost*
Method | HTTP request | Description
------------- | ------------- | -------------
[**cashflowMonthly**](CashflowApi.md#cashflowmonthly) | **GET** /api/v1/cashflow/monthly | Monthly
[**cashflowRunway**](CashflowApi.md#cashflowrunway) | **GET** /api/v1/runway | Runway
[**cashflowSpending**](CashflowApi.md#cashflowspending) | **GET** /api/v1/spending/categories | Spending
# **cashflowMonthly**
> List<CashFlowMonth> cashflowMonthly(months)
Monthly
The last `months` months, oldest first.
### Example
```dart
import 'package:fintracker_api/api.dart';
final api = FintrackerApi().getCashflowApi();
final int months = 56; // int |
try {
final response = api.cashflowMonthly(months);
print(response);
} on DioException catch (e) {
print('Exception when calling CashflowApi->cashflowMonthly: $e\n');
}
```
### Parameters
Name | Type | Description | Notes
------------- | ------------- | ------------- | -------------
**months** | **int**| | [optional] [default to 12]
### Return type
[**List&lt;CashFlowMonth&gt;**](CashFlowMonth.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)
# **cashflowRunway**
> RunwayOut cashflowRunway()
Runway
How many months the liquid reserve covers; null before the first refresh.
### Example
```dart
import 'package:fintracker_api/api.dart';
final api = FintrackerApi().getCashflowApi();
try {
final response = api.cashflowRunway();
print(response);
} on DioException catch (e) {
print('Exception when calling CashflowApi->cashflowRunway: $e\n');
}
```
### Parameters
This endpoint does not need any parameter.
### Return type
[**RunwayOut**](RunwayOut.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)
# **cashflowSpending**
> List<SpendingRow> cashflowSpending(month)
Spending
Expenses of one month by category, largest first.
### Example
```dart
import 'package:fintracker_api/api.dart';
final api = FintrackerApi().getCashflowApi();
final String month = month_example; // String | YYYY-MM; defaults to the latest month
try {
final response = api.cashflowSpending(month);
print(response);
} on DioException catch (e) {
print('Exception when calling CashflowApi->cashflowSpending: $e\n');
}
```
### Parameters
Name | Type | Description | Notes
------------- | ------------- | ------------- | -------------
**month** | **String**| YYYY-MM; defaults to the latest month | [optional]
### Return type
[**List&lt;SpendingRow&gt;**](SpendingRow.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,53 @@
# fintracker_api.api.CategoriesApi
## Load the API package
```dart
import 'package:fintracker_api/api.dart';
```
All URIs are relative to *http://localhost*
Method | HTTP request | Description
------------- | ------------- | -------------
[**categoriesList**](CategoriesApi.md#categorieslist) | **GET** /api/v1/categories | List
# **categoriesList**
> List<CategoryOut> categoriesList()
List
Flat list of the ZenMoney tag tree; the client nests it by `parent_id`.
### Example
```dart
import 'package:fintracker_api/api.dart';
final api = FintrackerApi().getCategoriesApi();
try {
final response = api.categoriesList();
print(response);
} on DioException catch (e) {
print('Exception when calling CategoriesApi->categoriesList: $e\n');
}
```
### Parameters
This endpoint does not need any parameter.
### Return type
[**List&lt;CategoryOut&gt;**](CategoryOut.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.CategoryOut
## Load the model package
```dart
import 'package:fintracker_api/api.dart';
```
## Properties
Name | Type | Description | Notes
------------ | ------------- | ------------- | -------------
**archived** | **bool** | |
**color** | **int** | |
**icon** | **String** | |
**id** | **int** | |
**name** | **String** | |
**parentId** | **int** | |
**showIncome** | **bool** | |
**showOutcome** | **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.DataQualityRow
## Load the model package
```dart
import 'package:fintracker_api/api.dart';
```
## Properties
Name | Type | Description | Notes
------------ | ------------- | ------------- | -------------
**checkName** | **String** | |
**computedAt** | [**DateTime**](DateTime.md) | |
**count** | **int** | |
**detail** | **String** | |
**id** | **int** | |
**ref** | **Map&lt;String, Object&gt;** | |
**severity** | **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.EventSource
## 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)
+14
View File
@@ -0,0 +1,14 @@
# fintracker_api.model.FlowType
## 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)
+17
View File
@@ -0,0 +1,17 @@
# fintracker_api.model.Health
## Load the model package
```dart
import 'package:fintracker_api/api.dart';
```
## Properties
Name | Type | Description | Notes
------------ | ------------- | ------------- | -------------
**database** | **String** | |
**status** | **String** | |
**version** | **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)
+51
View File
@@ -0,0 +1,51 @@
# fintracker_api.api.HealthApi
## Load the API package
```dart
import 'package:fintracker_api/api.dart';
```
All URIs are relative to *http://localhost*
Method | HTTP request | Description
------------- | ------------- | -------------
[**healthCheck**](HealthApi.md#healthcheck) | **GET** /api/v1/health | Check
# **healthCheck**
> Health healthCheck()
Check
### Example
```dart
import 'package:fintracker_api/api.dart';
final api = FintrackerApi().getHealthApi();
try {
final response = api.healthCheck();
print(response);
} on DioException catch (e) {
print('Exception when calling HealthApi->healthCheck: $e\n');
}
```
### Parameters
This endpoint does not need any parameter.
### Return type
[**Health**](Health.md)
### Authorization
No authorization required
### 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)
+14
View File
@@ -0,0 +1,14 @@
# fintracker_api.model.JobStatus
## 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,16 @@
# fintracker_api.model.LoginRequest
## Load the model package
```dart
import 'package:fintracker_api/api.dart';
```
## Properties
Name | Type | Description | Notes
------------ | ------------- | ------------- | -------------
**email** | **String** | |
**password** | **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)
+133
View File
@@ -0,0 +1,133 @@
# fintracker_api.api.MetricsApi
## Load the API package
```dart
import 'package:fintracker_api/api.dart';
```
All URIs are relative to *http://localhost*
Method | HTTP request | Description
------------- | ------------- | -------------
[**metricsDataQuality**](MetricsApi.md#metricsdataquality) | **GET** /api/v1/data-quality | Data Quality
[**metricsRefresh**](MetricsApi.md#metricsrefresh) | **POST** /api/v1/metrics/refresh | Refresh
[**metricsStatus**](MetricsApi.md#metricsstatus) | **GET** /api/v1/metrics/status | Status
# **metricsDataQuality**
> List<DataQualityRow> metricsDataQuality()
Data Quality
Findings of the latest refresh, most serious first.
### Example
```dart
import 'package:fintracker_api/api.dart';
final api = FintrackerApi().getMetricsApi();
try {
final response = api.metricsDataQuality();
print(response);
} on DioException catch (e) {
print('Exception when calling MetricsApi->metricsDataQuality: $e\n');
}
```
### Parameters
This endpoint does not need any parameter.
### Return type
[**List&lt;DataQualityRow&gt;**](DataQualityRow.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)
# **metricsRefresh**
> RefreshLogOut metricsRefresh()
Refresh
Rebuild every metric_* table inline (seconds at personal volumes).
### Example
```dart
import 'package:fintracker_api/api.dart';
final api = FintrackerApi().getMetricsApi();
try {
final response = api.metricsRefresh();
print(response);
} on DioException catch (e) {
print('Exception when calling MetricsApi->metricsRefresh: $e\n');
}
```
### Parameters
This endpoint does not need any parameter.
### Return type
[**RefreshLogOut**](RefreshLogOut.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)
# **metricsStatus**
> RefreshLogOut metricsStatus()
Status
When the metric tables were last rebuilt, and whether it failed.
### Example
```dart
import 'package:fintracker_api/api.dart';
final api = FintrackerApi().getMetricsApi();
try {
final response = api.metricsStatus();
print(response);
} on DioException catch (e) {
print('Exception when calling MetricsApi->metricsStatus: $e\n');
}
```
### Parameters
This endpoint does not need any parameter.
### Return type
[**RefreshLogOut**](RefreshLogOut.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,23 @@
# fintracker_api.model.NetWorthBreakdown
## Load the model package
```dart
import 'package:fintracker_api/api.dart';
```
## Properties
Name | Type | Description | Notes
------------ | ------------- | ------------- | -------------
**accounts** | [**List&lt;AccountBalance&gt;**](AccountBalance.md) | |
**byCurrency** | **Map&lt;String, String&gt;** | |
**d** | [**DateTime**](DateTime.md) | |
**debtRub** | **String** | decimal as string |
**investmentRub** | **String** | decimal as string |
**liquidRub** | **String** | decimal as string |
**missingFxCount** | **int** | |
**savingsRub** | **String** | decimal as string |
**totalRub** | **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.NetWorthDay
## Load the model package
```dart
import 'package:fintracker_api/api.dart';
```
## Properties
Name | Type | Description | Notes
------------ | ------------- | ------------- | -------------
**byCurrency** | **Map&lt;String, String&gt;** | |
**d** | [**DateTime**](DateTime.md) | |
**debtRub** | **String** | decimal as string |
**investmentRub** | **String** | decimal as string |
**liquidRub** | **String** | decimal as string |
**missingFxCount** | **int** | |
**savingsRub** | **String** | decimal as string |
**totalRub** | **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,99 @@
# fintracker_api.api.NetworthApi
## Load the API package
```dart
import 'package:fintracker_api/api.dart';
```
All URIs are relative to *http://localhost*
Method | HTTP request | Description
------------- | ------------- | -------------
[**networthBreakdown**](NetworthApi.md#networthbreakdown) | **GET** /api/v1/networth/breakdown | Breakdown
[**networthSeries**](NetworthApi.md#networthseries) | **GET** /api/v1/networth/series | Series
# **networthBreakdown**
> NetWorthBreakdown networthBreakdown()
Breakdown
The latest day's buckets, plus every account's current balance native and in RUB.
### Example
```dart
import 'package:fintracker_api/api.dart';
final api = FintrackerApi().getNetworthApi();
try {
final response = api.networthBreakdown();
print(response);
} on DioException catch (e) {
print('Exception when calling NetworthApi->networthBreakdown: $e\n');
}
```
### Parameters
This endpoint does not need any parameter.
### Return type
[**NetWorthBreakdown**](NetWorthBreakdown.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)
# **networthSeries**
> List<NetWorthDay> networthSeries(from, to)
Series
Daily net worth; defaults to the last 365 days.
### Example
```dart
import 'package:fintracker_api/api.dart';
final api = FintrackerApi().getNetworthApi();
final DateTime from = 2013-10-20; // DateTime |
final DateTime to = 2013-10-20; // DateTime |
try {
final response = api.networthSeries(from, to);
print(response);
} on DioException catch (e) {
print('Exception when calling NetworthApi->networthSeries: $e\n');
}
```
### Parameters
Name | Type | Description | Notes
------------- | ------------- | ------------- | -------------
**from** | **DateTime**| | [optional]
**to** | **DateTime**| | [optional]
### Return type
[**List&lt;NetWorthDay&gt;**](NetWorthDay.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)
+18
View File
@@ -0,0 +1,18 @@
# fintracker_api.model.Problem
## Load the model package
```dart
import 'package:fintracker_api/api.dart';
```
## Properties
Name | Type | Description | Notes
------------ | ------------- | ------------- | -------------
**detail** | **String** | | [optional]
**errors** | **List&lt;Object&gt;** | | [optional]
**status** | **int** | |
**title** | **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.RefreshLogOut
## Load the model package
```dart
import 'package:fintracker_api/api.dart';
```
## Properties
Name | Type | Description | Notes
------------ | ------------- | ------------- | -------------
**error** | **String** | |
**finishedAt** | [**DateTime**](DateTime.md) | |
**id** | **int** | |
**startedAt** | [**DateTime**](DateTime.md) | |
**trigger** | **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,15 @@
# fintracker_api.model.RefreshRequest
## Load the model package
```dart
import 'package:fintracker_api/api.dart';
```
## Properties
Name | Type | Description | Notes
------------ | ------------- | ------------- | -------------
**refreshToken** | **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)
+21
View File
@@ -0,0 +1,21 @@
# fintracker_api.model.RuleCreate
## Load the model package
```dart
import 'package:fintracker_api/api.dart';
```
## Properties
Name | Type | Description | Notes
------------ | ------------- | ------------- | -------------
**enabled** | **bool** | | [optional] [default to true]
**kind** | [**RuleKind**](RuleKind.md) | |
**matchType** | [**RuleMatchType**](RuleMatchType.md) | |
**note** | **String** | | [optional]
**pattern** | **String** | |
**priority** | **int** | | [optional] [default to 100]
**value** | **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)
+14
View File
@@ -0,0 +1,14 @@
# fintracker_api.model.RuleKind
## 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,14 @@
# fintracker_api.model.RuleMatchType
## 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)
+24
View File
@@ -0,0 +1,24 @@
# fintracker_api.model.RuleOut
## Load the model package
```dart
import 'package:fintracker_api/api.dart';
```
## Properties
Name | Type | Description | Notes
------------ | ------------- | ------------- | -------------
**enabled** | **bool** | |
**id** | **int** | |
**kind** | [**RuleKind**](RuleKind.md) | |
**lastMatchedAt** | [**DateTime**](DateTime.md) | |
**matchCount** | **int** | |
**matchType** | [**RuleMatchType**](RuleMatchType.md) | |
**note** | **String** | |
**pattern** | **String** | |
**priority** | **int** | |
**value** | **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)
+21
View File
@@ -0,0 +1,21 @@
# fintracker_api.model.RulePatch
## Load the model package
```dart
import 'package:fintracker_api/api.dart';
```
## Properties
Name | Type | Description | Notes
------------ | ------------- | ------------- | -------------
**enabled** | **bool** | | [optional]
**kind** | [**RuleKind**](RuleKind.md) | | [optional]
**matchType** | [**RuleMatchType**](RuleMatchType.md) | | [optional]
**note** | **String** | | [optional]
**pattern** | **String** | | [optional]
**priority** | **int** | | [optional]
**value** | **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)
+258
View File
@@ -0,0 +1,258 @@
# fintracker_api.api.RulesApi
## Load the API package
```dart
import 'package:fintracker_api/api.dart';
```
All URIs are relative to *http://localhost*
Method | HTTP request | Description
------------- | ------------- | -------------
[**rulesApply**](RulesApi.md#rulesapply) | **POST** /api/v1/rules/apply | Apply
[**rulesCreate**](RulesApi.md#rulescreate) | **POST** /api/v1/rules | Create
[**rulesDelete**](RulesApi.md#rulesdelete) | **DELETE** /api/v1/rules/{rule_id} | Delete
[**rulesList**](RulesApi.md#ruleslist) | **GET** /api/v1/rules | List
[**rulesPatch**](RulesApi.md#rulespatch) | **PATCH** /api/v1/rules/{rule_id} | Patch
[**rulesStale**](RulesApi.md#rulesstale) | **GET** /api/v1/rules/stale | Stale
# **rulesApply**
> RefreshLogOut rulesApply()
Apply
Re-run the whole metric refresh so edited rules take effect everywhere at once.
### Example
```dart
import 'package:fintracker_api/api.dart';
final api = FintrackerApi().getRulesApi();
try {
final response = api.rulesApply();
print(response);
} on DioException catch (e) {
print('Exception when calling RulesApi->rulesApply: $e\n');
}
```
### Parameters
This endpoint does not need any parameter.
### Return type
[**RefreshLogOut**](RefreshLogOut.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)
# **rulesCreate**
> RuleOut rulesCreate(ruleCreate)
Create
### Example
```dart
import 'package:fintracker_api/api.dart';
final api = FintrackerApi().getRulesApi();
final RuleCreate ruleCreate = ; // RuleCreate |
try {
final response = api.rulesCreate(ruleCreate);
print(response);
} on DioException catch (e) {
print('Exception when calling RulesApi->rulesCreate: $e\n');
}
```
### Parameters
Name | Type | Description | Notes
------------- | ------------- | ------------- | -------------
**ruleCreate** | [**RuleCreate**](RuleCreate.md)| |
### Return type
[**RuleOut**](RuleOut.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)
# **rulesDelete**
> rulesDelete(ruleId)
Delete
### Example
```dart
import 'package:fintracker_api/api.dart';
final api = FintrackerApi().getRulesApi();
final int ruleId = 56; // int |
try {
api.rulesDelete(ruleId);
} on DioException catch (e) {
print('Exception when calling RulesApi->rulesDelete: $e\n');
}
```
### Parameters
Name | Type | Description | Notes
------------- | ------------- | ------------- | -------------
**ruleId** | **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)
# **rulesList**
> List<RuleOut> rulesList()
List
### Example
```dart
import 'package:fintracker_api/api.dart';
final api = FintrackerApi().getRulesApi();
try {
final response = api.rulesList();
print(response);
} on DioException catch (e) {
print('Exception when calling RulesApi->rulesList: $e\n');
}
```
### Parameters
This endpoint does not need any parameter.
### Return type
[**List&lt;RuleOut&gt;**](RuleOut.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)
# **rulesPatch**
> RuleOut rulesPatch(ruleId, rulePatch)
Patch
### Example
```dart
import 'package:fintracker_api/api.dart';
final api = FintrackerApi().getRulesApi();
final int ruleId = 56; // int |
final RulePatch rulePatch = ; // RulePatch |
try {
final response = api.rulesPatch(ruleId, rulePatch);
print(response);
} on DioException catch (e) {
print('Exception when calling RulesApi->rulesPatch: $e\n');
}
```
### Parameters
Name | Type | Description | Notes
------------- | ------------- | ------------- | -------------
**ruleId** | **int**| |
**rulePatch** | [**RulePatch**](RulePatch.md)| |
### Return type
[**RuleOut**](RuleOut.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)
# **rulesStale**
> List<RuleOut> rulesStale()
Stale
Enabled rules that matched nothing in the latest refresh: the payee was renamed, or the transaction was re-categorised in ZenMoney.
### Example
```dart
import 'package:fintracker_api/api.dart';
final api = FintrackerApi().getRulesApi();
try {
final response = api.rulesStale();
print(response);
} on DioException catch (e) {
print('Exception when calling RulesApi->rulesStale: $e\n');
}
```
### Parameters
This endpoint does not need any parameter.
### Return type
[**List&lt;RuleOut&gt;**](RuleOut.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)
+14
View File
@@ -0,0 +1,14 @@
# fintracker_api.model.RunStatus
## 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)
+18
View File
@@ -0,0 +1,18 @@
# fintracker_api.model.RunwayOut
## Load the model package
```dart
import 'package:fintracker_api/api.dart';
```
## Properties
Name | Type | Description | Notes
------------ | ------------- | ------------- | -------------
**asOf** | [**DateTime**](DateTime.md) | |
**avgBaseline3mRub** | **String** | decimal as string |
**liquidReserveRub** | **String** | decimal as string |
**runwayMonths** | **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.SourceStatus
## Load the model package
```dart
import 'package:fintracker_api/api.dart';
```
## Properties
Name | Type | Description | Notes
------------ | ------------- | ------------- | -------------
**cursor** | **String** | |
**lastRunAt** | [**DateTime**](DateTime.md) | |
**lastRunStatus** | [**RunStatus**](RunStatus.md) | |
**lastSuccessAt** | [**DateTime**](DateTime.md) | |
**queued** | **bool** | |
**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,21 @@
# fintracker_api.model.SpendingRow
## Load the model package
```dart
import 'package:fintracker_api/api.dart';
```
## Properties
Name | Type | Description | Notes
------------ | ------------- | ------------- | -------------
**amountRub** | **String** | decimal as string |
**categoryId** | **int** | |
**categoryName** | **String** | |
**month** | [**DateTime**](DateTime.md) | |
**rootCategoryId** | **int** | |
**rootCategoryName** | **String** | |
**txnCount** | **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)
+137
View File
@@ -0,0 +1,137 @@
# fintracker_api.api.SyncApi
## Load the API package
```dart
import 'package:fintracker_api/api.dart';
```
All URIs are relative to *http://localhost*
Method | HTTP request | Description
------------- | ------------- | -------------
[**syncRuns**](SyncApi.md#syncruns) | **GET** /api/v1/sync/runs | Runs
[**syncStatus**](SyncApi.md#syncstatus) | **GET** /api/v1/sync/status | Status
[**syncTrigger**](SyncApi.md#synctrigger) | **POST** /api/v1/sync/{source} | Trigger
# **syncRuns**
> List<SyncRunOut> syncRuns(source_, limit)
Runs
### Example
```dart
import 'package:fintracker_api/api.dart';
final api = FintrackerApi().getSyncApi();
final String source_ = source__example; // String |
final int limit = 56; // int |
try {
final response = api.syncRuns(source_, limit);
print(response);
} on DioException catch (e) {
print('Exception when calling SyncApi->syncRuns: $e\n');
}
```
### Parameters
Name | Type | Description | Notes
------------- | ------------- | ------------- | -------------
**source_** | **String**| | [optional]
**limit** | **int**| | [optional] [default to 20]
### Return type
[**List&lt;SyncRunOut&gt;**](SyncRunOut.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)
# **syncStatus**
> List<SourceStatus> syncStatus()
Status
### Example
```dart
import 'package:fintracker_api/api.dart';
final api = FintrackerApi().getSyncApi();
try {
final response = api.syncStatus();
print(response);
} on DioException catch (e) {
print('Exception when calling SyncApi->syncStatus: $e\n');
}
```
### Parameters
This endpoint does not need any parameter.
### Return type
[**List&lt;SourceStatus&gt;**](SourceStatus.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)
# **syncTrigger**
> SyncJobOut syncTrigger(source_)
Trigger
### Example
```dart
import 'package:fintracker_api/api.dart';
final api = FintrackerApi().getSyncApi();
final String source_ = source__example; // String |
try {
final response = api.syncTrigger(source_);
print(response);
} on DioException catch (e) {
print('Exception when calling SyncApi->syncTrigger: $e\n');
}
```
### Parameters
Name | Type | Description | Notes
------------- | ------------- | ------------- | -------------
**source_** | **String**| |
### Return type
[**SyncJobOut**](SyncJobOut.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)
+18
View File
@@ -0,0 +1,18 @@
# fintracker_api.model.SyncJobOut
## Load the model package
```dart
import 'package:fintracker_api/api.dart';
```
## Properties
Name | Type | Description | Notes
------------ | ------------- | ------------- | -------------
**id** | **String** | |
**requestedAt** | [**DateTime**](DateTime.md) | |
**source_** | **String** | |
**status** | [**JobStatus**](JobStatus.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)
+25
View File
@@ -0,0 +1,25 @@
# fintracker_api.model.SyncRunOut
## Load the model package
```dart
import 'package:fintracker_api/api.dart';
```
## Properties
Name | Type | Description | Notes
------------ | ------------- | ------------- | -------------
**counts** | **Map&lt;String, Object&gt;** | |
**cursorAfter** | **String** | |
**cursorBefore** | **String** | |
**error** | **String** | |
**finishedAt** | [**DateTime**](DateTime.md) | |
**id** | **String** | |
**source_** | **String** | |
**startedAt** | [**DateTime**](DateTime.md) | |
**status** | [**RunStatus**](RunStatus.md) | |
**triggeredBy** | **String** | |
**warnings** | **List&lt;Object&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)
+18
View File
@@ -0,0 +1,18 @@
# fintracker_api.model.TokenPair
## Load the model package
```dart
import 'package:fintracker_api/api.dart';
```
## Properties
Name | Type | Description | Notes
------------ | ------------- | ------------- | -------------
**accessToken** | **String** | |
**expiresIn** | **int** | |
**refreshToken** | **String** | |
**tokenType** | **String** | | [optional] [default to 'bearer']
[[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.TransactionOut
## Load the model package
```dart
import 'package:fintracker_api/api.dart';
```
## Properties
Name | Type | Description | Notes
------------ | ------------- | ------------- | -------------
**categoryId** | **int** | |
**comment** | **String** | |
**date** | [**DateTime**](DateTime.md) | |
**deleted** | **bool** | |
**flowType** | [**FlowType**](FlowType.md) | |
**hold** | **bool** | |
**id** | **int** | |
**income** | **String** | decimal as string |
**incomeAccountId** | **int** | |
**incomeCurrency** | **String** | |
**incomeRub** | **String** | decimal as string |
**isOneOff** | **bool** | |
**mcc** | **int** | |
**outcome** | **String** | decimal as string |
**outcomeAccountId** | **int** | |
**outcomeCurrency** | **String** | |
**outcomeRub** | **String** | decimal as string |
**payee** | **String** | |
**payeeCanonical** | **String** | |
**sourceId** | **String** | |
**tags** | **List&lt;int&gt;** | |
**tripId** | **int** | |
**ts** | [**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.TransactionPage
## Load the model package
```dart
import 'package:fintracker_api/api.dart';
```
## Properties
Name | Type | Description | Notes
------------ | ------------- | ------------- | -------------
**items** | [**List&lt;TransactionOut&gt;**](TransactionOut.md) | |
**page** | **int** | |
**pageSize** | **int** | |
**total** | **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,73 @@
# fintracker_api.api.TransactionsApi
## Load the API package
```dart
import 'package:fintracker_api/api.dart';
```
All URIs are relative to *http://localhost*
Method | HTTP request | Description
------------- | ------------- | -------------
[**transactionsList**](TransactionsApi.md#transactionslist) | **GET** /api/v1/transactions | List
# **transactionsList**
> TransactionPage transactionsList(from, to, accountId, categoryId, flowType, q, includeDeleted, page, pageSize)
List
One page of transactions, newest first, with RUB amounts at each own date's rate.
### Example
```dart
import 'package:fintracker_api/api.dart';
final api = FintrackerApi().getTransactionsApi();
final DateTime from = 2013-10-20; // DateTime |
final DateTime to = 2013-10-20; // DateTime |
final int accountId = 56; // int |
final int categoryId = 56; // int |
final FlowType flowType = ; // FlowType |
final String q = q_example; // String | substring of payee or comment
final bool includeDeleted = true; // bool |
final int page = 56; // int |
final int pageSize = 56; // int |
try {
final response = api.transactionsList(from, to, accountId, categoryId, flowType, q, includeDeleted, page, pageSize);
print(response);
} on DioException catch (e) {
print('Exception when calling TransactionsApi->transactionsList: $e\n');
}
```
### Parameters
Name | Type | Description | Notes
------------- | ------------- | ------------- | -------------
**from** | **DateTime**| | [optional]
**to** | **DateTime**| | [optional]
**accountId** | **int**| | [optional]
**categoryId** | **int**| | [optional]
**flowType** | [**FlowType**](.md)| | [optional]
**q** | **String**| substring of payee or comment | [optional]
**includeDeleted** | **bool**| | [optional] [default to false]
**page** | **int**| | [optional] [default to 1]
**pageSize** | **int**| | [optional] [default to 50]
### Return type
[**TransactionPage**](TransactionPage.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.UserOut
## Load the model package
```dart
import 'package:fintracker_api/api.dart';
```
## Properties
Name | Type | Description | Notes
------------ | ------------- | ------------- | -------------
**email** | **String** | |
**id** | **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,57 @@
//
// AUTO-GENERATED FILE, DO NOT MODIFY!
//
export 'package:fintracker_api/src/api.dart';
export 'package:fintracker_api/src/auth/api_key_auth.dart';
export 'package:fintracker_api/src/auth/basic_auth.dart';
export 'package:fintracker_api/src/auth/bearer_auth.dart';
export 'package:fintracker_api/src/auth/oauth.dart';
export 'package:fintracker_api/src/api/accounts_api.dart';
export 'package:fintracker_api/src/api/auth_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/health_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/rules_api.dart';
export 'package:fintracker_api/src/api/sync_api.dart';
export 'package:fintracker_api/src/api/transactions_api.dart';
export 'package:fintracker_api/src/model/account_balance.dart';
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/broker.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/data_quality_row.dart';
export 'package:fintracker_api/src/model/event_source.dart';
export 'package:fintracker_api/src/model/flow_type.dart';
export 'package:fintracker_api/src/model/health.dart';
export 'package:fintracker_api/src/model/job_status.dart';
export 'package:fintracker_api/src/model/login_request.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/problem.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/rule_create.dart';
export 'package:fintracker_api/src/model/rule_kind.dart';
export 'package:fintracker_api/src/model/rule_match_type.dart';
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/source_status.dart';
export 'package:fintracker_api/src/model/spending_row.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/token_pair.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/user_out.dart';
+171
View File
@@ -0,0 +1,171 @@
//
// AUTO-GENERATED FILE, DO NOT MODIFY!
//
import 'package:dio/dio.dart';
import 'package:fintracker_api/src/auth/api_key_auth.dart';
import 'package:fintracker_api/src/auth/basic_auth.dart';
import 'package:fintracker_api/src/auth/bearer_auth.dart';
import 'package:fintracker_api/src/auth/oauth.dart';
import 'package:fintracker_api/src/api/accounts_api.dart';
import 'package:fintracker_api/src/api/auth_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/health_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/rules_api.dart';
import 'package:fintracker_api/src/api/sync_api.dart';
import 'package:fintracker_api/src/api/transactions_api.dart';
class FintrackerApi {
static const String basePath = r'http://localhost';
final Dio dio;
FintrackerApi({
Dio? dio,
String? basePathOverride,
List<Interceptor>? interceptors,
}) :
this.dio = dio ??
Dio(BaseOptions(
baseUrl: basePathOverride ?? basePath,
connectTimeout: const Duration(milliseconds: 5000),
receiveTimeout: const Duration(milliseconds: 3000),
)) {
if (interceptors == null) {
this.dio.interceptors.addAll([
OAuthInterceptor(),
BasicAuthInterceptor(),
BearerAuthInterceptor(),
ApiKeyAuthInterceptor(),
]);
} else {
this.dio.interceptors.addAll(interceptors);
}
}
void setOAuthToken(String name, String token) {
if (this.dio.interceptors.any((i) => i is OAuthInterceptor)) {
(this.dio.interceptors.firstWhere((i) => i is OAuthInterceptor) as OAuthInterceptor).tokens[name] = token;
}
}
/// Removes the OAuth token associated with the given [name].
///
/// If no [OAuthInterceptor] is registered or no token exists for the given
/// [name], this method has no effect.
void removeOAuthToken(String name) {
if (this.dio.interceptors.any((i) => i is OAuthInterceptor)) {
(this.dio.interceptors.firstWhere((i) => i is OAuthInterceptor) as OAuthInterceptor).tokens.remove(name);
}
}
void setBearerAuth(String name, String token) {
if (this.dio.interceptors.any((i) => i is BearerAuthInterceptor)) {
(this.dio.interceptors.firstWhere((i) => i is BearerAuthInterceptor) as BearerAuthInterceptor).tokens[name] = token;
}
}
/// Removes the bearer authentication token associated with the given [name].
///
/// If no [BearerAuthInterceptor] is registered or no token exists for the
/// given [name], this method has no effect.
void removeBearerAuth(String name) {
if (this.dio.interceptors.any((i) => i is BearerAuthInterceptor)) {
(this.dio.interceptors.firstWhere((i) => i is BearerAuthInterceptor) as BearerAuthInterceptor).tokens.remove(name);
}
}
void setBasicAuth(String name, String username, String password) {
if (this.dio.interceptors.any((i) => i is BasicAuthInterceptor)) {
(this.dio.interceptors.firstWhere((i) => i is BasicAuthInterceptor) as BasicAuthInterceptor).authInfo[name] = BasicAuthInfo(username, password);
}
}
/// Removes the basic authentication credentials associated with the given [name].
///
/// If no [BasicAuthInterceptor] is registered or no credentials exist for the
/// given [name], this method has no effect.
void removeBasicAuth(String name) {
if (this.dio.interceptors.any((i) => i is BasicAuthInterceptor)) {
(this.dio.interceptors.firstWhere((i) => i is BasicAuthInterceptor) as BasicAuthInterceptor).authInfo.remove(name);
}
}
void setApiKey(String name, String apiKey) {
if (this.dio.interceptors.any((i) => i is ApiKeyAuthInterceptor)) {
(this.dio.interceptors.firstWhere((element) => element is ApiKeyAuthInterceptor) as ApiKeyAuthInterceptor).apiKeys[name] = apiKey;
}
}
/// Removes the API key associated with the given [name].
///
/// If no [ApiKeyAuthInterceptor] is registered or no API key exists for the
/// given [name], this method has no effect.
void removeApiKey(String name) {
if (this.dio.interceptors.any((i) => i is ApiKeyAuthInterceptor)) {
(this.dio.interceptors.firstWhere((element) => element is ApiKeyAuthInterceptor) as ApiKeyAuthInterceptor).apiKeys.remove(name);
}
}
/// Get AccountsApi instance, base route and serializer can be overridden by a given but be careful,
/// by doing that all interceptors will not be executed
AccountsApi getAccountsApi() {
return AccountsApi(dio);
}
/// Get AuthApi instance, base route and serializer can be overridden by a given but be careful,
/// by doing that all interceptors will not be executed
AuthApi getAuthApi() {
return AuthApi(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() {
return CashflowApi(dio);
}
/// Get CategoriesApi instance, base route and serializer can be overridden by a given but be careful,
/// by doing that all interceptors will not be executed
CategoriesApi getCategoriesApi() {
return CategoriesApi(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 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() {
return MetricsApi(dio);
}
/// Get NetworthApi instance, base route and serializer can be overridden by a given but be careful,
/// by doing that all interceptors will not be executed
NetworthApi getNetworthApi() {
return NetworthApi(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() {
return RulesApi(dio);
}
/// Get SyncApi instance, base route and serializer can be overridden by a given but be careful,
/// by doing that all interceptors will not be executed
SyncApi getSyncApi() {
return SyncApi(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() {
return TransactionsApi(dio);
}
}
@@ -0,0 +1,197 @@
//
// 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/account_out.dart';
import 'package:fintracker_api/src/model/account_patch.dart';
import 'package:fintracker_api/src/model/problem.dart';
class AccountsApi {
final Dio _dio;
const AccountsApi(this._dio);
/// List
/// Every account, archived ones included — the client decides what to show.
///
/// 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<AccountOut>] as data
/// Throws [DioException] if API call or serialization fails
Future<Response<List<AccountOut>>> accountsList({
CancelToken? cancelToken,
Map<String, dynamic>? headers,
Map<String, dynamic>? extra,
ValidateStatus? validateStatus,
ProgressCallback? onSendProgress,
ProgressCallback? onReceiveProgress,
}) async {
final _path = r'/api/v1/accounts';
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<AccountOut>? _responseData;
try {
final rawData = _response.data;
_responseData = rawData == null ? null : deserialize<List<AccountOut>, AccountOut>(rawData, 'List<AccountOut>', growable: true);
} catch (error, stackTrace) {
throw DioException(
requestOptions: _response.requestOptions,
response: _response,
type: DioExceptionType.unknown,
error: error,
stackTrace: stackTrace,
);
}
return Response<List<AccountOut>>(
data: _responseData,
headers: _response.headers,
isRedirect: _response.isRedirect,
requestOptions: _response.requestOptions,
redirects: _response.redirects,
statusCode: _response.statusCode,
statusMessage: _response.statusMessage,
extra: _response.extra,
);
}
/// Patch
/// Update the user-owned fields. Everything else is overwritten by the next sync.
///
/// Parameters:
/// * [accountId]
/// * [accountPatch]
/// * [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 [AccountOut] as data
/// Throws [DioException] if API call or serialization fails
Future<Response<AccountOut>> accountsPatch({
required int accountId,
required AccountPatch accountPatch,
CancelToken? cancelToken,
Map<String, dynamic>? headers,
Map<String, dynamic>? extra,
ValidateStatus? validateStatus,
ProgressCallback? onSendProgress,
ProgressCallback? onReceiveProgress,
}) async {
final _path = r'/api/v1/accounts/{account_id}'.replaceAll('{' r'account_id' '}', accountId.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(accountPatch);
} 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,
);
AccountOut? _responseData;
try {
final rawData = _response.data;
_responseData = rawData == null ? null : deserialize<AccountOut, AccountOut>(rawData, 'AccountOut', growable: true);
} catch (error, stackTrace) {
throw DioException(
requestOptions: _response.requestOptions,
response: _response,
type: DioExceptionType.unknown,
error: error,
stackTrace: stackTrace,
);
}
return Response<AccountOut>(
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,348 @@
//
// 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/login_request.dart';
import 'package:fintracker_api/src/model/problem.dart';
import 'package:fintracker_api/src/model/refresh_request.dart';
import 'package:fintracker_api/src/model/token_pair.dart';
import 'package:fintracker_api/src/model/user_out.dart';
class AuthApi {
final Dio _dio;
const AuthApi(this._dio);
/// Login
///
///
/// Parameters:
/// * [loginRequest]
/// * [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 [TokenPair] as data
/// Throws [DioException] if API call or serialization fails
Future<Response<TokenPair>> authLogin({
required LoginRequest loginRequest,
CancelToken? cancelToken,
Map<String, dynamic>? headers,
Map<String, dynamic>? extra,
ValidateStatus? validateStatus,
ProgressCallback? onSendProgress,
ProgressCallback? onReceiveProgress,
}) async {
final _path = r'/api/v1/auth/login';
final _options = Options(
method: r'POST',
headers: <String, dynamic>{
...?headers,
},
extra: <String, dynamic>{
'secure': <Map<String, String>>[],
...?extra,
},
contentType: 'application/json',
validateStatus: validateStatus,
);
dynamic _bodyData;
try {
_bodyData = jsonEncode(loginRequest);
} 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,
);
TokenPair? _responseData;
try {
final rawData = _response.data;
_responseData = rawData == null ? null : deserialize<TokenPair, TokenPair>(rawData, 'TokenPair', growable: true);
} catch (error, stackTrace) {
throw DioException(
requestOptions: _response.requestOptions,
response: _response,
type: DioExceptionType.unknown,
error: error,
stackTrace: stackTrace,
);
}
return Response<TokenPair>(
data: _responseData,
headers: _response.headers,
isRedirect: _response.isRedirect,
requestOptions: _response.requestOptions,
redirects: _response.redirects,
statusCode: _response.statusCode,
statusMessage: _response.statusMessage,
extra: _response.extra,
);
}
/// Logout
///
///
/// Parameters:
/// * [refreshRequest]
/// * [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>> authLogout({
required RefreshRequest refreshRequest,
CancelToken? cancelToken,
Map<String, dynamic>? headers,
Map<String, dynamic>? extra,
ValidateStatus? validateStatus,
ProgressCallback? onSendProgress,
ProgressCallback? onReceiveProgress,
}) async {
final _path = r'/api/v1/auth/logout';
final _options = Options(
method: r'POST',
headers: <String, dynamic>{
...?headers,
},
extra: <String, dynamic>{
'secure': <Map<String, String>>[],
...?extra,
},
contentType: 'application/json',
validateStatus: validateStatus,
);
dynamic _bodyData;
try {
_bodyData = jsonEncode(refreshRequest);
} 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,
);
return _response;
}
/// Me
///
///
/// 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 [UserOut] as data
/// Throws [DioException] if API call or serialization fails
Future<Response<UserOut>> authMe({
CancelToken? cancelToken,
Map<String, dynamic>? headers,
Map<String, dynamic>? extra,
ValidateStatus? validateStatus,
ProgressCallback? onSendProgress,
ProgressCallback? onReceiveProgress,
}) async {
final _path = r'/api/v1/auth/me';
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,
);
UserOut? _responseData;
try {
final rawData = _response.data;
_responseData = rawData == null ? null : deserialize<UserOut, UserOut>(rawData, 'UserOut', growable: true);
} catch (error, stackTrace) {
throw DioException(
requestOptions: _response.requestOptions,
response: _response,
type: DioExceptionType.unknown,
error: error,
stackTrace: stackTrace,
);
}
return Response<UserOut>(
data: _responseData,
headers: _response.headers,
isRedirect: _response.isRedirect,
requestOptions: _response.requestOptions,
redirects: _response.redirects,
statusCode: _response.statusCode,
statusMessage: _response.statusMessage,
extra: _response.extra,
);
}
/// Refresh
///
///
/// Parameters:
/// * [refreshRequest]
/// * [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 [TokenPair] as data
/// Throws [DioException] if API call or serialization fails
Future<Response<TokenPair>> authRefresh({
required RefreshRequest refreshRequest,
CancelToken? cancelToken,
Map<String, dynamic>? headers,
Map<String, dynamic>? extra,
ValidateStatus? validateStatus,
ProgressCallback? onSendProgress,
ProgressCallback? onReceiveProgress,
}) async {
final _path = r'/api/v1/auth/refresh';
final _options = Options(
method: r'POST',
headers: <String, dynamic>{
...?headers,
},
extra: <String, dynamic>{
'secure': <Map<String, String>>[],
...?extra,
},
contentType: 'application/json',
validateStatus: validateStatus,
);
dynamic _bodyData;
try {
_bodyData = jsonEncode(refreshRequest);
} 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,
);
TokenPair? _responseData;
try {
final rawData = _response.data;
_responseData = rawData == null ? null : deserialize<TokenPair, TokenPair>(rawData, 'TokenPair', growable: true);
} catch (error, stackTrace) {
throw DioException(
requestOptions: _response.requestOptions,
response: _response,
type: DioExceptionType.unknown,
error: error,
stackTrace: stackTrace,
);
}
return Response<TokenPair>(
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,265 @@
//
// 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_flow_month.dart';
import 'package:fintracker_api/src/model/problem.dart';
import 'package:fintracker_api/src/model/runway_out.dart';
import 'package:fintracker_api/src/model/spending_row.dart';
class CashflowApi {
final Dio _dio;
const CashflowApi(this._dio);
/// Monthly
/// The last &#x60;months&#x60; months, oldest first.
///
/// Parameters:
/// * [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 [List<CashFlowMonth>] as data
/// Throws [DioException] if API call or serialization fails
Future<Response<List<CashFlowMonth>>> cashflowMonthly({
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/cashflow/monthly';
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 (months != null) r'months': months,
};
final _response = await _dio.request<Object>(
_path,
options: _options,
queryParameters: _queryParameters,
cancelToken: cancelToken,
onSendProgress: onSendProgress,
onReceiveProgress: onReceiveProgress,
);
List<CashFlowMonth>? _responseData;
try {
final rawData = _response.data;
_responseData = rawData == null ? null : deserialize<List<CashFlowMonth>, CashFlowMonth>(rawData, 'List<CashFlowMonth>', growable: true);
} catch (error, stackTrace) {
throw DioException(
requestOptions: _response.requestOptions,
response: _response,
type: DioExceptionType.unknown,
error: error,
stackTrace: stackTrace,
);
}
return Response<List<CashFlowMonth>>(
data: _responseData,
headers: _response.headers,
isRedirect: _response.isRedirect,
requestOptions: _response.requestOptions,
redirects: _response.redirects,
statusCode: _response.statusCode,
statusMessage: _response.statusMessage,
extra: _response.extra,
);
}
/// Runway
/// How many months the liquid reserve covers; null before the first refresh.
///
/// 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 [RunwayOut] as data
/// Throws [DioException] if API call or serialization fails
Future<Response<RunwayOut>> cashflowRunway({
CancelToken? cancelToken,
Map<String, dynamic>? headers,
Map<String, dynamic>? extra,
ValidateStatus? validateStatus,
ProgressCallback? onSendProgress,
ProgressCallback? onReceiveProgress,
}) async {
final _path = r'/api/v1/runway';
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,
);
RunwayOut? _responseData;
try {
final rawData = _response.data;
_responseData = rawData == null ? null : deserialize<RunwayOut, RunwayOut>(rawData, 'RunwayOut', growable: true);
} catch (error, stackTrace) {
throw DioException(
requestOptions: _response.requestOptions,
response: _response,
type: DioExceptionType.unknown,
error: error,
stackTrace: stackTrace,
);
}
return Response<RunwayOut>(
data: _responseData,
headers: _response.headers,
isRedirect: _response.isRedirect,
requestOptions: _response.requestOptions,
redirects: _response.redirects,
statusCode: _response.statusCode,
statusMessage: _response.statusMessage,
extra: _response.extra,
);
}
/// Spending
/// Expenses of one month by category, largest first.
///
/// Parameters:
/// * [month] - YYYY-MM; defaults to the latest month
/// * [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<SpendingRow>] as data
/// Throws [DioException] if API call or serialization fails
Future<Response<List<SpendingRow>>> cashflowSpending({
String? month,
CancelToken? cancelToken,
Map<String, dynamic>? headers,
Map<String, dynamic>? extra,
ValidateStatus? validateStatus,
ProgressCallback? onSendProgress,
ProgressCallback? onReceiveProgress,
}) async {
final _path = r'/api/v1/spending/categories';
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 (month != null) r'month': month,
};
final _response = await _dio.request<Object>(
_path,
options: _options,
queryParameters: _queryParameters,
cancelToken: cancelToken,
onSendProgress: onSendProgress,
onReceiveProgress: onReceiveProgress,
);
List<SpendingRow>? _responseData;
try {
final rawData = _response.data;
_responseData = rawData == null ? null : deserialize<List<SpendingRow>, SpendingRow>(rawData, 'List<SpendingRow>', growable: true);
} catch (error, stackTrace) {
throw DioException(
requestOptions: _response.requestOptions,
response: _response,
type: DioExceptionType.unknown,
error: error,
stackTrace: stackTrace,
);
}
return Response<List<SpendingRow>>(
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,97 @@
//
// 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/category_out.dart';
import 'package:fintracker_api/src/model/problem.dart';
class CategoriesApi {
final Dio _dio;
const CategoriesApi(this._dio);
/// List
/// Flat list of the ZenMoney tag tree; the client nests it by &#x60;parent_id&#x60;.
///
/// 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<CategoryOut>] as data
/// Throws [DioException] if API call or serialization fails
Future<Response<List<CategoryOut>>> categoriesList({
CancelToken? cancelToken,
Map<String, dynamic>? headers,
Map<String, dynamic>? extra,
ValidateStatus? validateStatus,
ProgressCallback? onSendProgress,
ProgressCallback? onReceiveProgress,
}) async {
final _path = r'/api/v1/categories';
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<CategoryOut>? _responseData;
try {
final rawData = _response.data;
_responseData = rawData == null ? null : deserialize<List<CategoryOut>, CategoryOut>(rawData, 'List<CategoryOut>', growable: true);
} catch (error, stackTrace) {
throw DioException(
requestOptions: _response.requestOptions,
response: _response,
type: DioExceptionType.unknown,
error: error,
stackTrace: stackTrace,
);
}
return Response<List<CategoryOut>>(
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,91 @@
//
// 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/health.dart';
import 'package:fintracker_api/src/model/problem.dart';
class HealthApi {
final Dio _dio;
const HealthApi(this._dio);
/// Check
///
///
/// 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 [Health] as data
/// Throws [DioException] if API call or serialization fails
Future<Response<Health>> healthCheck({
CancelToken? cancelToken,
Map<String, dynamic>? headers,
Map<String, dynamic>? extra,
ValidateStatus? validateStatus,
ProgressCallback? onSendProgress,
ProgressCallback? onReceiveProgress,
}) async {
final _path = r'/api/v1/health';
final _options = Options(
method: r'GET',
headers: <String, dynamic>{
...?headers,
},
extra: <String, dynamic>{
'secure': <Map<String, String>>[],
...?extra,
},
validateStatus: validateStatus,
);
final _response = await _dio.request<Object>(
_path,
options: _options,
cancelToken: cancelToken,
onSendProgress: onSendProgress,
onReceiveProgress: onReceiveProgress,
);
Health? _responseData;
try {
final rawData = _response.data;
_responseData = rawData == null ? null : deserialize<Health, Health>(rawData, 'Health', growable: true);
} catch (error, stackTrace) {
throw DioException(
requestOptions: _response.requestOptions,
response: _response,
type: DioExceptionType.unknown,
error: error,
stackTrace: stackTrace,
);
}
return Response<Health>(
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,250 @@
//
// 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/data_quality_row.dart';
import 'package:fintracker_api/src/model/problem.dart';
import 'package:fintracker_api/src/model/refresh_log_out.dart';
class MetricsApi {
final Dio _dio;
const MetricsApi(this._dio);
/// Data Quality
/// Findings of the latest refresh, most serious first.
///
/// 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<DataQualityRow>] as data
/// Throws [DioException] if API call or serialization fails
Future<Response<List<DataQualityRow>>> metricsDataQuality({
CancelToken? cancelToken,
Map<String, dynamic>? headers,
Map<String, dynamic>? extra,
ValidateStatus? validateStatus,
ProgressCallback? onSendProgress,
ProgressCallback? onReceiveProgress,
}) async {
final _path = r'/api/v1/data-quality';
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<DataQualityRow>? _responseData;
try {
final rawData = _response.data;
_responseData = rawData == null ? null : deserialize<List<DataQualityRow>, DataQualityRow>(rawData, 'List<DataQualityRow>', growable: true);
} catch (error, stackTrace) {
throw DioException(
requestOptions: _response.requestOptions,
response: _response,
type: DioExceptionType.unknown,
error: error,
stackTrace: stackTrace,
);
}
return Response<List<DataQualityRow>>(
data: _responseData,
headers: _response.headers,
isRedirect: _response.isRedirect,
requestOptions: _response.requestOptions,
redirects: _response.redirects,
statusCode: _response.statusCode,
statusMessage: _response.statusMessage,
extra: _response.extra,
);
}
/// Refresh
/// Rebuild every metric_* table inline (seconds at personal volumes).
///
/// 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 [RefreshLogOut] as data
/// Throws [DioException] if API call or serialization fails
Future<Response<RefreshLogOut>> metricsRefresh({
CancelToken? cancelToken,
Map<String, dynamic>? headers,
Map<String, dynamic>? extra,
ValidateStatus? validateStatus,
ProgressCallback? onSendProgress,
ProgressCallback? onReceiveProgress,
}) async {
final _path = r'/api/v1/metrics/refresh';
final _options = Options(
method: r'POST',
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,
);
RefreshLogOut? _responseData;
try {
final rawData = _response.data;
_responseData = rawData == null ? null : deserialize<RefreshLogOut, RefreshLogOut>(rawData, 'RefreshLogOut', growable: true);
} catch (error, stackTrace) {
throw DioException(
requestOptions: _response.requestOptions,
response: _response,
type: DioExceptionType.unknown,
error: error,
stackTrace: stackTrace,
);
}
return Response<RefreshLogOut>(
data: _responseData,
headers: _response.headers,
isRedirect: _response.isRedirect,
requestOptions: _response.requestOptions,
redirects: _response.redirects,
statusCode: _response.statusCode,
statusMessage: _response.statusMessage,
extra: _response.extra,
);
}
/// Status
/// When the metric tables were last rebuilt, and whether it failed.
///
/// 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 [RefreshLogOut] as data
/// Throws [DioException] if API call or serialization fails
Future<Response<RefreshLogOut>> metricsStatus({
CancelToken? cancelToken,
Map<String, dynamic>? headers,
Map<String, dynamic>? extra,
ValidateStatus? validateStatus,
ProgressCallback? onSendProgress,
ProgressCallback? onReceiveProgress,
}) async {
final _path = r'/api/v1/metrics/status';
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,
);
RefreshLogOut? _responseData;
try {
final rawData = _response.data;
_responseData = rawData == null ? null : deserialize<RefreshLogOut, RefreshLogOut>(rawData, 'RefreshLogOut', growable: true);
} catch (error, stackTrace) {
throw DioException(
requestOptions: _response.requestOptions,
response: _response,
type: DioExceptionType.unknown,
error: error,
stackTrace: stackTrace,
);
}
return Response<RefreshLogOut>(
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,184 @@
//
// 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/net_worth_breakdown.dart';
import 'package:fintracker_api/src/model/net_worth_day.dart';
import 'package:fintracker_api/src/model/problem.dart';
class NetworthApi {
final Dio _dio;
const NetworthApi(this._dio);
/// Breakdown
/// The latest day&#39;s buckets, plus every account&#39;s current balance native and in RUB.
///
/// 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 [NetWorthBreakdown] as data
/// Throws [DioException] if API call or serialization fails
Future<Response<NetWorthBreakdown>> networthBreakdown({
CancelToken? cancelToken,
Map<String, dynamic>? headers,
Map<String, dynamic>? extra,
ValidateStatus? validateStatus,
ProgressCallback? onSendProgress,
ProgressCallback? onReceiveProgress,
}) async {
final _path = r'/api/v1/networth/breakdown';
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,
);
NetWorthBreakdown? _responseData;
try {
final rawData = _response.data;
_responseData = rawData == null ? null : deserialize<NetWorthBreakdown, NetWorthBreakdown>(rawData, 'NetWorthBreakdown', growable: true);
} catch (error, stackTrace) {
throw DioException(
requestOptions: _response.requestOptions,
response: _response,
type: DioExceptionType.unknown,
error: error,
stackTrace: stackTrace,
);
}
return Response<NetWorthBreakdown>(
data: _responseData,
headers: _response.headers,
isRedirect: _response.isRedirect,
requestOptions: _response.requestOptions,
redirects: _response.redirects,
statusCode: _response.statusCode,
statusMessage: _response.statusMessage,
extra: _response.extra,
);
}
/// Series
/// Daily net worth; defaults to the last 365 days.
///
/// Parameters:
/// * [from]
/// * [to]
/// * [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<NetWorthDay>] as data
/// Throws [DioException] if API call or serialization fails
Future<Response<List<NetWorthDay>>> networthSeries({
DateTime? from,
DateTime? to,
CancelToken? cancelToken,
Map<String, dynamic>? headers,
Map<String, dynamic>? extra,
ValidateStatus? validateStatus,
ProgressCallback? onSendProgress,
ProgressCallback? onReceiveProgress,
}) async {
final _path = r'/api/v1/networth/series';
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 (from != null) r'from': from,
if (to != null) r'to': to,
};
final _response = await _dio.request<Object>(
_path,
options: _options,
queryParameters: _queryParameters,
cancelToken: cancelToken,
onSendProgress: onSendProgress,
onReceiveProgress: onReceiveProgress,
);
List<NetWorthDay>? _responseData;
try {
final rawData = _response.data;
_responseData = rawData == null ? null : deserialize<List<NetWorthDay>, NetWorthDay>(rawData, 'List<NetWorthDay>', growable: true);
} catch (error, stackTrace) {
throw DioException(
requestOptions: _response.requestOptions,
response: _response,
type: DioExceptionType.unknown,
error: error,
stackTrace: stackTrace,
);
}
return Response<List<NetWorthDay>>(
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,501 @@
//
// 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/refresh_log_out.dart';
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';
class RulesApi {
final Dio _dio;
const RulesApi(this._dio);
/// Apply
/// Re-run the whole metric refresh so edited rules take effect everywhere at once.
///
/// 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 [RefreshLogOut] as data
/// Throws [DioException] if API call or serialization fails
Future<Response<RefreshLogOut>> rulesApply({
CancelToken? cancelToken,
Map<String, dynamic>? headers,
Map<String, dynamic>? extra,
ValidateStatus? validateStatus,
ProgressCallback? onSendProgress,
ProgressCallback? onReceiveProgress,
}) async {
final _path = r'/api/v1/rules/apply';
final _options = Options(
method: r'POST',
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,
);
RefreshLogOut? _responseData;
try {
final rawData = _response.data;
_responseData = rawData == null ? null : deserialize<RefreshLogOut, RefreshLogOut>(rawData, 'RefreshLogOut', growable: true);
} catch (error, stackTrace) {
throw DioException(
requestOptions: _response.requestOptions,
response: _response,
type: DioExceptionType.unknown,
error: error,
stackTrace: stackTrace,
);
}
return Response<RefreshLogOut>(
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:
/// * [ruleCreate]
/// * [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 [RuleOut] as data
/// Throws [DioException] if API call or serialization fails
Future<Response<RuleOut>> rulesCreate({
required RuleCreate ruleCreate,
CancelToken? cancelToken,
Map<String, dynamic>? headers,
Map<String, dynamic>? extra,
ValidateStatus? validateStatus,
ProgressCallback? onSendProgress,
ProgressCallback? onReceiveProgress,
}) async {
final _path = r'/api/v1/rules';
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(ruleCreate);
} 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,
);
RuleOut? _responseData;
try {
final rawData = _response.data;
_responseData = rawData == null ? null : deserialize<RuleOut, RuleOut>(rawData, 'RuleOut', growable: true);
} catch (error, stackTrace) {
throw DioException(
requestOptions: _response.requestOptions,
response: _response,
type: DioExceptionType.unknown,
error: error,
stackTrace: stackTrace,
);
}
return Response<RuleOut>(
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:
/// * [ruleId]
/// * [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>> rulesDelete({
required int ruleId,
CancelToken? cancelToken,
Map<String, dynamic>? headers,
Map<String, dynamic>? extra,
ValidateStatus? validateStatus,
ProgressCallback? onSendProgress,
ProgressCallback? onReceiveProgress,
}) async {
final _path = r'/api/v1/rules/{rule_id}'.replaceAll('{' r'rule_id' '}', ruleId.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:
/// * [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<RuleOut>] as data
/// Throws [DioException] if API call or serialization fails
Future<Response<List<RuleOut>>> rulesList({
CancelToken? cancelToken,
Map<String, dynamic>? headers,
Map<String, dynamic>? extra,
ValidateStatus? validateStatus,
ProgressCallback? onSendProgress,
ProgressCallback? onReceiveProgress,
}) async {
final _path = r'/api/v1/rules';
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<RuleOut>? _responseData;
try {
final rawData = _response.data;
_responseData = rawData == null ? null : deserialize<List<RuleOut>, RuleOut>(rawData, 'List<RuleOut>', growable: true);
} catch (error, stackTrace) {
throw DioException(
requestOptions: _response.requestOptions,
response: _response,
type: DioExceptionType.unknown,
error: error,
stackTrace: stackTrace,
);
}
return Response<List<RuleOut>>(
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:
/// * [ruleId]
/// * [rulePatch]
/// * [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 [RuleOut] as data
/// Throws [DioException] if API call or serialization fails
Future<Response<RuleOut>> rulesPatch({
required int ruleId,
required RulePatch rulePatch,
CancelToken? cancelToken,
Map<String, dynamic>? headers,
Map<String, dynamic>? extra,
ValidateStatus? validateStatus,
ProgressCallback? onSendProgress,
ProgressCallback? onReceiveProgress,
}) async {
final _path = r'/api/v1/rules/{rule_id}'.replaceAll('{' r'rule_id' '}', ruleId.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(rulePatch);
} 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,
);
RuleOut? _responseData;
try {
final rawData = _response.data;
_responseData = rawData == null ? null : deserialize<RuleOut, RuleOut>(rawData, 'RuleOut', growable: true);
} catch (error, stackTrace) {
throw DioException(
requestOptions: _response.requestOptions,
response: _response,
type: DioExceptionType.unknown,
error: error,
stackTrace: stackTrace,
);
}
return Response<RuleOut>(
data: _responseData,
headers: _response.headers,
isRedirect: _response.isRedirect,
requestOptions: _response.requestOptions,
redirects: _response.redirects,
statusCode: _response.statusCode,
statusMessage: _response.statusMessage,
extra: _response.extra,
);
}
/// Stale
/// Enabled rules that matched nothing in the latest refresh: the payee was renamed, or the transaction was re-categorised in ZenMoney.
///
/// 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<RuleOut>] as data
/// Throws [DioException] if API call or serialization fails
Future<Response<List<RuleOut>>> rulesStale({
CancelToken? cancelToken,
Map<String, dynamic>? headers,
Map<String, dynamic>? extra,
ValidateStatus? validateStatus,
ProgressCallback? onSendProgress,
ProgressCallback? onReceiveProgress,
}) async {
final _path = r'/api/v1/rules/stale';
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<RuleOut>? _responseData;
try {
final rawData = _response.data;
_responseData = rawData == null ? null : deserialize<List<RuleOut>, RuleOut>(rawData, 'List<RuleOut>', growable: true);
} catch (error, stackTrace) {
throw DioException(
requestOptions: _response.requestOptions,
response: _response,
type: DioExceptionType.unknown,
error: error,
stackTrace: stackTrace,
);
}
return Response<List<RuleOut>>(
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,263 @@
//
// 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/source_status.dart';
import 'package:fintracker_api/src/model/sync_job_out.dart';
import 'package:fintracker_api/src/model/sync_run_out.dart';
class SyncApi {
final Dio _dio;
const SyncApi(this._dio);
/// Runs
///
///
/// Parameters:
/// * [source_]
/// * [limit]
/// * [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<SyncRunOut>] as data
/// Throws [DioException] if API call or serialization fails
Future<Response<List<SyncRunOut>>> syncRuns({
String? source_,
int? limit = 20,
CancelToken? cancelToken,
Map<String, dynamic>? headers,
Map<String, dynamic>? extra,
ValidateStatus? validateStatus,
ProgressCallback? onSendProgress,
ProgressCallback? onReceiveProgress,
}) async {
final _path = r'/api/v1/sync/runs';
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 (source_ != null) r'source': source_,
if (limit != null) r'limit': limit,
};
final _response = await _dio.request<Object>(
_path,
options: _options,
queryParameters: _queryParameters,
cancelToken: cancelToken,
onSendProgress: onSendProgress,
onReceiveProgress: onReceiveProgress,
);
List<SyncRunOut>? _responseData;
try {
final rawData = _response.data;
_responseData = rawData == null ? null : deserialize<List<SyncRunOut>, SyncRunOut>(rawData, 'List<SyncRunOut>', growable: true);
} catch (error, stackTrace) {
throw DioException(
requestOptions: _response.requestOptions,
response: _response,
type: DioExceptionType.unknown,
error: error,
stackTrace: stackTrace,
);
}
return Response<List<SyncRunOut>>(
data: _responseData,
headers: _response.headers,
isRedirect: _response.isRedirect,
requestOptions: _response.requestOptions,
redirects: _response.redirects,
statusCode: _response.statusCode,
statusMessage: _response.statusMessage,
extra: _response.extra,
);
}
/// Status
///
///
/// 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<SourceStatus>] as data
/// Throws [DioException] if API call or serialization fails
Future<Response<List<SourceStatus>>> syncStatus({
CancelToken? cancelToken,
Map<String, dynamic>? headers,
Map<String, dynamic>? extra,
ValidateStatus? validateStatus,
ProgressCallback? onSendProgress,
ProgressCallback? onReceiveProgress,
}) async {
final _path = r'/api/v1/sync/status';
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<SourceStatus>? _responseData;
try {
final rawData = _response.data;
_responseData = rawData == null ? null : deserialize<List<SourceStatus>, SourceStatus>(rawData, 'List<SourceStatus>', growable: true);
} catch (error, stackTrace) {
throw DioException(
requestOptions: _response.requestOptions,
response: _response,
type: DioExceptionType.unknown,
error: error,
stackTrace: stackTrace,
);
}
return Response<List<SourceStatus>>(
data: _responseData,
headers: _response.headers,
isRedirect: _response.isRedirect,
requestOptions: _response.requestOptions,
redirects: _response.redirects,
statusCode: _response.statusCode,
statusMessage: _response.statusMessage,
extra: _response.extra,
);
}
/// Trigger
///
///
/// Parameters:
/// * [source_]
/// * [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 [SyncJobOut] as data
/// Throws [DioException] if API call or serialization fails
Future<Response<SyncJobOut>> syncTrigger({
required String source_,
CancelToken? cancelToken,
Map<String, dynamic>? headers,
Map<String, dynamic>? extra,
ValidateStatus? validateStatus,
ProgressCallback? onSendProgress,
ProgressCallback? onReceiveProgress,
}) async {
final _path = r'/api/v1/sync/{source}'.replaceAll('{' r'source' '}', source_.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,
},
validateStatus: validateStatus,
);
final _response = await _dio.request<Object>(
_path,
options: _options,
cancelToken: cancelToken,
onSendProgress: onSendProgress,
onReceiveProgress: onReceiveProgress,
);
SyncJobOut? _responseData;
try {
final rawData = _response.data;
_responseData = rawData == null ? null : deserialize<SyncJobOut, SyncJobOut>(rawData, 'SyncJobOut', growable: true);
} catch (error, stackTrace) {
throw DioException(
requestOptions: _response.requestOptions,
response: _response,
type: DioExceptionType.unknown,
error: error,
stackTrace: stackTrace,
);
}
return Response<SyncJobOut>(
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,129 @@
//
// 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/flow_type.dart';
import 'package:fintracker_api/src/model/problem.dart';
import 'package:fintracker_api/src/model/transaction_page.dart';
class TransactionsApi {
final Dio _dio;
const TransactionsApi(this._dio);
/// List
/// One page of transactions, newest first, with RUB amounts at each own date&#39;s rate.
///
/// Parameters:
/// * [from]
/// * [to]
/// * [accountId]
/// * [categoryId]
/// * [flowType]
/// * [q] - substring of payee or comment
/// * [includeDeleted]
/// * [page]
/// * [pageSize]
/// * [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 [TransactionPage] as data
/// Throws [DioException] if API call or serialization fails
Future<Response<TransactionPage>> transactionsList({
DateTime? from,
DateTime? to,
int? accountId,
int? categoryId,
FlowType? flowType,
String? q,
bool? includeDeleted = false,
int? page = 1,
int? pageSize = 50,
CancelToken? cancelToken,
Map<String, dynamic>? headers,
Map<String, dynamic>? extra,
ValidateStatus? validateStatus,
ProgressCallback? onSendProgress,
ProgressCallback? onReceiveProgress,
}) async {
final _path = r'/api/v1/transactions';
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 (from != null) r'from': from,
if (to != null) r'to': to,
if (accountId != null) r'account_id': accountId,
if (categoryId != null) r'category_id': categoryId,
if (flowType != null) r'flow_type': flowType,
if (q != null) r'q': q,
if (includeDeleted != null) r'include_deleted': includeDeleted,
if (page != null) r'page': page,
if (pageSize != null) r'page_size': pageSize,
};
final _response = await _dio.request<Object>(
_path,
options: _options,
queryParameters: _queryParameters,
cancelToken: cancelToken,
onSendProgress: onSendProgress,
onReceiveProgress: onReceiveProgress,
);
TransactionPage? _responseData;
try {
final rawData = _response.data;
_responseData = rawData == null ? null : deserialize<TransactionPage, TransactionPage>(rawData, 'TransactionPage', growable: true);
} catch (error, stackTrace) {
throw DioException(
requestOptions: _response.requestOptions,
response: _response,
type: DioExceptionType.unknown,
error: error,
stackTrace: stackTrace,
);
}
return Response<TransactionPage>(
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,30 @@
//
// AUTO-GENERATED FILE, DO NOT MODIFY!
//
import 'package:dio/dio.dart';
import 'package:fintracker_api/src/auth/auth.dart';
class ApiKeyAuthInterceptor extends AuthInterceptor {
final Map<String, String> apiKeys = {};
@override
void onRequest(RequestOptions options, RequestInterceptorHandler handler) {
final authInfo = getAuthInfo(options, (secure) => secure['type'] == 'apiKey');
for (final info in authInfo) {
final authName = info['name'] as String;
final authKeyName = info['keyName'] as String;
final authWhere = info['where'] as String;
final apiKey = apiKeys[authName];
if (apiKey != null) {
if (authWhere == 'query') {
options.queryParameters[authKeyName] = apiKey;
} else {
options.headers[authKeyName] = apiKey;
}
}
}
super.onRequest(options, handler);
}
}
@@ -0,0 +1,18 @@
//
// AUTO-GENERATED FILE, DO NOT MODIFY!
//
import 'package:dio/dio.dart';
abstract class AuthInterceptor extends Interceptor {
/// Get auth information on given route for the given type.
/// Can return an empty list if type is not present on auth data or
/// if route doesn't need authentication.
List<Map<String, String>> getAuthInfo(RequestOptions route, bool Function(Map<String, String> secure) handles) {
if (route.extra.containsKey('secure')) {
final auth = route.extra['secure'] as List<Map<String, String>>;
return auth.where((secure) => handles(secure)).toList();
}
return [];
}
}
@@ -0,0 +1,37 @@
//
// AUTO-GENERATED FILE, DO NOT MODIFY!
//
import 'dart:convert';
import 'package:dio/dio.dart';
import 'package:fintracker_api/src/auth/auth.dart';
class BasicAuthInfo {
final String username;
final String password;
const BasicAuthInfo(this.username, this.password);
}
class BasicAuthInterceptor extends AuthInterceptor {
final Map<String, BasicAuthInfo> authInfo = {};
@override
void onRequest(
RequestOptions options,
RequestInterceptorHandler handler,
) {
final metadataAuthInfo = getAuthInfo(options, (secure) => (secure['type'] == 'http' && secure['scheme']?.toLowerCase() == 'basic') || secure['type'] == 'basic');
for (final info in metadataAuthInfo) {
final authName = info['name'] as String;
final basicAuthInfo = authInfo[authName];
if (basicAuthInfo != null) {
final basicAuth = 'Basic ${base64Encode(utf8.encode('${basicAuthInfo.username}:${basicAuthInfo.password}'))}';
options.headers['Authorization'] = basicAuth;
break;
}
}
super.onRequest(options, handler);
}
}
@@ -0,0 +1,26 @@
//
// AUTO-GENERATED FILE, DO NOT MODIFY!
//
import 'package:dio/dio.dart';
import 'package:fintracker_api/src/auth/auth.dart';
class BearerAuthInterceptor extends AuthInterceptor {
final Map<String, String> tokens = {};
@override
void onRequest(
RequestOptions options,
RequestInterceptorHandler handler,
) {
final authInfo = getAuthInfo(options, (secure) => secure['type'] == 'http' && secure['scheme']?.toLowerCase() == 'bearer');
for (final info in authInfo) {
final token = tokens[info['name']];
if (token != null) {
options.headers['Authorization'] = 'Bearer ${token}';
break;
}
}
super.onRequest(options, handler);
}
}
@@ -0,0 +1,26 @@
//
// AUTO-GENERATED FILE, DO NOT MODIFY!
//
import 'package:dio/dio.dart';
import 'package:fintracker_api/src/auth/auth.dart';
class OAuthInterceptor extends AuthInterceptor {
final Map<String, String> tokens = {};
@override
void onRequest(
RequestOptions options,
RequestInterceptorHandler handler,
) {
final authInfo = getAuthInfo(options, (secure) => secure['type'] == 'oauth' || secure['type'] == 'oauth2');
for (final info in authInfo) {
final token = tokens[info['name']];
if (token != null) {
options.headers['Authorization'] = 'Bearer ${token}';
break;
}
}
super.onRequest(options, handler);
}
}
@@ -0,0 +1,147 @@
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/cash_flow_month.dart';
import 'package:fintracker_api/src/model/category_out.dart';
import 'package:fintracker_api/src/model/data_quality_row.dart';
import 'package:fintracker_api/src/model/health.dart';
import 'package:fintracker_api/src/model/login_request.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/problem.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/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/source_status.dart';
import 'package:fintracker_api/src/model/spending_row.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/token_pair.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/user_out.dart';
final _regList = RegExp(r'^List<(.*)>$');
final _regSet = RegExp(r'^Set<(.*)>$');
final _regMap = RegExp(r'^Map<String,(.*)>$');
ReturnType deserialize<ReturnType, BaseType>(dynamic value, String targetType, {bool growable= true}) {
switch (targetType) {
case 'String':
return '$value' as ReturnType;
case 'int':
return (value is int ? value : int.parse('$value')) as ReturnType;
case 'bool':
if (value is bool) {
return value as ReturnType;
}
final valueString = '$value'.toLowerCase();
return (valueString == 'true' || valueString == '1') as ReturnType;
case 'double':
return (value is double ? value : double.parse('$value')) as ReturnType;
case 'AccountBalance':
return AccountBalance.fromJson(value as Map<String, dynamic>) as ReturnType;
case 'AccountKind':
case 'AccountOut':
return AccountOut.fromJson(value as Map<String, dynamic>) as ReturnType;
case 'AccountPatch':
return AccountPatch.fromJson(value as Map<String, dynamic>) as ReturnType;
case 'AccountRole':
case 'Broker':
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 'DataQualityRow':
return DataQualityRow.fromJson(value as Map<String, dynamic>) as ReturnType;
case 'EventSource':
case 'FlowType':
case 'Health':
return Health.fromJson(value as Map<String, dynamic>) as ReturnType;
case 'JobStatus':
case 'LoginRequest':
return LoginRequest.fromJson(value as Map<String, dynamic>) as ReturnType;
case 'NetWorthBreakdown':
return NetWorthBreakdown.fromJson(value as Map<String, dynamic>) as ReturnType;
case 'NetWorthDay':
return NetWorthDay.fromJson(value as Map<String, dynamic>) as ReturnType;
case 'Problem':
return Problem.fromJson(value as Map<String, dynamic>) as ReturnType;
case 'RefreshLogOut':
return RefreshLogOut.fromJson(value as Map<String, dynamic>) as ReturnType;
case 'RefreshRequest':
return RefreshRequest.fromJson(value as Map<String, dynamic>) as ReturnType;
case 'RuleCreate':
return RuleCreate.fromJson(value as Map<String, dynamic>) as ReturnType;
case 'RuleKind':
case 'RuleMatchType':
case 'RuleOut':
return RuleOut.fromJson(value as Map<String, dynamic>) as ReturnType;
case 'RulePatch':
return RulePatch.fromJson(value as Map<String, dynamic>) as ReturnType;
case 'RunStatus':
case 'RunwayOut':
return RunwayOut.fromJson(value as Map<String, dynamic>) as ReturnType;
case 'SourceStatus':
return SourceStatus.fromJson(value as Map<String, dynamic>) as ReturnType;
case 'SpendingRow':
return SpendingRow.fromJson(value as Map<String, dynamic>) as ReturnType;
case 'SyncJobOut':
return SyncJobOut.fromJson(value as Map<String, dynamic>) as ReturnType;
case 'SyncRunOut':
return SyncRunOut.fromJson(value as Map<String, dynamic>) as ReturnType;
case 'TokenPair':
return TokenPair.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 'UserOut':
return UserOut.fromJson(value as Map<String, dynamic>) as ReturnType;
default:
RegExpMatch? match;
if (value is List && (match = _regList.firstMatch(targetType)) != null) {
targetType = match![1]!; // ignore: parameter_assignments
return value
.map<BaseType>((dynamic v) => deserialize<BaseType, BaseType>(v, targetType, growable: growable))
.toList(growable: growable) as ReturnType;
}
if (value is Set && (match = _regSet.firstMatch(targetType)) != null) {
targetType = match![1]!; // ignore: parameter_assignments
return value
.map<BaseType>((dynamic v) => deserialize<BaseType, BaseType>(v, targetType, growable: growable))
.toSet() as ReturnType;
}
if (value is Map && (match = _regMap.firstMatch(targetType)) != null) {
targetType = match![1]!.trim(); // ignore: parameter_assignments
return Map<String, BaseType>.fromIterables(
value.keys as Iterable<String>,
value.values.map((dynamic v) => deserialize<BaseType, BaseType>(v, targetType, growable: growable)),
) as ReturnType;
}
break;
}
throw Exception('Cannot deserialize');
}
@@ -0,0 +1,142 @@
//
// AUTO-GENERATED FILE, DO NOT MODIFY!
//
// ignore_for_file: unused_element
import 'package:fintracker_api/src/model/account_role.dart';
import 'package:copy_with_extension/copy_with_extension.dart';
import 'package:json_annotation/json_annotation.dart';
part 'account_balance.g.dart';
@CopyWith()
@JsonSerializable(
checked: true,
createToJson: true,
disallowUnrecognizedKeys: false,
explicitToJson: true,
)
class AccountBalance {
/// Returns a new [AccountBalance] instance.
AccountBalance({
required this.accountId,
required this.balance,
required this.balanceRub,
required this.currency,
required this.name,
required this.role,
});
@JsonKey(
name: r'account_id',
required: true,
includeIfNull: false,
)
final int accountId;
/// decimal as string
@JsonKey(
name: r'balance',
required: true,
includeIfNull: false,
)
final String balance;
/// decimal as string
@JsonKey(
name: r'balance_rub',
required: true,
includeIfNull: true,
)
final String? balanceRub;
@JsonKey(
name: r'currency',
required: true,
includeIfNull: false,
)
final String currency;
@JsonKey(
name: r'name',
required: true,
includeIfNull: false,
)
final String name;
@JsonKey(
name: r'role',
required: true,
includeIfNull: false,
unknownEnumValue: AccountRole.unknownDefaultOpenApi,
)
final AccountRole role;
@override
bool operator ==(Object other) => identical(this, other) || other is AccountBalance &&
other.accountId == accountId &&
other.balance == balance &&
other.balanceRub == balanceRub &&
other.currency == currency &&
other.name == name &&
other.role == role;
@override
int get hashCode =>
accountId.hashCode +
balance.hashCode +
(balanceRub == null ? 0 : balanceRub.hashCode) +
currency.hashCode +
name.hashCode +
role.hashCode;
factory AccountBalance.fromJson(Map<String, dynamic> json) => _$AccountBalanceFromJson(json);
Map<String, dynamic> toJson() => _$AccountBalanceToJson(this);
@override
String toString() {
return toJson().toString();
}
}
@@ -0,0 +1,171 @@
// GENERATED CODE - DO NOT MODIFY BY HAND
part of 'account_balance.dart';
// **************************************************************************
// CopyWithGenerator
// **************************************************************************
abstract class _$AccountBalanceCWProxy {
AccountBalance accountId(int accountId);
AccountBalance balance(String balance);
AccountBalance balanceRub(String? balanceRub);
AccountBalance currency(String currency);
AccountBalance name(String name);
AccountBalance role(AccountRole role);
/// This function **does support** nullification of nullable fields. All `null` values passed to `non-nullable` fields will be ignored. You can also use `AccountBalance(...).copyWith.fieldName(...)` to override fields one at a time with nullification support.
///
/// Usage
/// ```dart
/// AccountBalance(...).copyWith(id: 12, name: "My name")
/// ````
AccountBalance call({
int accountId,
String balance,
String? balanceRub,
String currency,
String name,
AccountRole role,
});
}
/// Proxy class for `copyWith` functionality. This is a callable class and can be used as follows: `instanceOfAccountBalance.copyWith(...)`. Additionally contains functions for specific fields e.g. `instanceOfAccountBalance.copyWith.fieldName(...)`
class _$AccountBalanceCWProxyImpl implements _$AccountBalanceCWProxy {
const _$AccountBalanceCWProxyImpl(this._value);
final AccountBalance _value;
@override
AccountBalance accountId(int accountId) => this(accountId: accountId);
@override
AccountBalance balance(String balance) => this(balance: balance);
@override
AccountBalance balanceRub(String? balanceRub) => this(balanceRub: balanceRub);
@override
AccountBalance currency(String currency) => this(currency: currency);
@override
AccountBalance name(String name) => this(name: name);
@override
AccountBalance role(AccountRole role) => this(role: role);
@override
/// This function **does support** nullification of nullable fields. All `null` values passed to `non-nullable` fields will be ignored. You can also use `AccountBalance(...).copyWith.fieldName(...)` to override fields one at a time with nullification support.
///
/// Usage
/// ```dart
/// AccountBalance(...).copyWith(id: 12, name: "My name")
/// ````
AccountBalance call({
Object? accountId = const $CopyWithPlaceholder(),
Object? balance = const $CopyWithPlaceholder(),
Object? balanceRub = const $CopyWithPlaceholder(),
Object? currency = const $CopyWithPlaceholder(),
Object? name = const $CopyWithPlaceholder(),
Object? role = const $CopyWithPlaceholder(),
}) {
return AccountBalance(
accountId: accountId == const $CopyWithPlaceholder()
? _value.accountId
// ignore: cast_nullable_to_non_nullable
: accountId as int,
balance: balance == const $CopyWithPlaceholder()
? _value.balance
// ignore: cast_nullable_to_non_nullable
: balance as String,
balanceRub: balanceRub == const $CopyWithPlaceholder()
? _value.balanceRub
// ignore: cast_nullable_to_non_nullable
: balanceRub as String?,
currency: currency == const $CopyWithPlaceholder()
? _value.currency
// ignore: cast_nullable_to_non_nullable
: currency as String,
name: name == const $CopyWithPlaceholder()
? _value.name
// ignore: cast_nullable_to_non_nullable
: name as String,
role: role == const $CopyWithPlaceholder()
? _value.role
// ignore: cast_nullable_to_non_nullable
: role as AccountRole,
);
}
}
extension $AccountBalanceCopyWith on AccountBalance {
/// Returns a callable class that can be used as follows: `instanceOfAccountBalance.copyWith(...)` or like so:`instanceOfAccountBalance.copyWith.fieldName(...)`.
// ignore: library_private_types_in_public_api
_$AccountBalanceCWProxy get copyWith => _$AccountBalanceCWProxyImpl(this);
}
// **************************************************************************
// JsonSerializableGenerator
// **************************************************************************
AccountBalance _$AccountBalanceFromJson(Map<String, dynamic> json) =>
$checkedCreate(
'AccountBalance',
json,
($checkedConvert) {
$checkKeys(
json,
requiredKeys: const [
'account_id',
'balance',
'balance_rub',
'currency',
'name',
'role',
],
);
final val = AccountBalance(
accountId: $checkedConvert('account_id', (v) => (v as num).toInt()),
balance: $checkedConvert('balance', (v) => v as String),
balanceRub: $checkedConvert('balance_rub', (v) => v as String?),
currency: $checkedConvert('currency', (v) => v as String),
name: $checkedConvert('name', (v) => v as String),
role: $checkedConvert(
'role',
(v) => $enumDecode(
_$AccountRoleEnumMap,
v,
unknownValue: AccountRole.unknownDefaultOpenApi,
),
),
);
return val;
},
fieldKeyMap: const {
'accountId': 'account_id',
'balanceRub': 'balance_rub',
},
);
Map<String, dynamic> _$AccountBalanceToJson(AccountBalance instance) =>
<String, dynamic>{
'account_id': instance.accountId,
'balance': instance.balance,
'balance_rub': instance.balanceRub,
'currency': instance.currency,
'name': instance.name,
'role': _$AccountRoleEnumMap[instance.role]!,
};
const _$AccountRoleEnumMap = {
AccountRole.liquid: 'liquid',
AccountRole.savings: 'savings',
AccountRole.investment: 'investment',
AccountRole.debt: 'debt',
AccountRole.unknownDefaultOpenApi: 'unknown_default_open_api',
};
@@ -0,0 +1,36 @@
//
// AUTO-GENERATED FILE, DO NOT MODIFY!
//
// ignore_for_file: unused_element
import 'package:json_annotation/json_annotation.dart';
enum AccountKind {
@JsonValue(r'zm_cash')
zmCash(r'zm_cash'),
@JsonValue(r'zm_card')
zmCard(r'zm_card'),
@JsonValue(r'zm_checking')
zmChecking(r'zm_checking'),
@JsonValue(r'zm_deposit')
zmDeposit(r'zm_deposit'),
@JsonValue(r'zm_loan')
zmLoan(r'zm_loan'),
@JsonValue(r'zm_emoney')
zmEmoney(r'zm_emoney'),
@JsonValue(r'zm_debt')
zmDebt(r'zm_debt'),
@JsonValue(r'broker')
broker(r'broker'),
@JsonValue(r'manual_asset')
manualAsset(r'manual_asset'),
@JsonValue(r'unknown_default_open_api')
unknownDefaultOpenApi(r'unknown_default_open_api');
const AccountKind(this.value);
final String value;
@override
String toString() => value;
}
@@ -0,0 +1,325 @@
//
// AUTO-GENERATED FILE, DO NOT MODIFY!
//
// ignore_for_file: unused_element
import 'package:fintracker_api/src/model/event_source.dart';
import 'package:fintracker_api/src/model/account_role.dart';
import 'package:fintracker_api/src/model/account_kind.dart';
import 'package:fintracker_api/src/model/broker.dart';
import 'package:copy_with_extension/copy_with_extension.dart';
import 'package:json_annotation/json_annotation.dart';
part 'account_out.g.dart';
@CopyWith()
@JsonSerializable(
checked: true,
createToJson: true,
disallowUnrecognizedKeys: false,
explicitToJson: true,
)
class AccountOut {
/// Returns a new [AccountOut] instance.
AccountOut({
required this.archived,
required this.balance,
required this.balanceAsOf,
required this.broker,
required this.creditLimit,
required this.currency,
required this.id,
required this.includeInNetWorth,
required this.kind,
required this.mirrorOfAccountId,
required this.name,
required this.openedAt,
required this.primaryEventSource,
required this.role,
required this.source_,
required this.sourceId,
required this.startBalance,
});
@JsonKey(
name: r'archived',
required: true,
includeIfNull: false,
)
final bool archived;
/// decimal as string
@JsonKey(
name: r'balance',
required: true,
includeIfNull: true,
)
final String? balance;
@JsonKey(
name: r'balance_as_of',
required: true,
includeIfNull: true,
)
final DateTime? balanceAsOf;
@JsonKey(
name: r'broker',
required: true,
includeIfNull: true,
unknownEnumValue: Broker.unknownDefaultOpenApi,
)
final Broker? broker;
/// decimal as string
@JsonKey(
name: r'credit_limit',
required: true,
includeIfNull: true,
)
final String? creditLimit;
@JsonKey(
name: r'currency',
required: true,
includeIfNull: false,
)
final String currency;
@JsonKey(
name: r'id',
required: true,
includeIfNull: false,
)
final int id;
@JsonKey(
name: r'include_in_net_worth',
required: true,
includeIfNull: false,
)
final bool includeInNetWorth;
@JsonKey(
name: r'kind',
required: true,
includeIfNull: false,
unknownEnumValue: AccountKind.unknownDefaultOpenApi,
)
final AccountKind kind;
@JsonKey(
name: r'mirror_of_account_id',
required: true,
includeIfNull: true,
)
final int? mirrorOfAccountId;
@JsonKey(
name: r'name',
required: true,
includeIfNull: false,
)
final String name;
@JsonKey(
name: r'opened_at',
required: true,
includeIfNull: true,
)
final DateTime? openedAt;
@JsonKey(
name: r'primary_event_source',
required: true,
includeIfNull: true,
unknownEnumValue: EventSource.unknownDefaultOpenApi,
)
final EventSource? primaryEventSource;
@JsonKey(
name: r'role',
required: true,
includeIfNull: false,
unknownEnumValue: AccountRole.unknownDefaultOpenApi,
)
final AccountRole role;
@JsonKey(
name: r'source',
required: true,
includeIfNull: false,
)
final String source_;
@JsonKey(
name: r'source_id',
required: true,
includeIfNull: false,
)
final String sourceId;
/// decimal as string
@JsonKey(
name: r'start_balance',
required: true,
includeIfNull: true,
)
final String? startBalance;
@override
bool operator ==(Object other) => identical(this, other) || other is AccountOut &&
other.archived == archived &&
other.balance == balance &&
other.balanceAsOf == balanceAsOf &&
other.broker == broker &&
other.creditLimit == creditLimit &&
other.currency == currency &&
other.id == id &&
other.includeInNetWorth == includeInNetWorth &&
other.kind == kind &&
other.mirrorOfAccountId == mirrorOfAccountId &&
other.name == name &&
other.openedAt == openedAt &&
other.primaryEventSource == primaryEventSource &&
other.role == role &&
other.source_ == source_ &&
other.sourceId == sourceId &&
other.startBalance == startBalance;
@override
int get hashCode =>
archived.hashCode +
(balance == null ? 0 : balance.hashCode) +
(balanceAsOf == null ? 0 : balanceAsOf.hashCode) +
(broker == null ? 0 : broker.hashCode) +
(creditLimit == null ? 0 : creditLimit.hashCode) +
currency.hashCode +
id.hashCode +
includeInNetWorth.hashCode +
kind.hashCode +
(mirrorOfAccountId == null ? 0 : mirrorOfAccountId.hashCode) +
name.hashCode +
(openedAt == null ? 0 : openedAt.hashCode) +
(primaryEventSource == null ? 0 : primaryEventSource.hashCode) +
role.hashCode +
source_.hashCode +
sourceId.hashCode +
(startBalance == null ? 0 : startBalance.hashCode);
factory AccountOut.fromJson(Map<String, dynamic> json) => _$AccountOutFromJson(json);
Map<String, dynamic> toJson() => _$AccountOutToJson(this);
@override
String toString() {
return toJson().toString();
}
}
@@ -0,0 +1,398 @@
// GENERATED CODE - DO NOT MODIFY BY HAND
part of 'account_out.dart';
// **************************************************************************
// CopyWithGenerator
// **************************************************************************
abstract class _$AccountOutCWProxy {
AccountOut archived(bool archived);
AccountOut balance(String? balance);
AccountOut balanceAsOf(DateTime? balanceAsOf);
AccountOut broker(Broker? broker);
AccountOut creditLimit(String? creditLimit);
AccountOut currency(String currency);
AccountOut id(int id);
AccountOut includeInNetWorth(bool includeInNetWorth);
AccountOut kind(AccountKind kind);
AccountOut mirrorOfAccountId(int? mirrorOfAccountId);
AccountOut name(String name);
AccountOut openedAt(DateTime? openedAt);
AccountOut primaryEventSource(EventSource? primaryEventSource);
AccountOut role(AccountRole role);
AccountOut source_(String source_);
AccountOut sourceId(String sourceId);
AccountOut startBalance(String? startBalance);
/// This function **does support** nullification of nullable fields. All `null` values passed to `non-nullable` fields will be ignored. You can also use `AccountOut(...).copyWith.fieldName(...)` to override fields one at a time with nullification support.
///
/// Usage
/// ```dart
/// AccountOut(...).copyWith(id: 12, name: "My name")
/// ````
AccountOut call({
bool archived,
String? balance,
DateTime? balanceAsOf,
Broker? broker,
String? creditLimit,
String currency,
int id,
bool includeInNetWorth,
AccountKind kind,
int? mirrorOfAccountId,
String name,
DateTime? openedAt,
EventSource? primaryEventSource,
AccountRole role,
String source_,
String sourceId,
String? startBalance,
});
}
/// Proxy class for `copyWith` functionality. This is a callable class and can be used as follows: `instanceOfAccountOut.copyWith(...)`. Additionally contains functions for specific fields e.g. `instanceOfAccountOut.copyWith.fieldName(...)`
class _$AccountOutCWProxyImpl implements _$AccountOutCWProxy {
const _$AccountOutCWProxyImpl(this._value);
final AccountOut _value;
@override
AccountOut archived(bool archived) => this(archived: archived);
@override
AccountOut balance(String? balance) => this(balance: balance);
@override
AccountOut balanceAsOf(DateTime? balanceAsOf) =>
this(balanceAsOf: balanceAsOf);
@override
AccountOut broker(Broker? broker) => this(broker: broker);
@override
AccountOut creditLimit(String? creditLimit) => this(creditLimit: creditLimit);
@override
AccountOut currency(String currency) => this(currency: currency);
@override
AccountOut id(int id) => this(id: id);
@override
AccountOut includeInNetWorth(bool includeInNetWorth) =>
this(includeInNetWorth: includeInNetWorth);
@override
AccountOut kind(AccountKind kind) => this(kind: kind);
@override
AccountOut mirrorOfAccountId(int? mirrorOfAccountId) =>
this(mirrorOfAccountId: mirrorOfAccountId);
@override
AccountOut name(String name) => this(name: name);
@override
AccountOut openedAt(DateTime? openedAt) => this(openedAt: openedAt);
@override
AccountOut primaryEventSource(EventSource? primaryEventSource) =>
this(primaryEventSource: primaryEventSource);
@override
AccountOut role(AccountRole role) => this(role: role);
@override
AccountOut source_(String source_) => this(source_: source_);
@override
AccountOut sourceId(String sourceId) => this(sourceId: sourceId);
@override
AccountOut startBalance(String? startBalance) =>
this(startBalance: startBalance);
@override
/// This function **does support** nullification of nullable fields. All `null` values passed to `non-nullable` fields will be ignored. You can also use `AccountOut(...).copyWith.fieldName(...)` to override fields one at a time with nullification support.
///
/// Usage
/// ```dart
/// AccountOut(...).copyWith(id: 12, name: "My name")
/// ````
AccountOut call({
Object? archived = const $CopyWithPlaceholder(),
Object? balance = const $CopyWithPlaceholder(),
Object? balanceAsOf = const $CopyWithPlaceholder(),
Object? broker = const $CopyWithPlaceholder(),
Object? creditLimit = const $CopyWithPlaceholder(),
Object? currency = const $CopyWithPlaceholder(),
Object? id = const $CopyWithPlaceholder(),
Object? includeInNetWorth = const $CopyWithPlaceholder(),
Object? kind = const $CopyWithPlaceholder(),
Object? mirrorOfAccountId = const $CopyWithPlaceholder(),
Object? name = const $CopyWithPlaceholder(),
Object? openedAt = const $CopyWithPlaceholder(),
Object? primaryEventSource = const $CopyWithPlaceholder(),
Object? role = const $CopyWithPlaceholder(),
Object? source_ = const $CopyWithPlaceholder(),
Object? sourceId = const $CopyWithPlaceholder(),
Object? startBalance = const $CopyWithPlaceholder(),
}) {
return AccountOut(
archived: archived == const $CopyWithPlaceholder()
? _value.archived
// ignore: cast_nullable_to_non_nullable
: archived as bool,
balance: balance == const $CopyWithPlaceholder()
? _value.balance
// ignore: cast_nullable_to_non_nullable
: balance as String?,
balanceAsOf: balanceAsOf == const $CopyWithPlaceholder()
? _value.balanceAsOf
// ignore: cast_nullable_to_non_nullable
: balanceAsOf as DateTime?,
broker: broker == const $CopyWithPlaceholder()
? _value.broker
// ignore: cast_nullable_to_non_nullable
: broker as Broker?,
creditLimit: creditLimit == const $CopyWithPlaceholder()
? _value.creditLimit
// ignore: cast_nullable_to_non_nullable
: creditLimit as String?,
currency: currency == const $CopyWithPlaceholder()
? _value.currency
// ignore: cast_nullable_to_non_nullable
: currency as String,
id: id == const $CopyWithPlaceholder()
? _value.id
// ignore: cast_nullable_to_non_nullable
: id as int,
includeInNetWorth: includeInNetWorth == const $CopyWithPlaceholder()
? _value.includeInNetWorth
// ignore: cast_nullable_to_non_nullable
: includeInNetWorth as bool,
kind: kind == const $CopyWithPlaceholder()
? _value.kind
// ignore: cast_nullable_to_non_nullable
: kind as AccountKind,
mirrorOfAccountId: mirrorOfAccountId == const $CopyWithPlaceholder()
? _value.mirrorOfAccountId
// ignore: cast_nullable_to_non_nullable
: mirrorOfAccountId as int?,
name: name == const $CopyWithPlaceholder()
? _value.name
// ignore: cast_nullable_to_non_nullable
: name as String,
openedAt: openedAt == const $CopyWithPlaceholder()
? _value.openedAt
// ignore: cast_nullable_to_non_nullable
: openedAt as DateTime?,
primaryEventSource: primaryEventSource == const $CopyWithPlaceholder()
? _value.primaryEventSource
// ignore: cast_nullable_to_non_nullable
: primaryEventSource as EventSource?,
role: role == const $CopyWithPlaceholder()
? _value.role
// ignore: cast_nullable_to_non_nullable
: role as AccountRole,
source_: source_ == const $CopyWithPlaceholder()
? _value.source_
// ignore: cast_nullable_to_non_nullable
: source_ as String,
sourceId: sourceId == const $CopyWithPlaceholder()
? _value.sourceId
// ignore: cast_nullable_to_non_nullable
: sourceId as String,
startBalance: startBalance == const $CopyWithPlaceholder()
? _value.startBalance
// ignore: cast_nullable_to_non_nullable
: startBalance as String?,
);
}
}
extension $AccountOutCopyWith on AccountOut {
/// Returns a callable class that can be used as follows: `instanceOfAccountOut.copyWith(...)` or like so:`instanceOfAccountOut.copyWith.fieldName(...)`.
// ignore: library_private_types_in_public_api
_$AccountOutCWProxy get copyWith => _$AccountOutCWProxyImpl(this);
}
// **************************************************************************
// JsonSerializableGenerator
// **************************************************************************
AccountOut _$AccountOutFromJson(Map<String, dynamic> json) => $checkedCreate(
'AccountOut',
json,
($checkedConvert) {
$checkKeys(
json,
requiredKeys: const [
'archived',
'balance',
'balance_as_of',
'broker',
'credit_limit',
'currency',
'id',
'include_in_net_worth',
'kind',
'mirror_of_account_id',
'name',
'opened_at',
'primary_event_source',
'role',
'source',
'source_id',
'start_balance',
],
);
final val = AccountOut(
archived: $checkedConvert('archived', (v) => v as bool),
balance: $checkedConvert('balance', (v) => v as String?),
balanceAsOf: $checkedConvert(
'balance_as_of',
(v) => v == null ? null : DateTime.parse(v as String),
),
broker: $checkedConvert(
'broker',
(v) => $enumDecodeNullable(
_$BrokerEnumMap,
v,
unknownValue: Broker.unknownDefaultOpenApi,
),
),
creditLimit: $checkedConvert('credit_limit', (v) => v as String?),
currency: $checkedConvert('currency', (v) => v as String),
id: $checkedConvert('id', (v) => (v as num).toInt()),
includeInNetWorth: $checkedConvert(
'include_in_net_worth',
(v) => v as bool,
),
kind: $checkedConvert(
'kind',
(v) => $enumDecode(
_$AccountKindEnumMap,
v,
unknownValue: AccountKind.unknownDefaultOpenApi,
),
),
mirrorOfAccountId: $checkedConvert(
'mirror_of_account_id',
(v) => (v as num?)?.toInt(),
),
name: $checkedConvert('name', (v) => v as String),
openedAt: $checkedConvert(
'opened_at',
(v) => v == null ? null : DateTime.parse(v as String),
),
primaryEventSource: $checkedConvert(
'primary_event_source',
(v) => $enumDecodeNullable(
_$EventSourceEnumMap,
v,
unknownValue: EventSource.unknownDefaultOpenApi,
),
),
role: $checkedConvert(
'role',
(v) => $enumDecode(
_$AccountRoleEnumMap,
v,
unknownValue: AccountRole.unknownDefaultOpenApi,
),
),
source_: $checkedConvert('source', (v) => v as String),
sourceId: $checkedConvert('source_id', (v) => v as String),
startBalance: $checkedConvert('start_balance', (v) => v as String?),
);
return val;
},
fieldKeyMap: const {
'balanceAsOf': 'balance_as_of',
'creditLimit': 'credit_limit',
'includeInNetWorth': 'include_in_net_worth',
'mirrorOfAccountId': 'mirror_of_account_id',
'openedAt': 'opened_at',
'primaryEventSource': 'primary_event_source',
'source_': 'source',
'sourceId': 'source_id',
'startBalance': 'start_balance',
},
);
Map<String, dynamic> _$AccountOutToJson(AccountOut instance) =>
<String, dynamic>{
'archived': instance.archived,
'balance': instance.balance,
'balance_as_of': instance.balanceAsOf?.toIso8601String(),
'broker': _$BrokerEnumMap[instance.broker],
'credit_limit': instance.creditLimit,
'currency': instance.currency,
'id': instance.id,
'include_in_net_worth': instance.includeInNetWorth,
'kind': _$AccountKindEnumMap[instance.kind]!,
'mirror_of_account_id': instance.mirrorOfAccountId,
'name': instance.name,
'opened_at': instance.openedAt?.toIso8601String(),
'primary_event_source': _$EventSourceEnumMap[instance.primaryEventSource],
'role': _$AccountRoleEnumMap[instance.role]!,
'source': instance.source_,
'source_id': instance.sourceId,
'start_balance': instance.startBalance,
};
const _$BrokerEnumMap = {
Broker.tinvest: 'tinvest',
Broker.sber: 'sber',
Broker.vtb: 'vtb',
Broker.other: 'other',
Broker.unknownDefaultOpenApi: 'unknown_default_open_api',
};
const _$AccountKindEnumMap = {
AccountKind.zmCash: 'zm_cash',
AccountKind.zmCard: 'zm_card',
AccountKind.zmChecking: 'zm_checking',
AccountKind.zmDeposit: 'zm_deposit',
AccountKind.zmLoan: 'zm_loan',
AccountKind.zmEmoney: 'zm_emoney',
AccountKind.zmDebt: 'zm_debt',
AccountKind.broker: 'broker',
AccountKind.manualAsset: 'manual_asset',
AccountKind.unknownDefaultOpenApi: 'unknown_default_open_api',
};
const _$EventSourceEnumMap = {
EventSource.tinvestApi: 'tinvest_api',
EventSource.reportSber: 'report_sber',
EventSource.reportVtb: 'report_vtb',
EventSource.manual: 'manual',
EventSource.unknownDefaultOpenApi: 'unknown_default_open_api',
};
const _$AccountRoleEnumMap = {
AccountRole.liquid: 'liquid',
AccountRole.savings: 'savings',
AccountRole.investment: 'investment',
AccountRole.debt: 'debt',
AccountRole.unknownDefaultOpenApi: 'unknown_default_open_api',
};
@@ -0,0 +1,126 @@
//
// AUTO-GENERATED FILE, DO NOT MODIFY!
//
// ignore_for_file: unused_element
import 'package:fintracker_api/src/model/event_source.dart';
import 'package:fintracker_api/src/model/account_role.dart';
import 'package:copy_with_extension/copy_with_extension.dart';
import 'package:json_annotation/json_annotation.dart';
part 'account_patch.g.dart';
@CopyWith()
@JsonSerializable(
checked: true,
createToJson: true,
disallowUnrecognizedKeys: false,
explicitToJson: true,
)
class AccountPatch {
/// Returns a new [AccountPatch] instance.
AccountPatch({
this.includeInNetWorth,
this.mirrorOfAccountId,
this.name,
this.primaryEventSource,
this.role,
});
@JsonKey(
name: r'include_in_net_worth',
required: false,
includeIfNull: false,
)
final bool? includeInNetWorth;
@JsonKey(
name: r'mirror_of_account_id',
required: false,
includeIfNull: false,
)
final int? mirrorOfAccountId;
@JsonKey(
name: r'name',
required: false,
includeIfNull: false,
)
final String? name;
@JsonKey(
name: r'primary_event_source',
required: false,
includeIfNull: false,
unknownEnumValue: EventSource.unknownDefaultOpenApi,
)
final EventSource? primaryEventSource;
@JsonKey(
name: r'role',
required: false,
includeIfNull: false,
unknownEnumValue: AccountRole.unknownDefaultOpenApi,
)
final AccountRole? role;
@override
bool operator ==(Object other) => identical(this, other) || other is AccountPatch &&
other.includeInNetWorth == includeInNetWorth &&
other.mirrorOfAccountId == mirrorOfAccountId &&
other.name == name &&
other.primaryEventSource == primaryEventSource &&
other.role == role;
@override
int get hashCode =>
(includeInNetWorth == null ? 0 : includeInNetWorth.hashCode) +
(mirrorOfAccountId == null ? 0 : mirrorOfAccountId.hashCode) +
(name == null ? 0 : name.hashCode) +
(primaryEventSource == null ? 0 : primaryEventSource.hashCode) +
(role == null ? 0 : role.hashCode);
factory AccountPatch.fromJson(Map<String, dynamic> json) => _$AccountPatchFromJson(json);
Map<String, dynamic> toJson() => _$AccountPatchToJson(this);
@override
String toString() {
return toJson().toString();
}
}
@@ -0,0 +1,173 @@
// GENERATED CODE - DO NOT MODIFY BY HAND
part of 'account_patch.dart';
// **************************************************************************
// CopyWithGenerator
// **************************************************************************
abstract class _$AccountPatchCWProxy {
AccountPatch includeInNetWorth(bool? includeInNetWorth);
AccountPatch mirrorOfAccountId(int? mirrorOfAccountId);
AccountPatch name(String? name);
AccountPatch primaryEventSource(EventSource? primaryEventSource);
AccountPatch role(AccountRole? role);
/// This function **does support** nullification of nullable fields. All `null` values passed to `non-nullable` fields will be ignored. You can also use `AccountPatch(...).copyWith.fieldName(...)` to override fields one at a time with nullification support.
///
/// Usage
/// ```dart
/// AccountPatch(...).copyWith(id: 12, name: "My name")
/// ````
AccountPatch call({
bool? includeInNetWorth,
int? mirrorOfAccountId,
String? name,
EventSource? primaryEventSource,
AccountRole? role,
});
}
/// Proxy class for `copyWith` functionality. This is a callable class and can be used as follows: `instanceOfAccountPatch.copyWith(...)`. Additionally contains functions for specific fields e.g. `instanceOfAccountPatch.copyWith.fieldName(...)`
class _$AccountPatchCWProxyImpl implements _$AccountPatchCWProxy {
const _$AccountPatchCWProxyImpl(this._value);
final AccountPatch _value;
@override
AccountPatch includeInNetWorth(bool? includeInNetWorth) =>
this(includeInNetWorth: includeInNetWorth);
@override
AccountPatch mirrorOfAccountId(int? mirrorOfAccountId) =>
this(mirrorOfAccountId: mirrorOfAccountId);
@override
AccountPatch name(String? name) => this(name: name);
@override
AccountPatch primaryEventSource(EventSource? primaryEventSource) =>
this(primaryEventSource: primaryEventSource);
@override
AccountPatch role(AccountRole? role) => this(role: role);
@override
/// This function **does support** nullification of nullable fields. All `null` values passed to `non-nullable` fields will be ignored. You can also use `AccountPatch(...).copyWith.fieldName(...)` to override fields one at a time with nullification support.
///
/// Usage
/// ```dart
/// AccountPatch(...).copyWith(id: 12, name: "My name")
/// ````
AccountPatch call({
Object? includeInNetWorth = const $CopyWithPlaceholder(),
Object? mirrorOfAccountId = const $CopyWithPlaceholder(),
Object? name = const $CopyWithPlaceholder(),
Object? primaryEventSource = const $CopyWithPlaceholder(),
Object? role = const $CopyWithPlaceholder(),
}) {
return AccountPatch(
includeInNetWorth: includeInNetWorth == const $CopyWithPlaceholder()
? _value.includeInNetWorth
// ignore: cast_nullable_to_non_nullable
: includeInNetWorth as bool?,
mirrorOfAccountId: mirrorOfAccountId == const $CopyWithPlaceholder()
? _value.mirrorOfAccountId
// ignore: cast_nullable_to_non_nullable
: mirrorOfAccountId as int?,
name: name == const $CopyWithPlaceholder()
? _value.name
// ignore: cast_nullable_to_non_nullable
: name as String?,
primaryEventSource: primaryEventSource == const $CopyWithPlaceholder()
? _value.primaryEventSource
// ignore: cast_nullable_to_non_nullable
: primaryEventSource as EventSource?,
role: role == const $CopyWithPlaceholder()
? _value.role
// ignore: cast_nullable_to_non_nullable
: role as AccountRole?,
);
}
}
extension $AccountPatchCopyWith on AccountPatch {
/// Returns a callable class that can be used as follows: `instanceOfAccountPatch.copyWith(...)` or like so:`instanceOfAccountPatch.copyWith.fieldName(...)`.
// ignore: library_private_types_in_public_api
_$AccountPatchCWProxy get copyWith => _$AccountPatchCWProxyImpl(this);
}
// **************************************************************************
// JsonSerializableGenerator
// **************************************************************************
AccountPatch _$AccountPatchFromJson(Map<String, dynamic> json) =>
$checkedCreate(
'AccountPatch',
json,
($checkedConvert) {
final val = AccountPatch(
includeInNetWorth: $checkedConvert(
'include_in_net_worth',
(v) => v as bool?,
),
mirrorOfAccountId: $checkedConvert(
'mirror_of_account_id',
(v) => (v as num?)?.toInt(),
),
name: $checkedConvert('name', (v) => v as String?),
primaryEventSource: $checkedConvert(
'primary_event_source',
(v) => $enumDecodeNullable(
_$EventSourceEnumMap,
v,
unknownValue: EventSource.unknownDefaultOpenApi,
),
),
role: $checkedConvert(
'role',
(v) => $enumDecodeNullable(
_$AccountRoleEnumMap,
v,
unknownValue: AccountRole.unknownDefaultOpenApi,
),
),
);
return val;
},
fieldKeyMap: const {
'includeInNetWorth': 'include_in_net_worth',
'mirrorOfAccountId': 'mirror_of_account_id',
'primaryEventSource': 'primary_event_source',
},
);
Map<String, dynamic> _$AccountPatchToJson(
AccountPatch instance,
) => <String, dynamic>{
'include_in_net_worth': ?instance.includeInNetWorth,
'mirror_of_account_id': ?instance.mirrorOfAccountId,
'name': ?instance.name,
'primary_event_source': ?_$EventSourceEnumMap[instance.primaryEventSource],
'role': ?_$AccountRoleEnumMap[instance.role],
};
const _$EventSourceEnumMap = {
EventSource.tinvestApi: 'tinvest_api',
EventSource.reportSber: 'report_sber',
EventSource.reportVtb: 'report_vtb',
EventSource.manual: 'manual',
EventSource.unknownDefaultOpenApi: 'unknown_default_open_api',
};
const _$AccountRoleEnumMap = {
AccountRole.liquid: 'liquid',
AccountRole.savings: 'savings',
AccountRole.investment: 'investment',
AccountRole.debt: 'debt',
AccountRole.unknownDefaultOpenApi: 'unknown_default_open_api',
};
@@ -0,0 +1,26 @@
//
// AUTO-GENERATED FILE, DO NOT MODIFY!
//
// ignore_for_file: unused_element
import 'package:json_annotation/json_annotation.dart';
enum AccountRole {
@JsonValue(r'liquid')
liquid(r'liquid'),
@JsonValue(r'savings')
savings(r'savings'),
@JsonValue(r'investment')
investment(r'investment'),
@JsonValue(r'debt')
debt(r'debt'),
@JsonValue(r'unknown_default_open_api')
unknownDefaultOpenApi(r'unknown_default_open_api');
const AccountRole(this.value);
final String value;
@override
String toString() => value;
}
@@ -0,0 +1,26 @@
//
// AUTO-GENERATED FILE, DO NOT MODIFY!
//
// ignore_for_file: unused_element
import 'package:json_annotation/json_annotation.dart';
enum Broker {
@JsonValue(r'tinvest')
tinvest(r'tinvest'),
@JsonValue(r'sber')
sber(r'sber'),
@JsonValue(r'vtb')
vtb(r'vtb'),
@JsonValue(r'other')
other(r'other'),
@JsonValue(r'unknown_default_open_api')
unknownDefaultOpenApi(r'unknown_default_open_api');
const Broker(this.value);
final String value;
@override
String toString() => value;
}
@@ -0,0 +1,176 @@
//
// 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_month.g.dart';
@CopyWith()
@JsonSerializable(
checked: true,
createToJson: true,
disallowUnrecognizedKeys: false,
explicitToJson: true,
)
class CashFlowMonth {
/// Returns a new [CashFlowMonth] instance.
CashFlowMonth({
required this.baselineRub,
required this.expenseRub,
required this.incomeRub,
required this.month,
required this.oneOffRub,
required this.savingsRate,
required this.savingsTransferRub,
required this.txnCount,
});
/// decimal as string
@JsonKey(
name: r'baseline_rub',
required: true,
includeIfNull: false,
)
final String baselineRub;
/// decimal as string
@JsonKey(
name: r'expense_rub',
required: true,
includeIfNull: false,
)
final String expenseRub;
/// decimal as string
@JsonKey(
name: r'income_rub',
required: true,
includeIfNull: false,
)
final String incomeRub;
@JsonKey(
name: r'month',
required: true,
includeIfNull: false,
)
final DateTime month;
/// decimal as string
@JsonKey(
name: r'one_off_rub',
required: true,
includeIfNull: false,
)
final String oneOffRub;
/// decimal as string
@JsonKey(
name: r'savings_rate',
required: true,
includeIfNull: true,
)
final String? savingsRate;
/// decimal as string
@JsonKey(
name: r'savings_transfer_rub',
required: true,
includeIfNull: false,
)
final String savingsTransferRub;
@JsonKey(
name: r'txn_count',
required: true,
includeIfNull: false,
)
final int txnCount;
@override
bool operator ==(Object other) => identical(this, other) || other is CashFlowMonth &&
other.baselineRub == baselineRub &&
other.expenseRub == expenseRub &&
other.incomeRub == incomeRub &&
other.month == month &&
other.oneOffRub == oneOffRub &&
other.savingsRate == savingsRate &&
other.savingsTransferRub == savingsTransferRub &&
other.txnCount == txnCount;
@override
int get hashCode =>
baselineRub.hashCode +
expenseRub.hashCode +
incomeRub.hashCode +
month.hashCode +
oneOffRub.hashCode +
(savingsRate == null ? 0 : savingsRate.hashCode) +
savingsTransferRub.hashCode +
txnCount.hashCode;
factory CashFlowMonth.fromJson(Map<String, dynamic> json) => _$CashFlowMonthFromJson(json);
Map<String, dynamic> toJson() => _$CashFlowMonthToJson(this);
@override
String toString() {
return toJson().toString();
}
}
@@ -0,0 +1,195 @@
// GENERATED CODE - DO NOT MODIFY BY HAND
part of 'cash_flow_month.dart';
// **************************************************************************
// CopyWithGenerator
// **************************************************************************
abstract class _$CashFlowMonthCWProxy {
CashFlowMonth baselineRub(String baselineRub);
CashFlowMonth expenseRub(String expenseRub);
CashFlowMonth incomeRub(String incomeRub);
CashFlowMonth month(DateTime month);
CashFlowMonth oneOffRub(String oneOffRub);
CashFlowMonth savingsRate(String? savingsRate);
CashFlowMonth savingsTransferRub(String savingsTransferRub);
CashFlowMonth txnCount(int txnCount);
/// This function **does support** nullification of nullable fields. All `null` values passed to `non-nullable` fields will be ignored. You can also use `CashFlowMonth(...).copyWith.fieldName(...)` to override fields one at a time with nullification support.
///
/// Usage
/// ```dart
/// CashFlowMonth(...).copyWith(id: 12, name: "My name")
/// ````
CashFlowMonth call({
String baselineRub,
String expenseRub,
String incomeRub,
DateTime month,
String oneOffRub,
String? savingsRate,
String savingsTransferRub,
int txnCount,
});
}
/// Proxy class for `copyWith` functionality. This is a callable class and can be used as follows: `instanceOfCashFlowMonth.copyWith(...)`. Additionally contains functions for specific fields e.g. `instanceOfCashFlowMonth.copyWith.fieldName(...)`
class _$CashFlowMonthCWProxyImpl implements _$CashFlowMonthCWProxy {
const _$CashFlowMonthCWProxyImpl(this._value);
final CashFlowMonth _value;
@override
CashFlowMonth baselineRub(String baselineRub) =>
this(baselineRub: baselineRub);
@override
CashFlowMonth expenseRub(String expenseRub) => this(expenseRub: expenseRub);
@override
CashFlowMonth incomeRub(String incomeRub) => this(incomeRub: incomeRub);
@override
CashFlowMonth month(DateTime month) => this(month: month);
@override
CashFlowMonth oneOffRub(String oneOffRub) => this(oneOffRub: oneOffRub);
@override
CashFlowMonth savingsRate(String? savingsRate) =>
this(savingsRate: savingsRate);
@override
CashFlowMonth savingsTransferRub(String savingsTransferRub) =>
this(savingsTransferRub: savingsTransferRub);
@override
CashFlowMonth txnCount(int txnCount) => this(txnCount: txnCount);
@override
/// This function **does support** nullification of nullable fields. All `null` values passed to `non-nullable` fields will be ignored. You can also use `CashFlowMonth(...).copyWith.fieldName(...)` to override fields one at a time with nullification support.
///
/// Usage
/// ```dart
/// CashFlowMonth(...).copyWith(id: 12, name: "My name")
/// ````
CashFlowMonth call({
Object? baselineRub = const $CopyWithPlaceholder(),
Object? expenseRub = const $CopyWithPlaceholder(),
Object? incomeRub = const $CopyWithPlaceholder(),
Object? month = const $CopyWithPlaceholder(),
Object? oneOffRub = const $CopyWithPlaceholder(),
Object? savingsRate = const $CopyWithPlaceholder(),
Object? savingsTransferRub = const $CopyWithPlaceholder(),
Object? txnCount = const $CopyWithPlaceholder(),
}) {
return CashFlowMonth(
baselineRub: baselineRub == const $CopyWithPlaceholder()
? _value.baselineRub
// ignore: cast_nullable_to_non_nullable
: baselineRub as String,
expenseRub: expenseRub == const $CopyWithPlaceholder()
? _value.expenseRub
// ignore: cast_nullable_to_non_nullable
: expenseRub as String,
incomeRub: incomeRub == const $CopyWithPlaceholder()
? _value.incomeRub
// ignore: cast_nullable_to_non_nullable
: incomeRub as String,
month: month == const $CopyWithPlaceholder()
? _value.month
// ignore: cast_nullable_to_non_nullable
: month as DateTime,
oneOffRub: oneOffRub == const $CopyWithPlaceholder()
? _value.oneOffRub
// ignore: cast_nullable_to_non_nullable
: oneOffRub as String,
savingsRate: savingsRate == const $CopyWithPlaceholder()
? _value.savingsRate
// ignore: cast_nullable_to_non_nullable
: savingsRate as String?,
savingsTransferRub: savingsTransferRub == const $CopyWithPlaceholder()
? _value.savingsTransferRub
// ignore: cast_nullable_to_non_nullable
: savingsTransferRub as String,
txnCount: txnCount == const $CopyWithPlaceholder()
? _value.txnCount
// ignore: cast_nullable_to_non_nullable
: txnCount as int,
);
}
}
extension $CashFlowMonthCopyWith on CashFlowMonth {
/// Returns a callable class that can be used as follows: `instanceOfCashFlowMonth.copyWith(...)` or like so:`instanceOfCashFlowMonth.copyWith.fieldName(...)`.
// ignore: library_private_types_in_public_api
_$CashFlowMonthCWProxy get copyWith => _$CashFlowMonthCWProxyImpl(this);
}
// **************************************************************************
// JsonSerializableGenerator
// **************************************************************************
CashFlowMonth _$CashFlowMonthFromJson(Map<String, dynamic> json) =>
$checkedCreate(
'CashFlowMonth',
json,
($checkedConvert) {
$checkKeys(
json,
requiredKeys: const [
'baseline_rub',
'expense_rub',
'income_rub',
'month',
'one_off_rub',
'savings_rate',
'savings_transfer_rub',
'txn_count',
],
);
final val = CashFlowMonth(
baselineRub: $checkedConvert('baseline_rub', (v) => v as String),
expenseRub: $checkedConvert('expense_rub', (v) => v as String),
incomeRub: $checkedConvert('income_rub', (v) => v as String),
month: $checkedConvert('month', (v) => DateTime.parse(v as String)),
oneOffRub: $checkedConvert('one_off_rub', (v) => v as String),
savingsRate: $checkedConvert('savings_rate', (v) => v as String?),
savingsTransferRub: $checkedConvert(
'savings_transfer_rub',
(v) => v as String,
),
txnCount: $checkedConvert('txn_count', (v) => (v as num).toInt()),
);
return val;
},
fieldKeyMap: const {
'baselineRub': 'baseline_rub',
'expenseRub': 'expense_rub',
'incomeRub': 'income_rub',
'oneOffRub': 'one_off_rub',
'savingsRate': 'savings_rate',
'savingsTransferRub': 'savings_transfer_rub',
'txnCount': 'txn_count',
},
);
Map<String, dynamic> _$CashFlowMonthToJson(CashFlowMonth instance) =>
<String, dynamic>{
'baseline_rub': instance.baselineRub,
'expense_rub': instance.expenseRub,
'income_rub': instance.incomeRub,
'month': instance.month.toIso8601String(),
'one_off_rub': instance.oneOffRub,
'savings_rate': instance.savingsRate,
'savings_transfer_rub': instance.savingsTransferRub,
'txn_count': instance.txnCount,
};
@@ -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 'category_out.g.dart';
@CopyWith()
@JsonSerializable(
checked: true,
createToJson: true,
disallowUnrecognizedKeys: false,
explicitToJson: true,
)
class CategoryOut {
/// Returns a new [CategoryOut] instance.
CategoryOut({
required this.archived,
required this.color,
required this.icon,
required this.id,
required this.name,
required this.parentId,
required this.showIncome,
required this.showOutcome,
});
@JsonKey(
name: r'archived',
required: true,
includeIfNull: false,
)
final bool archived;
@JsonKey(
name: r'color',
required: true,
includeIfNull: true,
)
final int? color;
@JsonKey(
name: r'icon',
required: true,
includeIfNull: true,
)
final String? icon;
@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'parent_id',
required: true,
includeIfNull: true,
)
final int? parentId;
@JsonKey(
name: r'show_income',
required: true,
includeIfNull: false,
)
final bool showIncome;
@JsonKey(
name: r'show_outcome',
required: true,
includeIfNull: false,
)
final bool showOutcome;
@override
bool operator ==(Object other) => identical(this, other) || other is CategoryOut &&
other.archived == archived &&
other.color == color &&
other.icon == icon &&
other.id == id &&
other.name == name &&
other.parentId == parentId &&
other.showIncome == showIncome &&
other.showOutcome == showOutcome;
@override
int get hashCode =>
archived.hashCode +
(color == null ? 0 : color.hashCode) +
(icon == null ? 0 : icon.hashCode) +
id.hashCode +
name.hashCode +
(parentId == null ? 0 : parentId.hashCode) +
showIncome.hashCode +
showOutcome.hashCode;
factory CategoryOut.fromJson(Map<String, dynamic> json) => _$CategoryOutFromJson(json);
Map<String, dynamic> toJson() => _$CategoryOutToJson(this);
@override
String toString() {
return toJson().toString();
}
}
@@ -0,0 +1,184 @@
// GENERATED CODE - DO NOT MODIFY BY HAND
part of 'category_out.dart';
// **************************************************************************
// CopyWithGenerator
// **************************************************************************
abstract class _$CategoryOutCWProxy {
CategoryOut archived(bool archived);
CategoryOut color(int? color);
CategoryOut icon(String? icon);
CategoryOut id(int id);
CategoryOut name(String name);
CategoryOut parentId(int? parentId);
CategoryOut showIncome(bool showIncome);
CategoryOut showOutcome(bool showOutcome);
/// This function **does support** nullification of nullable fields. All `null` values passed to `non-nullable` fields will be ignored. You can also use `CategoryOut(...).copyWith.fieldName(...)` to override fields one at a time with nullification support.
///
/// Usage
/// ```dart
/// CategoryOut(...).copyWith(id: 12, name: "My name")
/// ````
CategoryOut call({
bool archived,
int? color,
String? icon,
int id,
String name,
int? parentId,
bool showIncome,
bool showOutcome,
});
}
/// Proxy class for `copyWith` functionality. This is a callable class and can be used as follows: `instanceOfCategoryOut.copyWith(...)`. Additionally contains functions for specific fields e.g. `instanceOfCategoryOut.copyWith.fieldName(...)`
class _$CategoryOutCWProxyImpl implements _$CategoryOutCWProxy {
const _$CategoryOutCWProxyImpl(this._value);
final CategoryOut _value;
@override
CategoryOut archived(bool archived) => this(archived: archived);
@override
CategoryOut color(int? color) => this(color: color);
@override
CategoryOut icon(String? icon) => this(icon: icon);
@override
CategoryOut id(int id) => this(id: id);
@override
CategoryOut name(String name) => this(name: name);
@override
CategoryOut parentId(int? parentId) => this(parentId: parentId);
@override
CategoryOut showIncome(bool showIncome) => this(showIncome: showIncome);
@override
CategoryOut showOutcome(bool showOutcome) => this(showOutcome: showOutcome);
@override
/// This function **does support** nullification of nullable fields. All `null` values passed to `non-nullable` fields will be ignored. You can also use `CategoryOut(...).copyWith.fieldName(...)` to override fields one at a time with nullification support.
///
/// Usage
/// ```dart
/// CategoryOut(...).copyWith(id: 12, name: "My name")
/// ````
CategoryOut call({
Object? archived = const $CopyWithPlaceholder(),
Object? color = const $CopyWithPlaceholder(),
Object? icon = const $CopyWithPlaceholder(),
Object? id = const $CopyWithPlaceholder(),
Object? name = const $CopyWithPlaceholder(),
Object? parentId = const $CopyWithPlaceholder(),
Object? showIncome = const $CopyWithPlaceholder(),
Object? showOutcome = const $CopyWithPlaceholder(),
}) {
return CategoryOut(
archived: archived == const $CopyWithPlaceholder()
? _value.archived
// ignore: cast_nullable_to_non_nullable
: archived as bool,
color: color == const $CopyWithPlaceholder()
? _value.color
// ignore: cast_nullable_to_non_nullable
: color as int?,
icon: icon == const $CopyWithPlaceholder()
? _value.icon
// ignore: cast_nullable_to_non_nullable
: icon 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,
parentId: parentId == const $CopyWithPlaceholder()
? _value.parentId
// ignore: cast_nullable_to_non_nullable
: parentId as int?,
showIncome: showIncome == const $CopyWithPlaceholder()
? _value.showIncome
// ignore: cast_nullable_to_non_nullable
: showIncome as bool,
showOutcome: showOutcome == const $CopyWithPlaceholder()
? _value.showOutcome
// ignore: cast_nullable_to_non_nullable
: showOutcome as bool,
);
}
}
extension $CategoryOutCopyWith on CategoryOut {
/// Returns a callable class that can be used as follows: `instanceOfCategoryOut.copyWith(...)` or like so:`instanceOfCategoryOut.copyWith.fieldName(...)`.
// ignore: library_private_types_in_public_api
_$CategoryOutCWProxy get copyWith => _$CategoryOutCWProxyImpl(this);
}
// **************************************************************************
// JsonSerializableGenerator
// **************************************************************************
CategoryOut _$CategoryOutFromJson(Map<String, dynamic> json) => $checkedCreate(
'CategoryOut',
json,
($checkedConvert) {
$checkKeys(
json,
requiredKeys: const [
'archived',
'color',
'icon',
'id',
'name',
'parent_id',
'show_income',
'show_outcome',
],
);
final val = CategoryOut(
archived: $checkedConvert('archived', (v) => v as bool),
color: $checkedConvert('color', (v) => (v as num?)?.toInt()),
icon: $checkedConvert('icon', (v) => v as String?),
id: $checkedConvert('id', (v) => (v as num).toInt()),
name: $checkedConvert('name', (v) => v as String),
parentId: $checkedConvert('parent_id', (v) => (v as num?)?.toInt()),
showIncome: $checkedConvert('show_income', (v) => v as bool),
showOutcome: $checkedConvert('show_outcome', (v) => v as bool),
);
return val;
},
fieldKeyMap: const {
'parentId': 'parent_id',
'showIncome': 'show_income',
'showOutcome': 'show_outcome',
},
);
Map<String, dynamic> _$CategoryOutToJson(CategoryOut instance) =>
<String, dynamic>{
'archived': instance.archived,
'color': instance.color,
'icon': instance.icon,
'id': instance.id,
'name': instance.name,
'parent_id': instance.parentId,
'show_income': instance.showIncome,
'show_outcome': instance.showOutcome,
};
@@ -0,0 +1,154 @@
//
// 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 'data_quality_row.g.dart';
@CopyWith()
@JsonSerializable(
checked: true,
createToJson: true,
disallowUnrecognizedKeys: false,
explicitToJson: true,
)
class DataQualityRow {
/// Returns a new [DataQualityRow] instance.
DataQualityRow({
required this.checkName,
required this.computedAt,
required this.count,
required this.detail,
required this.id,
required this.ref,
required this.severity,
});
@JsonKey(
name: r'check_name',
required: true,
includeIfNull: false,
)
final String checkName;
@JsonKey(
name: r'computed_at',
required: true,
includeIfNull: false,
)
final DateTime computedAt;
@JsonKey(
name: r'count',
required: true,
includeIfNull: false,
)
final int count;
@JsonKey(
name: r'detail',
required: true,
includeIfNull: false,
)
final String detail;
@JsonKey(
name: r'id',
required: true,
includeIfNull: false,
)
final int id;
@JsonKey(
name: r'ref',
required: true,
includeIfNull: true,
)
final Map<String, Object>? ref;
@JsonKey(
name: r'severity',
required: true,
includeIfNull: false,
)
final String severity;
@override
bool operator ==(Object other) => identical(this, other) || other is DataQualityRow &&
other.checkName == checkName &&
other.computedAt == computedAt &&
other.count == count &&
other.detail == detail &&
other.id == id &&
other.ref == ref &&
other.severity == severity;
@override
int get hashCode =>
checkName.hashCode +
computedAt.hashCode +
count.hashCode +
detail.hashCode +
id.hashCode +
(ref == null ? 0 : ref.hashCode) +
severity.hashCode;
factory DataQualityRow.fromJson(Map<String, dynamic> json) => _$DataQualityRowFromJson(json);
Map<String, dynamic> toJson() => _$DataQualityRowToJson(this);
@override
String toString() {
return toJson().toString();
}
}
@@ -0,0 +1,179 @@
// GENERATED CODE - DO NOT MODIFY BY HAND
part of 'data_quality_row.dart';
// **************************************************************************
// CopyWithGenerator
// **************************************************************************
abstract class _$DataQualityRowCWProxy {
DataQualityRow checkName(String checkName);
DataQualityRow computedAt(DateTime computedAt);
DataQualityRow count(int count);
DataQualityRow detail(String detail);
DataQualityRow id(int id);
DataQualityRow ref(Map<String, Object>? ref);
DataQualityRow severity(String severity);
/// This function **does support** nullification of nullable fields. All `null` values passed to `non-nullable` fields will be ignored. You can also use `DataQualityRow(...).copyWith.fieldName(...)` to override fields one at a time with nullification support.
///
/// Usage
/// ```dart
/// DataQualityRow(...).copyWith(id: 12, name: "My name")
/// ````
DataQualityRow call({
String checkName,
DateTime computedAt,
int count,
String detail,
int id,
Map<String, Object>? ref,
String severity,
});
}
/// Proxy class for `copyWith` functionality. This is a callable class and can be used as follows: `instanceOfDataQualityRow.copyWith(...)`. Additionally contains functions for specific fields e.g. `instanceOfDataQualityRow.copyWith.fieldName(...)`
class _$DataQualityRowCWProxyImpl implements _$DataQualityRowCWProxy {
const _$DataQualityRowCWProxyImpl(this._value);
final DataQualityRow _value;
@override
DataQualityRow checkName(String checkName) => this(checkName: checkName);
@override
DataQualityRow computedAt(DateTime computedAt) =>
this(computedAt: computedAt);
@override
DataQualityRow count(int count) => this(count: count);
@override
DataQualityRow detail(String detail) => this(detail: detail);
@override
DataQualityRow id(int id) => this(id: id);
@override
DataQualityRow ref(Map<String, Object>? ref) => this(ref: ref);
@override
DataQualityRow severity(String severity) => this(severity: severity);
@override
/// This function **does support** nullification of nullable fields. All `null` values passed to `non-nullable` fields will be ignored. You can also use `DataQualityRow(...).copyWith.fieldName(...)` to override fields one at a time with nullification support.
///
/// Usage
/// ```dart
/// DataQualityRow(...).copyWith(id: 12, name: "My name")
/// ````
DataQualityRow call({
Object? checkName = const $CopyWithPlaceholder(),
Object? computedAt = const $CopyWithPlaceholder(),
Object? count = const $CopyWithPlaceholder(),
Object? detail = const $CopyWithPlaceholder(),
Object? id = const $CopyWithPlaceholder(),
Object? ref = const $CopyWithPlaceholder(),
Object? severity = const $CopyWithPlaceholder(),
}) {
return DataQualityRow(
checkName: checkName == const $CopyWithPlaceholder()
? _value.checkName
// ignore: cast_nullable_to_non_nullable
: checkName as String,
computedAt: computedAt == const $CopyWithPlaceholder()
? _value.computedAt
// ignore: cast_nullable_to_non_nullable
: computedAt as DateTime,
count: count == const $CopyWithPlaceholder()
? _value.count
// ignore: cast_nullable_to_non_nullable
: count as int,
detail: detail == const $CopyWithPlaceholder()
? _value.detail
// ignore: cast_nullable_to_non_nullable
: detail as String,
id: id == const $CopyWithPlaceholder()
? _value.id
// ignore: cast_nullable_to_non_nullable
: id as int,
ref: ref == const $CopyWithPlaceholder()
? _value.ref
// ignore: cast_nullable_to_non_nullable
: ref as Map<String, Object>?,
severity: severity == const $CopyWithPlaceholder()
? _value.severity
// ignore: cast_nullable_to_non_nullable
: severity as String,
);
}
}
extension $DataQualityRowCopyWith on DataQualityRow {
/// Returns a callable class that can be used as follows: `instanceOfDataQualityRow.copyWith(...)` or like so:`instanceOfDataQualityRow.copyWith.fieldName(...)`.
// ignore: library_private_types_in_public_api
_$DataQualityRowCWProxy get copyWith => _$DataQualityRowCWProxyImpl(this);
}
// **************************************************************************
// JsonSerializableGenerator
// **************************************************************************
DataQualityRow _$DataQualityRowFromJson(Map<String, dynamic> json) =>
$checkedCreate(
'DataQualityRow',
json,
($checkedConvert) {
$checkKeys(
json,
requiredKeys: const [
'check_name',
'computed_at',
'count',
'detail',
'id',
'ref',
'severity',
],
);
final val = DataQualityRow(
checkName: $checkedConvert('check_name', (v) => v as String),
computedAt: $checkedConvert(
'computed_at',
(v) => DateTime.parse(v as String),
),
count: $checkedConvert('count', (v) => (v as num).toInt()),
detail: $checkedConvert('detail', (v) => v as String),
id: $checkedConvert('id', (v) => (v as num).toInt()),
ref: $checkedConvert(
'ref',
(v) => (v as Map<String, dynamic>?)?.map(
(k, e) => MapEntry(k, e as Object),
),
),
severity: $checkedConvert('severity', (v) => v as String),
);
return val;
},
fieldKeyMap: const {
'checkName': 'check_name',
'computedAt': 'computed_at',
},
);
Map<String, dynamic> _$DataQualityRowToJson(DataQualityRow instance) =>
<String, dynamic>{
'check_name': instance.checkName,
'computed_at': instance.computedAt.toIso8601String(),
'count': instance.count,
'detail': instance.detail,
'id': instance.id,
'ref': instance.ref,
'severity': instance.severity,
};
@@ -0,0 +1,27 @@
//
// AUTO-GENERATED FILE, DO NOT MODIFY!
//
// ignore_for_file: unused_element
import 'package:json_annotation/json_annotation.dart';
/// Which feed is the truth for an account's ledger; others become `shadow` events.
enum EventSource {
@JsonValue(r'tinvest_api')
tinvestApi(r'tinvest_api'),
@JsonValue(r'report_sber')
reportSber(r'report_sber'),
@JsonValue(r'report_vtb')
reportVtb(r'report_vtb'),
@JsonValue(r'manual')
manual(r'manual'),
@JsonValue(r'unknown_default_open_api')
unknownDefaultOpenApi(r'unknown_default_open_api');
const EventSource(this.value);
final String value;
@override
String toString() => value;
}
@@ -0,0 +1,32 @@
//
// AUTO-GENERATED FILE, DO NOT MODIFY!
//
// ignore_for_file: unused_element
import 'package:json_annotation/json_annotation.dart';
enum FlowType {
@JsonValue(r'income')
income(r'income'),
@JsonValue(r'expense')
expense(r'expense'),
@JsonValue(r'internal_transfer')
internalTransfer(r'internal_transfer'),
@JsonValue(r'savings_transfer')
savingsTransfer(r'savings_transfer'),
@JsonValue(r'broker_external_flow')
brokerExternalFlow(r'broker_external_flow'),
@JsonValue(r'deleted')
deleted(r'deleted'),
@JsonValue(r'other')
other(r'other'),
@JsonValue(r'unknown_default_open_api')
unknownDefaultOpenApi(r'unknown_default_open_api');
const FlowType(this.value);
final String value;
@override
String toString() => value;
}
@@ -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 'health.g.dart';
@CopyWith()
@JsonSerializable(
checked: true,
createToJson: true,
disallowUnrecognizedKeys: false,
explicitToJson: true,
)
class Health {
/// Returns a new [Health] instance.
Health({
required this.database,
required this.status,
required this.version,
});
@JsonKey(
name: r'database',
required: true,
includeIfNull: false,
)
final String database;
@JsonKey(
name: r'status',
required: true,
includeIfNull: false,
)
final String status;
@JsonKey(
name: r'version',
required: true,
includeIfNull: false,
)
final String version;
@override
bool operator ==(Object other) => identical(this, other) || other is Health &&
other.database == database &&
other.status == status &&
other.version == version;
@override
int get hashCode =>
database.hashCode +
status.hashCode +
version.hashCode;
factory Health.fromJson(Map<String, dynamic> json) => _$HealthFromJson(json);
Map<String, dynamic> toJson() => _$HealthToJson(this);
@override
String toString() {
return toJson().toString();
}
}
@@ -0,0 +1,94 @@
// GENERATED CODE - DO NOT MODIFY BY HAND
part of 'health.dart';
// **************************************************************************
// CopyWithGenerator
// **************************************************************************
abstract class _$HealthCWProxy {
Health database(String database);
Health status(String status);
Health version(String version);
/// This function **does support** nullification of nullable fields. All `null` values passed to `non-nullable` fields will be ignored. You can also use `Health(...).copyWith.fieldName(...)` to override fields one at a time with nullification support.
///
/// Usage
/// ```dart
/// Health(...).copyWith(id: 12, name: "My name")
/// ````
Health call({String database, String status, String version});
}
/// Proxy class for `copyWith` functionality. This is a callable class and can be used as follows: `instanceOfHealth.copyWith(...)`. Additionally contains functions for specific fields e.g. `instanceOfHealth.copyWith.fieldName(...)`
class _$HealthCWProxyImpl implements _$HealthCWProxy {
const _$HealthCWProxyImpl(this._value);
final Health _value;
@override
Health database(String database) => this(database: database);
@override
Health status(String status) => this(status: status);
@override
Health version(String version) => this(version: version);
@override
/// This function **does support** nullification of nullable fields. All `null` values passed to `non-nullable` fields will be ignored. You can also use `Health(...).copyWith.fieldName(...)` to override fields one at a time with nullification support.
///
/// Usage
/// ```dart
/// Health(...).copyWith(id: 12, name: "My name")
/// ````
Health call({
Object? database = const $CopyWithPlaceholder(),
Object? status = const $CopyWithPlaceholder(),
Object? version = const $CopyWithPlaceholder(),
}) {
return Health(
database: database == const $CopyWithPlaceholder()
? _value.database
// ignore: cast_nullable_to_non_nullable
: database as String,
status: status == const $CopyWithPlaceholder()
? _value.status
// ignore: cast_nullable_to_non_nullable
: status as String,
version: version == const $CopyWithPlaceholder()
? _value.version
// ignore: cast_nullable_to_non_nullable
: version as String,
);
}
}
extension $HealthCopyWith on Health {
/// Returns a callable class that can be used as follows: `instanceOfHealth.copyWith(...)` or like so:`instanceOfHealth.copyWith.fieldName(...)`.
// ignore: library_private_types_in_public_api
_$HealthCWProxy get copyWith => _$HealthCWProxyImpl(this);
}
// **************************************************************************
// JsonSerializableGenerator
// **************************************************************************
Health _$HealthFromJson(Map<String, dynamic> json) =>
$checkedCreate('Health', json, ($checkedConvert) {
$checkKeys(json, requiredKeys: const ['database', 'status', 'version']);
final val = Health(
database: $checkedConvert('database', (v) => v as String),
status: $checkedConvert('status', (v) => v as String),
version: $checkedConvert('version', (v) => v as String),
);
return val;
});
Map<String, dynamic> _$HealthToJson(Health instance) => <String, dynamic>{
'database': instance.database,
'status': instance.status,
'version': instance.version,
};
@@ -0,0 +1,26 @@
//
// AUTO-GENERATED FILE, DO NOT MODIFY!
//
// ignore_for_file: unused_element
import 'package:json_annotation/json_annotation.dart';
enum JobStatus {
@JsonValue(r'queued')
queued(r'queued'),
@JsonValue(r'running')
running(r'running'),
@JsonValue(r'done')
done(r'done'),
@JsonValue(r'error')
error(r'error'),
@JsonValue(r'unknown_default_open_api')
unknownDefaultOpenApi(r'unknown_default_open_api');
const JobStatus(this.value);
final String value;
@override
String toString() => value;
}
@@ -0,0 +1,74 @@
//
// 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 'login_request.g.dart';
@CopyWith()
@JsonSerializable(
checked: true,
createToJson: true,
disallowUnrecognizedKeys: false,
explicitToJson: true,
)
class LoginRequest {
/// Returns a new [LoginRequest] instance.
LoginRequest({
required this.email,
required this.password,
});
@JsonKey(
name: r'email',
required: true,
includeIfNull: false,
)
final String email;
@JsonKey(
name: r'password',
required: true,
includeIfNull: false,
)
final String password;
@override
bool operator ==(Object other) => identical(this, other) || other is LoginRequest &&
other.email == email &&
other.password == password;
@override
int get hashCode =>
email.hashCode +
password.hashCode;
factory LoginRequest.fromJson(Map<String, dynamic> json) => _$LoginRequestFromJson(json);
Map<String, dynamic> toJson() => _$LoginRequestToJson(this);
@override
String toString() {
return toJson().toString();
}
}
@@ -0,0 +1,80 @@
// GENERATED CODE - DO NOT MODIFY BY HAND
part of 'login_request.dart';
// **************************************************************************
// CopyWithGenerator
// **************************************************************************
abstract class _$LoginRequestCWProxy {
LoginRequest email(String email);
LoginRequest password(String password);
/// This function **does support** nullification of nullable fields. All `null` values passed to `non-nullable` fields will be ignored. You can also use `LoginRequest(...).copyWith.fieldName(...)` to override fields one at a time with nullification support.
///
/// Usage
/// ```dart
/// LoginRequest(...).copyWith(id: 12, name: "My name")
/// ````
LoginRequest call({String email, String password});
}
/// Proxy class for `copyWith` functionality. This is a callable class and can be used as follows: `instanceOfLoginRequest.copyWith(...)`. Additionally contains functions for specific fields e.g. `instanceOfLoginRequest.copyWith.fieldName(...)`
class _$LoginRequestCWProxyImpl implements _$LoginRequestCWProxy {
const _$LoginRequestCWProxyImpl(this._value);
final LoginRequest _value;
@override
LoginRequest email(String email) => this(email: email);
@override
LoginRequest password(String password) => this(password: password);
@override
/// This function **does support** nullification of nullable fields. All `null` values passed to `non-nullable` fields will be ignored. You can also use `LoginRequest(...).copyWith.fieldName(...)` to override fields one at a time with nullification support.
///
/// Usage
/// ```dart
/// LoginRequest(...).copyWith(id: 12, name: "My name")
/// ````
LoginRequest call({
Object? email = const $CopyWithPlaceholder(),
Object? password = const $CopyWithPlaceholder(),
}) {
return LoginRequest(
email: email == const $CopyWithPlaceholder()
? _value.email
// ignore: cast_nullable_to_non_nullable
: email as String,
password: password == const $CopyWithPlaceholder()
? _value.password
// ignore: cast_nullable_to_non_nullable
: password as String,
);
}
}
extension $LoginRequestCopyWith on LoginRequest {
/// Returns a callable class that can be used as follows: `instanceOfLoginRequest.copyWith(...)` or like so:`instanceOfLoginRequest.copyWith.fieldName(...)`.
// ignore: library_private_types_in_public_api
_$LoginRequestCWProxy get copyWith => _$LoginRequestCWProxyImpl(this);
}
// **************************************************************************
// JsonSerializableGenerator
// **************************************************************************
LoginRequest _$LoginRequestFromJson(Map<String, dynamic> json) =>
$checkedCreate('LoginRequest', json, ($checkedConvert) {
$checkKeys(json, requiredKeys: const ['email', 'password']);
final val = LoginRequest(
email: $checkedConvert('email', (v) => v as String),
password: $checkedConvert('password', (v) => v as String),
);
return val;
});
Map<String, dynamic> _$LoginRequestToJson(LoginRequest instance) =>
<String, dynamic>{'email': instance.email, 'password': instance.password};
@@ -0,0 +1,192 @@
//
// AUTO-GENERATED FILE, DO NOT MODIFY!
//
// ignore_for_file: unused_element
import 'package:fintracker_api/src/model/account_balance.dart';
import 'package:copy_with_extension/copy_with_extension.dart';
import 'package:json_annotation/json_annotation.dart';
part 'net_worth_breakdown.g.dart';
@CopyWith()
@JsonSerializable(
checked: true,
createToJson: true,
disallowUnrecognizedKeys: false,
explicitToJson: true,
)
class NetWorthBreakdown {
/// Returns a new [NetWorthBreakdown] instance.
NetWorthBreakdown({
required this.accounts,
required this.byCurrency,
required this.d,
required this.debtRub,
required this.investmentRub,
required this.liquidRub,
required this.missingFxCount,
required this.savingsRub,
required this.totalRub,
});
@JsonKey(
name: r'accounts',
required: true,
includeIfNull: false,
)
final List<AccountBalance> accounts;
@JsonKey(
name: r'by_currency',
required: true,
includeIfNull: false,
)
final Map<String, String> byCurrency;
@JsonKey(
name: r'd',
required: true,
includeIfNull: true,
)
final DateTime? d;
/// decimal as string
@JsonKey(
name: r'debt_rub',
required: true,
includeIfNull: false,
)
final String debtRub;
/// decimal as string
@JsonKey(
name: r'investment_rub',
required: true,
includeIfNull: false,
)
final String investmentRub;
/// decimal as string
@JsonKey(
name: r'liquid_rub',
required: true,
includeIfNull: false,
)
final String liquidRub;
@JsonKey(
name: r'missing_fx_count',
required: true,
includeIfNull: false,
)
final int missingFxCount;
/// decimal as string
@JsonKey(
name: r'savings_rub',
required: true,
includeIfNull: false,
)
final String savingsRub;
/// decimal as string
@JsonKey(
name: r'total_rub',
required: true,
includeIfNull: false,
)
final String totalRub;
@override
bool operator ==(Object other) => identical(this, other) || other is NetWorthBreakdown &&
other.accounts == accounts &&
other.byCurrency == byCurrency &&
other.d == d &&
other.debtRub == debtRub &&
other.investmentRub == investmentRub &&
other.liquidRub == liquidRub &&
other.missingFxCount == missingFxCount &&
other.savingsRub == savingsRub &&
other.totalRub == totalRub;
@override
int get hashCode =>
accounts.hashCode +
byCurrency.hashCode +
(d == null ? 0 : d.hashCode) +
debtRub.hashCode +
investmentRub.hashCode +
liquidRub.hashCode +
missingFxCount.hashCode +
savingsRub.hashCode +
totalRub.hashCode;
factory NetWorthBreakdown.fromJson(Map<String, dynamic> json) => _$NetWorthBreakdownFromJson(json);
Map<String, dynamic> toJson() => _$NetWorthBreakdownToJson(this);
@override
String toString() {
return toJson().toString();
}
}
@@ -0,0 +1,223 @@
// GENERATED CODE - DO NOT MODIFY BY HAND
part of 'net_worth_breakdown.dart';
// **************************************************************************
// CopyWithGenerator
// **************************************************************************
abstract class _$NetWorthBreakdownCWProxy {
NetWorthBreakdown accounts(List<AccountBalance> accounts);
NetWorthBreakdown byCurrency(Map<String, String> byCurrency);
NetWorthBreakdown d(DateTime? d);
NetWorthBreakdown debtRub(String debtRub);
NetWorthBreakdown investmentRub(String investmentRub);
NetWorthBreakdown liquidRub(String liquidRub);
NetWorthBreakdown missingFxCount(int missingFxCount);
NetWorthBreakdown savingsRub(String savingsRub);
NetWorthBreakdown totalRub(String totalRub);
/// This function **does support** nullification of nullable fields. All `null` values passed to `non-nullable` fields will be ignored. You can also use `NetWorthBreakdown(...).copyWith.fieldName(...)` to override fields one at a time with nullification support.
///
/// Usage
/// ```dart
/// NetWorthBreakdown(...).copyWith(id: 12, name: "My name")
/// ````
NetWorthBreakdown call({
List<AccountBalance> accounts,
Map<String, String> byCurrency,
DateTime? d,
String debtRub,
String investmentRub,
String liquidRub,
int missingFxCount,
String savingsRub,
String totalRub,
});
}
/// Proxy class for `copyWith` functionality. This is a callable class and can be used as follows: `instanceOfNetWorthBreakdown.copyWith(...)`. Additionally contains functions for specific fields e.g. `instanceOfNetWorthBreakdown.copyWith.fieldName(...)`
class _$NetWorthBreakdownCWProxyImpl implements _$NetWorthBreakdownCWProxy {
const _$NetWorthBreakdownCWProxyImpl(this._value);
final NetWorthBreakdown _value;
@override
NetWorthBreakdown accounts(List<AccountBalance> accounts) =>
this(accounts: accounts);
@override
NetWorthBreakdown byCurrency(Map<String, String> byCurrency) =>
this(byCurrency: byCurrency);
@override
NetWorthBreakdown d(DateTime? d) => this(d: d);
@override
NetWorthBreakdown debtRub(String debtRub) => this(debtRub: debtRub);
@override
NetWorthBreakdown investmentRub(String investmentRub) =>
this(investmentRub: investmentRub);
@override
NetWorthBreakdown liquidRub(String liquidRub) => this(liquidRub: liquidRub);
@override
NetWorthBreakdown missingFxCount(int missingFxCount) =>
this(missingFxCount: missingFxCount);
@override
NetWorthBreakdown savingsRub(String savingsRub) =>
this(savingsRub: savingsRub);
@override
NetWorthBreakdown totalRub(String totalRub) => this(totalRub: totalRub);
@override
/// This function **does support** nullification of nullable fields. All `null` values passed to `non-nullable` fields will be ignored. You can also use `NetWorthBreakdown(...).copyWith.fieldName(...)` to override fields one at a time with nullification support.
///
/// Usage
/// ```dart
/// NetWorthBreakdown(...).copyWith(id: 12, name: "My name")
/// ````
NetWorthBreakdown call({
Object? accounts = const $CopyWithPlaceholder(),
Object? byCurrency = const $CopyWithPlaceholder(),
Object? d = const $CopyWithPlaceholder(),
Object? debtRub = const $CopyWithPlaceholder(),
Object? investmentRub = const $CopyWithPlaceholder(),
Object? liquidRub = const $CopyWithPlaceholder(),
Object? missingFxCount = const $CopyWithPlaceholder(),
Object? savingsRub = const $CopyWithPlaceholder(),
Object? totalRub = const $CopyWithPlaceholder(),
}) {
return NetWorthBreakdown(
accounts: accounts == const $CopyWithPlaceholder()
? _value.accounts
// ignore: cast_nullable_to_non_nullable
: accounts as List<AccountBalance>,
byCurrency: byCurrency == const $CopyWithPlaceholder()
? _value.byCurrency
// ignore: cast_nullable_to_non_nullable
: byCurrency as Map<String, String>,
d: d == const $CopyWithPlaceholder()
? _value.d
// ignore: cast_nullable_to_non_nullable
: d as DateTime?,
debtRub: debtRub == const $CopyWithPlaceholder()
? _value.debtRub
// ignore: cast_nullable_to_non_nullable
: debtRub as String,
investmentRub: investmentRub == const $CopyWithPlaceholder()
? _value.investmentRub
// ignore: cast_nullable_to_non_nullable
: investmentRub as String,
liquidRub: liquidRub == const $CopyWithPlaceholder()
? _value.liquidRub
// ignore: cast_nullable_to_non_nullable
: liquidRub as String,
missingFxCount: missingFxCount == const $CopyWithPlaceholder()
? _value.missingFxCount
// ignore: cast_nullable_to_non_nullable
: missingFxCount as int,
savingsRub: savingsRub == const $CopyWithPlaceholder()
? _value.savingsRub
// ignore: cast_nullable_to_non_nullable
: savingsRub as String,
totalRub: totalRub == const $CopyWithPlaceholder()
? _value.totalRub
// ignore: cast_nullable_to_non_nullable
: totalRub as String,
);
}
}
extension $NetWorthBreakdownCopyWith on NetWorthBreakdown {
/// Returns a callable class that can be used as follows: `instanceOfNetWorthBreakdown.copyWith(...)` or like so:`instanceOfNetWorthBreakdown.copyWith.fieldName(...)`.
// ignore: library_private_types_in_public_api
_$NetWorthBreakdownCWProxy get copyWith =>
_$NetWorthBreakdownCWProxyImpl(this);
}
// **************************************************************************
// JsonSerializableGenerator
// **************************************************************************
NetWorthBreakdown _$NetWorthBreakdownFromJson(Map<String, dynamic> json) =>
$checkedCreate(
'NetWorthBreakdown',
json,
($checkedConvert) {
$checkKeys(
json,
requiredKeys: const [
'accounts',
'by_currency',
'd',
'debt_rub',
'investment_rub',
'liquid_rub',
'missing_fx_count',
'savings_rub',
'total_rub',
],
);
final val = NetWorthBreakdown(
accounts: $checkedConvert(
'accounts',
(v) => (v as List<dynamic>)
.map((e) => AccountBalance.fromJson(e as Map<String, dynamic>))
.toList(),
),
byCurrency: $checkedConvert(
'by_currency',
(v) => Map<String, String>.from(v as Map),
),
d: $checkedConvert(
'd',
(v) => v == null ? null : DateTime.parse(v as String),
),
debtRub: $checkedConvert('debt_rub', (v) => v as String),
investmentRub: $checkedConvert('investment_rub', (v) => v as String),
liquidRub: $checkedConvert('liquid_rub', (v) => v as String),
missingFxCount: $checkedConvert(
'missing_fx_count',
(v) => (v as num).toInt(),
),
savingsRub: $checkedConvert('savings_rub', (v) => v as String),
totalRub: $checkedConvert('total_rub', (v) => v as String),
);
return val;
},
fieldKeyMap: const {
'byCurrency': 'by_currency',
'debtRub': 'debt_rub',
'investmentRub': 'investment_rub',
'liquidRub': 'liquid_rub',
'missingFxCount': 'missing_fx_count',
'savingsRub': 'savings_rub',
'totalRub': 'total_rub',
},
);
Map<String, dynamic> _$NetWorthBreakdownToJson(NetWorthBreakdown instance) =>
<String, dynamic>{
'accounts': instance.accounts.map((e) => e.toJson()).toList(),
'by_currency': instance.byCurrency,
'd': instance.d?.toIso8601String(),
'debt_rub': instance.debtRub,
'investment_rub': instance.investmentRub,
'liquid_rub': instance.liquidRub,
'missing_fx_count': instance.missingFxCount,
'savings_rub': instance.savingsRub,
'total_rub': instance.totalRub,
};
@@ -0,0 +1,175 @@
//
// 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 'net_worth_day.g.dart';
@CopyWith()
@JsonSerializable(
checked: true,
createToJson: true,
disallowUnrecognizedKeys: false,
explicitToJson: true,
)
class NetWorthDay {
/// Returns a new [NetWorthDay] instance.
NetWorthDay({
required this.byCurrency,
required this.d,
required this.debtRub,
required this.investmentRub,
required this.liquidRub,
required this.missingFxCount,
required this.savingsRub,
required this.totalRub,
});
@JsonKey(
name: r'by_currency',
required: true,
includeIfNull: false,
)
final Map<String, String> byCurrency;
@JsonKey(
name: r'd',
required: true,
includeIfNull: false,
)
final DateTime d;
/// decimal as string
@JsonKey(
name: r'debt_rub',
required: true,
includeIfNull: false,
)
final String debtRub;
/// decimal as string
@JsonKey(
name: r'investment_rub',
required: true,
includeIfNull: false,
)
final String investmentRub;
/// decimal as string
@JsonKey(
name: r'liquid_rub',
required: true,
includeIfNull: false,
)
final String liquidRub;
@JsonKey(
name: r'missing_fx_count',
required: true,
includeIfNull: false,
)
final int missingFxCount;
/// decimal as string
@JsonKey(
name: r'savings_rub',
required: true,
includeIfNull: false,
)
final String savingsRub;
/// decimal as string
@JsonKey(
name: r'total_rub',
required: true,
includeIfNull: false,
)
final String totalRub;
@override
bool operator ==(Object other) => identical(this, other) || other is NetWorthDay &&
other.byCurrency == byCurrency &&
other.d == d &&
other.debtRub == debtRub &&
other.investmentRub == investmentRub &&
other.liquidRub == liquidRub &&
other.missingFxCount == missingFxCount &&
other.savingsRub == savingsRub &&
other.totalRub == totalRub;
@override
int get hashCode =>
byCurrency.hashCode +
d.hashCode +
debtRub.hashCode +
investmentRub.hashCode +
liquidRub.hashCode +
missingFxCount.hashCode +
savingsRub.hashCode +
totalRub.hashCode;
factory NetWorthDay.fromJson(Map<String, dynamic> json) => _$NetWorthDayFromJson(json);
Map<String, dynamic> toJson() => _$NetWorthDayToJson(this);
@override
String toString() {
return toJson().toString();
}
}
@@ -0,0 +1,197 @@
// GENERATED CODE - DO NOT MODIFY BY HAND
part of 'net_worth_day.dart';
// **************************************************************************
// CopyWithGenerator
// **************************************************************************
abstract class _$NetWorthDayCWProxy {
NetWorthDay byCurrency(Map<String, String> byCurrency);
NetWorthDay d(DateTime d);
NetWorthDay debtRub(String debtRub);
NetWorthDay investmentRub(String investmentRub);
NetWorthDay liquidRub(String liquidRub);
NetWorthDay missingFxCount(int missingFxCount);
NetWorthDay savingsRub(String savingsRub);
NetWorthDay totalRub(String totalRub);
/// This function **does support** nullification of nullable fields. All `null` values passed to `non-nullable` fields will be ignored. You can also use `NetWorthDay(...).copyWith.fieldName(...)` to override fields one at a time with nullification support.
///
/// Usage
/// ```dart
/// NetWorthDay(...).copyWith(id: 12, name: "My name")
/// ````
NetWorthDay call({
Map<String, String> byCurrency,
DateTime d,
String debtRub,
String investmentRub,
String liquidRub,
int missingFxCount,
String savingsRub,
String totalRub,
});
}
/// Proxy class for `copyWith` functionality. This is a callable class and can be used as follows: `instanceOfNetWorthDay.copyWith(...)`. Additionally contains functions for specific fields e.g. `instanceOfNetWorthDay.copyWith.fieldName(...)`
class _$NetWorthDayCWProxyImpl implements _$NetWorthDayCWProxy {
const _$NetWorthDayCWProxyImpl(this._value);
final NetWorthDay _value;
@override
NetWorthDay byCurrency(Map<String, String> byCurrency) =>
this(byCurrency: byCurrency);
@override
NetWorthDay d(DateTime d) => this(d: d);
@override
NetWorthDay debtRub(String debtRub) => this(debtRub: debtRub);
@override
NetWorthDay investmentRub(String investmentRub) =>
this(investmentRub: investmentRub);
@override
NetWorthDay liquidRub(String liquidRub) => this(liquidRub: liquidRub);
@override
NetWorthDay missingFxCount(int missingFxCount) =>
this(missingFxCount: missingFxCount);
@override
NetWorthDay savingsRub(String savingsRub) => this(savingsRub: savingsRub);
@override
NetWorthDay totalRub(String totalRub) => this(totalRub: totalRub);
@override
/// This function **does support** nullification of nullable fields. All `null` values passed to `non-nullable` fields will be ignored. You can also use `NetWorthDay(...).copyWith.fieldName(...)` to override fields one at a time with nullification support.
///
/// Usage
/// ```dart
/// NetWorthDay(...).copyWith(id: 12, name: "My name")
/// ````
NetWorthDay call({
Object? byCurrency = const $CopyWithPlaceholder(),
Object? d = const $CopyWithPlaceholder(),
Object? debtRub = const $CopyWithPlaceholder(),
Object? investmentRub = const $CopyWithPlaceholder(),
Object? liquidRub = const $CopyWithPlaceholder(),
Object? missingFxCount = const $CopyWithPlaceholder(),
Object? savingsRub = const $CopyWithPlaceholder(),
Object? totalRub = const $CopyWithPlaceholder(),
}) {
return NetWorthDay(
byCurrency: byCurrency == const $CopyWithPlaceholder()
? _value.byCurrency
// ignore: cast_nullable_to_non_nullable
: byCurrency as Map<String, String>,
d: d == const $CopyWithPlaceholder()
? _value.d
// ignore: cast_nullable_to_non_nullable
: d as DateTime,
debtRub: debtRub == const $CopyWithPlaceholder()
? _value.debtRub
// ignore: cast_nullable_to_non_nullable
: debtRub as String,
investmentRub: investmentRub == const $CopyWithPlaceholder()
? _value.investmentRub
// ignore: cast_nullable_to_non_nullable
: investmentRub as String,
liquidRub: liquidRub == const $CopyWithPlaceholder()
? _value.liquidRub
// ignore: cast_nullable_to_non_nullable
: liquidRub as String,
missingFxCount: missingFxCount == const $CopyWithPlaceholder()
? _value.missingFxCount
// ignore: cast_nullable_to_non_nullable
: missingFxCount as int,
savingsRub: savingsRub == const $CopyWithPlaceholder()
? _value.savingsRub
// ignore: cast_nullable_to_non_nullable
: savingsRub as String,
totalRub: totalRub == const $CopyWithPlaceholder()
? _value.totalRub
// ignore: cast_nullable_to_non_nullable
: totalRub as String,
);
}
}
extension $NetWorthDayCopyWith on NetWorthDay {
/// Returns a callable class that can be used as follows: `instanceOfNetWorthDay.copyWith(...)` or like so:`instanceOfNetWorthDay.copyWith.fieldName(...)`.
// ignore: library_private_types_in_public_api
_$NetWorthDayCWProxy get copyWith => _$NetWorthDayCWProxyImpl(this);
}
// **************************************************************************
// JsonSerializableGenerator
// **************************************************************************
NetWorthDay _$NetWorthDayFromJson(Map<String, dynamic> json) => $checkedCreate(
'NetWorthDay',
json,
($checkedConvert) {
$checkKeys(
json,
requiredKeys: const [
'by_currency',
'd',
'debt_rub',
'investment_rub',
'liquid_rub',
'missing_fx_count',
'savings_rub',
'total_rub',
],
);
final val = NetWorthDay(
byCurrency: $checkedConvert(
'by_currency',
(v) => Map<String, String>.from(v as Map),
),
d: $checkedConvert('d', (v) => DateTime.parse(v as String)),
debtRub: $checkedConvert('debt_rub', (v) => v as String),
investmentRub: $checkedConvert('investment_rub', (v) => v as String),
liquidRub: $checkedConvert('liquid_rub', (v) => v as String),
missingFxCount: $checkedConvert(
'missing_fx_count',
(v) => (v as num).toInt(),
),
savingsRub: $checkedConvert('savings_rub', (v) => v as String),
totalRub: $checkedConvert('total_rub', (v) => v as String),
);
return val;
},
fieldKeyMap: const {
'byCurrency': 'by_currency',
'debtRub': 'debt_rub',
'investmentRub': 'investment_rub',
'liquidRub': 'liquid_rub',
'missingFxCount': 'missing_fx_count',
'savingsRub': 'savings_rub',
'totalRub': 'total_rub',
},
);
Map<String, dynamic> _$NetWorthDayToJson(NetWorthDay instance) =>
<String, dynamic>{
'by_currency': instance.byCurrency,
'd': instance.d.toIso8601String(),
'debt_rub': instance.debtRub,
'investment_rub': instance.investmentRub,
'liquid_rub': instance.liquidRub,
'missing_fx_count': instance.missingFxCount,
'savings_rub': instance.savingsRub,
'total_rub': instance.totalRub,
};
@@ -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 'problem.g.dart';
@CopyWith()
@JsonSerializable(
checked: true,
createToJson: true,
disallowUnrecognizedKeys: false,
explicitToJson: true,
)
class Problem {
/// Returns a new [Problem] instance.
Problem({
this.detail,
this.errors,
required this.status,
required this.title,
});
@JsonKey(
name: r'detail',
required: false,
includeIfNull: false,
)
final String? detail;
@JsonKey(
name: r'errors',
required: false,
includeIfNull: false,
)
final List<Object>? errors;
@JsonKey(
name: r'status',
required: true,
includeIfNull: false,
)
final int status;
@JsonKey(
name: r'title',
required: true,
includeIfNull: false,
)
final String title;
@override
bool operator ==(Object other) => identical(this, other) || other is Problem &&
other.detail == detail &&
other.errors == errors &&
other.status == status &&
other.title == title;
@override
int get hashCode =>
detail.hashCode +
errors.hashCode +
status.hashCode +
title.hashCode;
factory Problem.fromJson(Map<String, dynamic> json) => _$ProblemFromJson(json);
Map<String, dynamic> toJson() => _$ProblemToJson(this);
@override
String toString() {
return toJson().toString();
}
}
@@ -0,0 +1,114 @@
// GENERATED CODE - DO NOT MODIFY BY HAND
part of 'problem.dart';
// **************************************************************************
// CopyWithGenerator
// **************************************************************************
abstract class _$ProblemCWProxy {
Problem detail(String? detail);
Problem errors(List<Object>? errors);
Problem status(int status);
Problem title(String title);
/// This function **does support** nullification of nullable fields. All `null` values passed to `non-nullable` fields will be ignored. You can also use `Problem(...).copyWith.fieldName(...)` to override fields one at a time with nullification support.
///
/// Usage
/// ```dart
/// Problem(...).copyWith(id: 12, name: "My name")
/// ````
Problem call({
String? detail,
List<Object>? errors,
int status,
String title,
});
}
/// Proxy class for `copyWith` functionality. This is a callable class and can be used as follows: `instanceOfProblem.copyWith(...)`. Additionally contains functions for specific fields e.g. `instanceOfProblem.copyWith.fieldName(...)`
class _$ProblemCWProxyImpl implements _$ProblemCWProxy {
const _$ProblemCWProxyImpl(this._value);
final Problem _value;
@override
Problem detail(String? detail) => this(detail: detail);
@override
Problem errors(List<Object>? errors) => this(errors: errors);
@override
Problem status(int status) => this(status: status);
@override
Problem title(String title) => this(title: title);
@override
/// This function **does support** nullification of nullable fields. All `null` values passed to `non-nullable` fields will be ignored. You can also use `Problem(...).copyWith.fieldName(...)` to override fields one at a time with nullification support.
///
/// Usage
/// ```dart
/// Problem(...).copyWith(id: 12, name: "My name")
/// ````
Problem call({
Object? detail = const $CopyWithPlaceholder(),
Object? errors = const $CopyWithPlaceholder(),
Object? status = const $CopyWithPlaceholder(),
Object? title = const $CopyWithPlaceholder(),
}) {
return Problem(
detail: detail == const $CopyWithPlaceholder()
? _value.detail
// ignore: cast_nullable_to_non_nullable
: detail as String?,
errors: errors == const $CopyWithPlaceholder()
? _value.errors
// ignore: cast_nullable_to_non_nullable
: errors as List<Object>?,
status: status == const $CopyWithPlaceholder()
? _value.status
// ignore: cast_nullable_to_non_nullable
: status as int,
title: title == const $CopyWithPlaceholder()
? _value.title
// ignore: cast_nullable_to_non_nullable
: title as String,
);
}
}
extension $ProblemCopyWith on Problem {
/// Returns a callable class that can be used as follows: `instanceOfProblem.copyWith(...)` or like so:`instanceOfProblem.copyWith.fieldName(...)`.
// ignore: library_private_types_in_public_api
_$ProblemCWProxy get copyWith => _$ProblemCWProxyImpl(this);
}
// **************************************************************************
// JsonSerializableGenerator
// **************************************************************************
Problem _$ProblemFromJson(Map<String, dynamic> json) =>
$checkedCreate('Problem', json, ($checkedConvert) {
$checkKeys(json, requiredKeys: const ['status', 'title']);
final val = Problem(
detail: $checkedConvert('detail', (v) => v as String?),
errors: $checkedConvert(
'errors',
(v) => (v as List<dynamic>?)?.map((e) => e as Object).toList(),
),
status: $checkedConvert('status', (v) => (v as num).toInt()),
title: $checkedConvert('title', (v) => v as String),
);
return val;
});
Map<String, dynamic> _$ProblemToJson(Problem instance) => <String, dynamic>{
'detail': ?instance.detail,
'errors': ?instance.errors,
'status': instance.status,
'title': instance.title,
};
@@ -0,0 +1,122 @@
//
// 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 'refresh_log_out.g.dart';
@CopyWith()
@JsonSerializable(
checked: true,
createToJson: true,
disallowUnrecognizedKeys: false,
explicitToJson: true,
)
class RefreshLogOut {
/// Returns a new [RefreshLogOut] instance.
RefreshLogOut({
required this.error,
required this.finishedAt,
required this.id,
required this.startedAt,
required this.trigger,
});
@JsonKey(
name: r'error',
required: true,
includeIfNull: true,
)
final String? error;
@JsonKey(
name: r'finished_at',
required: true,
includeIfNull: true,
)
final DateTime? finishedAt;
@JsonKey(
name: r'id',
required: true,
includeIfNull: false,
)
final int id;
@JsonKey(
name: r'started_at',
required: true,
includeIfNull: false,
)
final DateTime startedAt;
@JsonKey(
name: r'trigger',
required: true,
includeIfNull: false,
)
final String trigger;
@override
bool operator ==(Object other) => identical(this, other) || other is RefreshLogOut &&
other.error == error &&
other.finishedAt == finishedAt &&
other.id == id &&
other.startedAt == startedAt &&
other.trigger == trigger;
@override
int get hashCode =>
(error == null ? 0 : error.hashCode) +
(finishedAt == null ? 0 : finishedAt.hashCode) +
id.hashCode +
startedAt.hashCode +
trigger.hashCode;
factory RefreshLogOut.fromJson(Map<String, dynamic> json) => _$RefreshLogOutFromJson(json);
Map<String, dynamic> toJson() => _$RefreshLogOutToJson(this);
@override
String toString() {
return toJson().toString();
}
}
@@ -0,0 +1,149 @@
// GENERATED CODE - DO NOT MODIFY BY HAND
part of 'refresh_log_out.dart';
// **************************************************************************
// CopyWithGenerator
// **************************************************************************
abstract class _$RefreshLogOutCWProxy {
RefreshLogOut error(String? error);
RefreshLogOut finishedAt(DateTime? finishedAt);
RefreshLogOut id(int id);
RefreshLogOut startedAt(DateTime startedAt);
RefreshLogOut trigger(String trigger);
/// This function **does support** nullification of nullable fields. All `null` values passed to `non-nullable` fields will be ignored. You can also use `RefreshLogOut(...).copyWith.fieldName(...)` to override fields one at a time with nullification support.
///
/// Usage
/// ```dart
/// RefreshLogOut(...).copyWith(id: 12, name: "My name")
/// ````
RefreshLogOut call({
String? error,
DateTime? finishedAt,
int id,
DateTime startedAt,
String trigger,
});
}
/// Proxy class for `copyWith` functionality. This is a callable class and can be used as follows: `instanceOfRefreshLogOut.copyWith(...)`. Additionally contains functions for specific fields e.g. `instanceOfRefreshLogOut.copyWith.fieldName(...)`
class _$RefreshLogOutCWProxyImpl implements _$RefreshLogOutCWProxy {
const _$RefreshLogOutCWProxyImpl(this._value);
final RefreshLogOut _value;
@override
RefreshLogOut error(String? error) => this(error: error);
@override
RefreshLogOut finishedAt(DateTime? finishedAt) =>
this(finishedAt: finishedAt);
@override
RefreshLogOut id(int id) => this(id: id);
@override
RefreshLogOut startedAt(DateTime startedAt) => this(startedAt: startedAt);
@override
RefreshLogOut trigger(String trigger) => this(trigger: trigger);
@override
/// This function **does support** nullification of nullable fields. All `null` values passed to `non-nullable` fields will be ignored. You can also use `RefreshLogOut(...).copyWith.fieldName(...)` to override fields one at a time with nullification support.
///
/// Usage
/// ```dart
/// RefreshLogOut(...).copyWith(id: 12, name: "My name")
/// ````
RefreshLogOut call({
Object? error = const $CopyWithPlaceholder(),
Object? finishedAt = const $CopyWithPlaceholder(),
Object? id = const $CopyWithPlaceholder(),
Object? startedAt = const $CopyWithPlaceholder(),
Object? trigger = const $CopyWithPlaceholder(),
}) {
return RefreshLogOut(
error: error == const $CopyWithPlaceholder()
? _value.error
// ignore: cast_nullable_to_non_nullable
: error as String?,
finishedAt: finishedAt == const $CopyWithPlaceholder()
? _value.finishedAt
// ignore: cast_nullable_to_non_nullable
: finishedAt as DateTime?,
id: id == const $CopyWithPlaceholder()
? _value.id
// ignore: cast_nullable_to_non_nullable
: id as int,
startedAt: startedAt == const $CopyWithPlaceholder()
? _value.startedAt
// ignore: cast_nullable_to_non_nullable
: startedAt as DateTime,
trigger: trigger == const $CopyWithPlaceholder()
? _value.trigger
// ignore: cast_nullable_to_non_nullable
: trigger as String,
);
}
}
extension $RefreshLogOutCopyWith on RefreshLogOut {
/// Returns a callable class that can be used as follows: `instanceOfRefreshLogOut.copyWith(...)` or like so:`instanceOfRefreshLogOut.copyWith.fieldName(...)`.
// ignore: library_private_types_in_public_api
_$RefreshLogOutCWProxy get copyWith => _$RefreshLogOutCWProxyImpl(this);
}
// **************************************************************************
// JsonSerializableGenerator
// **************************************************************************
RefreshLogOut _$RefreshLogOutFromJson(Map<String, dynamic> json) =>
$checkedCreate(
'RefreshLogOut',
json,
($checkedConvert) {
$checkKeys(
json,
requiredKeys: const [
'error',
'finished_at',
'id',
'started_at',
'trigger',
],
);
final val = RefreshLogOut(
error: $checkedConvert('error', (v) => v as String?),
finishedAt: $checkedConvert(
'finished_at',
(v) => v == null ? null : DateTime.parse(v as String),
),
id: $checkedConvert('id', (v) => (v as num).toInt()),
startedAt: $checkedConvert(
'started_at',
(v) => DateTime.parse(v as String),
),
trigger: $checkedConvert('trigger', (v) => v as String),
);
return val;
},
fieldKeyMap: const {
'finishedAt': 'finished_at',
'startedAt': 'started_at',
},
);
Map<String, dynamic> _$RefreshLogOutToJson(RefreshLogOut instance) =>
<String, dynamic>{
'error': instance.error,
'finished_at': instance.finishedAt?.toIso8601String(),
'id': instance.id,
'started_at': instance.startedAt.toIso8601String(),
'trigger': instance.trigger,
};
@@ -0,0 +1,58 @@
//
// 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 'refresh_request.g.dart';
@CopyWith()
@JsonSerializable(
checked: true,
createToJson: true,
disallowUnrecognizedKeys: false,
explicitToJson: true,
)
class RefreshRequest {
/// Returns a new [RefreshRequest] instance.
RefreshRequest({
required this.refreshToken,
});
@JsonKey(
name: r'refresh_token',
required: true,
includeIfNull: false,
)
final String refreshToken;
@override
bool operator ==(Object other) => identical(this, other) || other is RefreshRequest &&
other.refreshToken == refreshToken;
@override
int get hashCode =>
refreshToken.hashCode;
factory RefreshRequest.fromJson(Map<String, dynamic> json) => _$RefreshRequestFromJson(json);
Map<String, dynamic> toJson() => _$RefreshRequestToJson(this);
@override
String toString() {
return toJson().toString();
}
}
@@ -0,0 +1,68 @@
// GENERATED CODE - DO NOT MODIFY BY HAND
part of 'refresh_request.dart';
// **************************************************************************
// CopyWithGenerator
// **************************************************************************
abstract class _$RefreshRequestCWProxy {
RefreshRequest refreshToken(String refreshToken);
/// This function **does support** nullification of nullable fields. All `null` values passed to `non-nullable` fields will be ignored. You can also use `RefreshRequest(...).copyWith.fieldName(...)` to override fields one at a time with nullification support.
///
/// Usage
/// ```dart
/// RefreshRequest(...).copyWith(id: 12, name: "My name")
/// ````
RefreshRequest call({String refreshToken});
}
/// Proxy class for `copyWith` functionality. This is a callable class and can be used as follows: `instanceOfRefreshRequest.copyWith(...)`. Additionally contains functions for specific fields e.g. `instanceOfRefreshRequest.copyWith.fieldName(...)`
class _$RefreshRequestCWProxyImpl implements _$RefreshRequestCWProxy {
const _$RefreshRequestCWProxyImpl(this._value);
final RefreshRequest _value;
@override
RefreshRequest refreshToken(String refreshToken) =>
this(refreshToken: refreshToken);
@override
/// This function **does support** nullification of nullable fields. All `null` values passed to `non-nullable` fields will be ignored. You can also use `RefreshRequest(...).copyWith.fieldName(...)` to override fields one at a time with nullification support.
///
/// Usage
/// ```dart
/// RefreshRequest(...).copyWith(id: 12, name: "My name")
/// ````
RefreshRequest call({Object? refreshToken = const $CopyWithPlaceholder()}) {
return RefreshRequest(
refreshToken: refreshToken == const $CopyWithPlaceholder()
? _value.refreshToken
// ignore: cast_nullable_to_non_nullable
: refreshToken as String,
);
}
}
extension $RefreshRequestCopyWith on RefreshRequest {
/// Returns a callable class that can be used as follows: `instanceOfRefreshRequest.copyWith(...)` or like so:`instanceOfRefreshRequest.copyWith.fieldName(...)`.
// ignore: library_private_types_in_public_api
_$RefreshRequestCWProxy get copyWith => _$RefreshRequestCWProxyImpl(this);
}
// **************************************************************************
// JsonSerializableGenerator
// **************************************************************************
RefreshRequest _$RefreshRequestFromJson(Map<String, dynamic> json) =>
$checkedCreate('RefreshRequest', json, ($checkedConvert) {
$checkKeys(json, requiredKeys: const ['refresh_token']);
final val = RefreshRequest(
refreshToken: $checkedConvert('refresh_token', (v) => v as String),
);
return val;
}, fieldKeyMap: const {'refreshToken': 'refresh_token'});
Map<String, dynamic> _$RefreshRequestToJson(RefreshRequest instance) =>
<String, dynamic>{'refresh_token': instance.refreshToken};
@@ -0,0 +1,158 @@
//
// AUTO-GENERATED FILE, DO NOT MODIFY!
//
// ignore_for_file: unused_element
import 'package:fintracker_api/src/model/rule_match_type.dart';
import 'package:fintracker_api/src/model/rule_kind.dart';
import 'package:copy_with_extension/copy_with_extension.dart';
import 'package:json_annotation/json_annotation.dart';
part 'rule_create.g.dart';
@CopyWith()
@JsonSerializable(
checked: true,
createToJson: true,
disallowUnrecognizedKeys: false,
explicitToJson: true,
)
class RuleCreate {
/// Returns a new [RuleCreate] instance.
RuleCreate({
this.enabled = true,
required this.kind,
required this.matchType,
this.note,
required this.pattern,
this.priority = 100,
this.value,
});
@JsonKey(
defaultValue: true,
name: r'enabled',
required: false,
includeIfNull: false,
)
final bool? enabled;
@JsonKey(
name: r'kind',
required: true,
includeIfNull: false,
unknownEnumValue: RuleKind.unknownDefaultOpenApi,
)
final RuleKind kind;
@JsonKey(
name: r'match_type',
required: true,
includeIfNull: false,
unknownEnumValue: RuleMatchType.unknownDefaultOpenApi,
)
final RuleMatchType matchType;
@JsonKey(
name: r'note',
required: false,
includeIfNull: false,
)
final String? note;
@JsonKey(
name: r'pattern',
required: true,
includeIfNull: false,
)
final String pattern;
@JsonKey(
defaultValue: 100,
name: r'priority',
required: false,
includeIfNull: false,
)
final int? priority;
@JsonKey(
name: r'value',
required: false,
includeIfNull: false,
)
final String? value;
@override
bool operator ==(Object other) => identical(this, other) || other is RuleCreate &&
other.enabled == enabled &&
other.kind == kind &&
other.matchType == matchType &&
other.note == note &&
other.pattern == pattern &&
other.priority == priority &&
other.value == value;
@override
int get hashCode =>
enabled.hashCode +
kind.hashCode +
matchType.hashCode +
(note == null ? 0 : note.hashCode) +
pattern.hashCode +
priority.hashCode +
(value == null ? 0 : value.hashCode);
factory RuleCreate.fromJson(Map<String, dynamic> json) => _$RuleCreateFromJson(json);
Map<String, dynamic> toJson() => _$RuleCreateToJson(this);
@override
String toString() {
return toJson().toString();
}
}

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