chore(app): сгенерированный Dart-клиент из OpenAPI
openapi-generator-cli -g dart-dio. Генерируется, но коммитится: CI ловит дрейф openapi/openapi.json, а приложение собирается без запуска генератора. Пересобирается через just gen-client после любого изменения роутов.
This commit is contained in:
@@ -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';
|
||||
|
||||
@@ -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 `months` 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 `parent_id`.
|
||||
///
|
||||
/// 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's buckets, plus every account'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'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();
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -0,0 +1,189 @@
|
||||
// GENERATED CODE - DO NOT MODIFY BY HAND
|
||||
|
||||
part of 'rule_create.dart';
|
||||
|
||||
// **************************************************************************
|
||||
// CopyWithGenerator
|
||||
// **************************************************************************
|
||||
|
||||
abstract class _$RuleCreateCWProxy {
|
||||
RuleCreate enabled(bool? enabled);
|
||||
|
||||
RuleCreate kind(RuleKind kind);
|
||||
|
||||
RuleCreate matchType(RuleMatchType matchType);
|
||||
|
||||
RuleCreate note(String? note);
|
||||
|
||||
RuleCreate pattern(String pattern);
|
||||
|
||||
RuleCreate priority(int? priority);
|
||||
|
||||
RuleCreate value(String? value);
|
||||
|
||||
/// This function **does support** nullification of nullable fields. All `null` values passed to `non-nullable` fields will be ignored. You can also use `RuleCreate(...).copyWith.fieldName(...)` to override fields one at a time with nullification support.
|
||||
///
|
||||
/// Usage
|
||||
/// ```dart
|
||||
/// RuleCreate(...).copyWith(id: 12, name: "My name")
|
||||
/// ````
|
||||
RuleCreate call({
|
||||
bool? enabled,
|
||||
RuleKind kind,
|
||||
RuleMatchType matchType,
|
||||
String? note,
|
||||
String pattern,
|
||||
int? priority,
|
||||
String? value,
|
||||
});
|
||||
}
|
||||
|
||||
/// Proxy class for `copyWith` functionality. This is a callable class and can be used as follows: `instanceOfRuleCreate.copyWith(...)`. Additionally contains functions for specific fields e.g. `instanceOfRuleCreate.copyWith.fieldName(...)`
|
||||
class _$RuleCreateCWProxyImpl implements _$RuleCreateCWProxy {
|
||||
const _$RuleCreateCWProxyImpl(this._value);
|
||||
|
||||
final RuleCreate _value;
|
||||
|
||||
@override
|
||||
RuleCreate enabled(bool? enabled) => this(enabled: enabled);
|
||||
|
||||
@override
|
||||
RuleCreate kind(RuleKind kind) => this(kind: kind);
|
||||
|
||||
@override
|
||||
RuleCreate matchType(RuleMatchType matchType) => this(matchType: matchType);
|
||||
|
||||
@override
|
||||
RuleCreate note(String? note) => this(note: note);
|
||||
|
||||
@override
|
||||
RuleCreate pattern(String pattern) => this(pattern: pattern);
|
||||
|
||||
@override
|
||||
RuleCreate priority(int? priority) => this(priority: priority);
|
||||
|
||||
@override
|
||||
RuleCreate value(String? value) => this(value: value);
|
||||
|
||||
@override
|
||||
/// This function **does support** nullification of nullable fields. All `null` values passed to `non-nullable` fields will be ignored. You can also use `RuleCreate(...).copyWith.fieldName(...)` to override fields one at a time with nullification support.
|
||||
///
|
||||
/// Usage
|
||||
/// ```dart
|
||||
/// RuleCreate(...).copyWith(id: 12, name: "My name")
|
||||
/// ````
|
||||
RuleCreate call({
|
||||
Object? enabled = const $CopyWithPlaceholder(),
|
||||
Object? kind = const $CopyWithPlaceholder(),
|
||||
Object? matchType = const $CopyWithPlaceholder(),
|
||||
Object? note = const $CopyWithPlaceholder(),
|
||||
Object? pattern = const $CopyWithPlaceholder(),
|
||||
Object? priority = const $CopyWithPlaceholder(),
|
||||
Object? value = const $CopyWithPlaceholder(),
|
||||
}) {
|
||||
return RuleCreate(
|
||||
enabled: enabled == const $CopyWithPlaceholder()
|
||||
? _value.enabled
|
||||
// ignore: cast_nullable_to_non_nullable
|
||||
: enabled as bool?,
|
||||
kind: kind == const $CopyWithPlaceholder()
|
||||
? _value.kind
|
||||
// ignore: cast_nullable_to_non_nullable
|
||||
: kind as RuleKind,
|
||||
matchType: matchType == const $CopyWithPlaceholder()
|
||||
? _value.matchType
|
||||
// ignore: cast_nullable_to_non_nullable
|
||||
: matchType as RuleMatchType,
|
||||
note: note == const $CopyWithPlaceholder()
|
||||
? _value.note
|
||||
// ignore: cast_nullable_to_non_nullable
|
||||
: note as String?,
|
||||
pattern: pattern == const $CopyWithPlaceholder()
|
||||
? _value.pattern
|
||||
// ignore: cast_nullable_to_non_nullable
|
||||
: pattern as String,
|
||||
priority: priority == const $CopyWithPlaceholder()
|
||||
? _value.priority
|
||||
// ignore: cast_nullable_to_non_nullable
|
||||
: priority as int?,
|
||||
value: value == const $CopyWithPlaceholder()
|
||||
? _value.value
|
||||
// ignore: cast_nullable_to_non_nullable
|
||||
: value as String?,
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
extension $RuleCreateCopyWith on RuleCreate {
|
||||
/// Returns a callable class that can be used as follows: `instanceOfRuleCreate.copyWith(...)` or like so:`instanceOfRuleCreate.copyWith.fieldName(...)`.
|
||||
// ignore: library_private_types_in_public_api
|
||||
_$RuleCreateCWProxy get copyWith => _$RuleCreateCWProxyImpl(this);
|
||||
}
|
||||
|
||||
// **************************************************************************
|
||||
// JsonSerializableGenerator
|
||||
// **************************************************************************
|
||||
|
||||
RuleCreate _$RuleCreateFromJson(Map<String, dynamic> json) => $checkedCreate(
|
||||
'RuleCreate',
|
||||
json,
|
||||
($checkedConvert) {
|
||||
$checkKeys(json, requiredKeys: const ['kind', 'match_type', 'pattern']);
|
||||
final val = RuleCreate(
|
||||
enabled: $checkedConvert('enabled', (v) => v as bool? ?? true),
|
||||
kind: $checkedConvert(
|
||||
'kind',
|
||||
(v) => $enumDecode(
|
||||
_$RuleKindEnumMap,
|
||||
v,
|
||||
unknownValue: RuleKind.unknownDefaultOpenApi,
|
||||
),
|
||||
),
|
||||
matchType: $checkedConvert(
|
||||
'match_type',
|
||||
(v) => $enumDecode(
|
||||
_$RuleMatchTypeEnumMap,
|
||||
v,
|
||||
unknownValue: RuleMatchType.unknownDefaultOpenApi,
|
||||
),
|
||||
),
|
||||
note: $checkedConvert('note', (v) => v as String?),
|
||||
pattern: $checkedConvert('pattern', (v) => v as String),
|
||||
priority: $checkedConvert('priority', (v) => (v as num?)?.toInt() ?? 100),
|
||||
value: $checkedConvert('value', (v) => v as String?),
|
||||
);
|
||||
return val;
|
||||
},
|
||||
fieldKeyMap: const {'matchType': 'match_type'},
|
||||
);
|
||||
|
||||
Map<String, dynamic> _$RuleCreateToJson(RuleCreate instance) =>
|
||||
<String, dynamic>{
|
||||
'enabled': ?instance.enabled,
|
||||
'kind': _$RuleKindEnumMap[instance.kind]!,
|
||||
'match_type': _$RuleMatchTypeEnumMap[instance.matchType]!,
|
||||
'note': ?instance.note,
|
||||
'pattern': instance.pattern,
|
||||
'priority': ?instance.priority,
|
||||
'value': ?instance.value,
|
||||
};
|
||||
|
||||
const _$RuleKindEnumMap = {
|
||||
RuleKind.savings: 'savings',
|
||||
RuleKind.oneOff: 'one_off',
|
||||
RuleKind.category: 'category',
|
||||
RuleKind.payee: 'payee',
|
||||
RuleKind.brokerTarget: 'broker_target',
|
||||
RuleKind.ignore: 'ignore',
|
||||
RuleKind.unknownDefaultOpenApi: 'unknown_default_open_api',
|
||||
};
|
||||
|
||||
const _$RuleMatchTypeEnumMap = {
|
||||
RuleMatchType.id: 'id',
|
||||
RuleMatchType.payee: 'payee',
|
||||
RuleMatchType.comment: 'comment',
|
||||
RuleMatchType.category: 'category',
|
||||
RuleMatchType.mcc: 'mcc',
|
||||
RuleMatchType.account: 'account',
|
||||
RuleMatchType.unknownDefaultOpenApi: 'unknown_default_open_api',
|
||||
};
|
||||
@@ -0,0 +1,30 @@
|
||||
//
|
||||
// AUTO-GENERATED FILE, DO NOT MODIFY!
|
||||
//
|
||||
|
||||
// ignore_for_file: unused_element
|
||||
import 'package:json_annotation/json_annotation.dart';
|
||||
|
||||
enum RuleKind {
|
||||
@JsonValue(r'savings')
|
||||
savings(r'savings'),
|
||||
@JsonValue(r'one_off')
|
||||
oneOff(r'one_off'),
|
||||
@JsonValue(r'category')
|
||||
category(r'category'),
|
||||
@JsonValue(r'payee')
|
||||
payee(r'payee'),
|
||||
@JsonValue(r'broker_target')
|
||||
brokerTarget(r'broker_target'),
|
||||
@JsonValue(r'ignore')
|
||||
ignore(r'ignore'),
|
||||
@JsonValue(r'unknown_default_open_api')
|
||||
unknownDefaultOpenApi(r'unknown_default_open_api');
|
||||
|
||||
const RuleKind(this.value);
|
||||
|
||||
final String value;
|
||||
|
||||
@override
|
||||
String toString() => value;
|
||||
}
|
||||
@@ -0,0 +1,30 @@
|
||||
//
|
||||
// AUTO-GENERATED FILE, DO NOT MODIFY!
|
||||
//
|
||||
|
||||
// ignore_for_file: unused_element
|
||||
import 'package:json_annotation/json_annotation.dart';
|
||||
|
||||
enum RuleMatchType {
|
||||
@JsonValue(r'id')
|
||||
id(r'id'),
|
||||
@JsonValue(r'payee')
|
||||
payee(r'payee'),
|
||||
@JsonValue(r'comment')
|
||||
comment(r'comment'),
|
||||
@JsonValue(r'category')
|
||||
category(r'category'),
|
||||
@JsonValue(r'mcc')
|
||||
mcc(r'mcc'),
|
||||
@JsonValue(r'account')
|
||||
account(r'account'),
|
||||
@JsonValue(r'unknown_default_open_api')
|
||||
unknownDefaultOpenApi(r'unknown_default_open_api');
|
||||
|
||||
const RuleMatchType(this.value);
|
||||
|
||||
final String value;
|
||||
|
||||
@override
|
||||
String toString() => value;
|
||||
}
|
||||
@@ -0,0 +1,206 @@
|
||||
//
|
||||
// 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_out.g.dart';
|
||||
|
||||
|
||||
@CopyWith()
|
||||
@JsonSerializable(
|
||||
checked: true,
|
||||
createToJson: true,
|
||||
disallowUnrecognizedKeys: false,
|
||||
explicitToJson: true,
|
||||
)
|
||||
class RuleOut {
|
||||
/// Returns a new [RuleOut] instance.
|
||||
RuleOut({
|
||||
|
||||
required this.enabled,
|
||||
|
||||
required this.id,
|
||||
|
||||
required this.kind,
|
||||
|
||||
required this.lastMatchedAt,
|
||||
|
||||
required this.matchCount,
|
||||
|
||||
required this.matchType,
|
||||
|
||||
required this.note,
|
||||
|
||||
required this.pattern,
|
||||
|
||||
required this.priority,
|
||||
|
||||
required this.value,
|
||||
});
|
||||
|
||||
@JsonKey(
|
||||
|
||||
name: r'enabled',
|
||||
required: true,
|
||||
includeIfNull: false,
|
||||
)
|
||||
|
||||
|
||||
final bool enabled;
|
||||
|
||||
|
||||
|
||||
@JsonKey(
|
||||
|
||||
name: r'id',
|
||||
required: true,
|
||||
includeIfNull: false,
|
||||
)
|
||||
|
||||
|
||||
final int id;
|
||||
|
||||
|
||||
|
||||
@JsonKey(
|
||||
|
||||
name: r'kind',
|
||||
required: true,
|
||||
includeIfNull: false,
|
||||
unknownEnumValue: RuleKind.unknownDefaultOpenApi,
|
||||
)
|
||||
|
||||
|
||||
final RuleKind kind;
|
||||
|
||||
|
||||
|
||||
@JsonKey(
|
||||
|
||||
name: r'last_matched_at',
|
||||
required: true,
|
||||
includeIfNull: true,
|
||||
)
|
||||
|
||||
|
||||
final DateTime? lastMatchedAt;
|
||||
|
||||
|
||||
|
||||
@JsonKey(
|
||||
|
||||
name: r'match_count',
|
||||
required: true,
|
||||
includeIfNull: false,
|
||||
)
|
||||
|
||||
|
||||
final int matchCount;
|
||||
|
||||
|
||||
|
||||
@JsonKey(
|
||||
|
||||
name: r'match_type',
|
||||
required: true,
|
||||
includeIfNull: false,
|
||||
unknownEnumValue: RuleMatchType.unknownDefaultOpenApi,
|
||||
)
|
||||
|
||||
|
||||
final RuleMatchType matchType;
|
||||
|
||||
|
||||
|
||||
@JsonKey(
|
||||
|
||||
name: r'note',
|
||||
required: true,
|
||||
includeIfNull: true,
|
||||
)
|
||||
|
||||
|
||||
final String? note;
|
||||
|
||||
|
||||
|
||||
@JsonKey(
|
||||
|
||||
name: r'pattern',
|
||||
required: true,
|
||||
includeIfNull: false,
|
||||
)
|
||||
|
||||
|
||||
final String pattern;
|
||||
|
||||
|
||||
|
||||
@JsonKey(
|
||||
|
||||
name: r'priority',
|
||||
required: true,
|
||||
includeIfNull: false,
|
||||
)
|
||||
|
||||
|
||||
final int priority;
|
||||
|
||||
|
||||
|
||||
@JsonKey(
|
||||
|
||||
name: r'value',
|
||||
required: true,
|
||||
includeIfNull: true,
|
||||
)
|
||||
|
||||
|
||||
final String? value;
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
@override
|
||||
bool operator ==(Object other) => identical(this, other) || other is RuleOut &&
|
||||
other.enabled == enabled &&
|
||||
other.id == id &&
|
||||
other.kind == kind &&
|
||||
other.lastMatchedAt == lastMatchedAt &&
|
||||
other.matchCount == matchCount &&
|
||||
other.matchType == matchType &&
|
||||
other.note == note &&
|
||||
other.pattern == pattern &&
|
||||
other.priority == priority &&
|
||||
other.value == value;
|
||||
|
||||
@override
|
||||
int get hashCode =>
|
||||
enabled.hashCode +
|
||||
id.hashCode +
|
||||
kind.hashCode +
|
||||
(lastMatchedAt == null ? 0 : lastMatchedAt.hashCode) +
|
||||
matchCount.hashCode +
|
||||
matchType.hashCode +
|
||||
(note == null ? 0 : note.hashCode) +
|
||||
pattern.hashCode +
|
||||
priority.hashCode +
|
||||
(value == null ? 0 : value.hashCode);
|
||||
|
||||
factory RuleOut.fromJson(Map<String, dynamic> json) => _$RuleOutFromJson(json);
|
||||
|
||||
Map<String, dynamic> toJson() => _$RuleOutToJson(this);
|
||||
|
||||
@override
|
||||
String toString() {
|
||||
return toJson().toString();
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -0,0 +1,249 @@
|
||||
// GENERATED CODE - DO NOT MODIFY BY HAND
|
||||
|
||||
part of 'rule_out.dart';
|
||||
|
||||
// **************************************************************************
|
||||
// CopyWithGenerator
|
||||
// **************************************************************************
|
||||
|
||||
abstract class _$RuleOutCWProxy {
|
||||
RuleOut enabled(bool enabled);
|
||||
|
||||
RuleOut id(int id);
|
||||
|
||||
RuleOut kind(RuleKind kind);
|
||||
|
||||
RuleOut lastMatchedAt(DateTime? lastMatchedAt);
|
||||
|
||||
RuleOut matchCount(int matchCount);
|
||||
|
||||
RuleOut matchType(RuleMatchType matchType);
|
||||
|
||||
RuleOut note(String? note);
|
||||
|
||||
RuleOut pattern(String pattern);
|
||||
|
||||
RuleOut priority(int priority);
|
||||
|
||||
RuleOut value(String? value);
|
||||
|
||||
/// This function **does support** nullification of nullable fields. All `null` values passed to `non-nullable` fields will be ignored. You can also use `RuleOut(...).copyWith.fieldName(...)` to override fields one at a time with nullification support.
|
||||
///
|
||||
/// Usage
|
||||
/// ```dart
|
||||
/// RuleOut(...).copyWith(id: 12, name: "My name")
|
||||
/// ````
|
||||
RuleOut call({
|
||||
bool enabled,
|
||||
int id,
|
||||
RuleKind kind,
|
||||
DateTime? lastMatchedAt,
|
||||
int matchCount,
|
||||
RuleMatchType matchType,
|
||||
String? note,
|
||||
String pattern,
|
||||
int priority,
|
||||
String? value,
|
||||
});
|
||||
}
|
||||
|
||||
/// Proxy class for `copyWith` functionality. This is a callable class and can be used as follows: `instanceOfRuleOut.copyWith(...)`. Additionally contains functions for specific fields e.g. `instanceOfRuleOut.copyWith.fieldName(...)`
|
||||
class _$RuleOutCWProxyImpl implements _$RuleOutCWProxy {
|
||||
const _$RuleOutCWProxyImpl(this._value);
|
||||
|
||||
final RuleOut _value;
|
||||
|
||||
@override
|
||||
RuleOut enabled(bool enabled) => this(enabled: enabled);
|
||||
|
||||
@override
|
||||
RuleOut id(int id) => this(id: id);
|
||||
|
||||
@override
|
||||
RuleOut kind(RuleKind kind) => this(kind: kind);
|
||||
|
||||
@override
|
||||
RuleOut lastMatchedAt(DateTime? lastMatchedAt) =>
|
||||
this(lastMatchedAt: lastMatchedAt);
|
||||
|
||||
@override
|
||||
RuleOut matchCount(int matchCount) => this(matchCount: matchCount);
|
||||
|
||||
@override
|
||||
RuleOut matchType(RuleMatchType matchType) => this(matchType: matchType);
|
||||
|
||||
@override
|
||||
RuleOut note(String? note) => this(note: note);
|
||||
|
||||
@override
|
||||
RuleOut pattern(String pattern) => this(pattern: pattern);
|
||||
|
||||
@override
|
||||
RuleOut priority(int priority) => this(priority: priority);
|
||||
|
||||
@override
|
||||
RuleOut value(String? value) => this(value: value);
|
||||
|
||||
@override
|
||||
/// This function **does support** nullification of nullable fields. All `null` values passed to `non-nullable` fields will be ignored. You can also use `RuleOut(...).copyWith.fieldName(...)` to override fields one at a time with nullification support.
|
||||
///
|
||||
/// Usage
|
||||
/// ```dart
|
||||
/// RuleOut(...).copyWith(id: 12, name: "My name")
|
||||
/// ````
|
||||
RuleOut call({
|
||||
Object? enabled = const $CopyWithPlaceholder(),
|
||||
Object? id = const $CopyWithPlaceholder(),
|
||||
Object? kind = const $CopyWithPlaceholder(),
|
||||
Object? lastMatchedAt = const $CopyWithPlaceholder(),
|
||||
Object? matchCount = const $CopyWithPlaceholder(),
|
||||
Object? matchType = const $CopyWithPlaceholder(),
|
||||
Object? note = const $CopyWithPlaceholder(),
|
||||
Object? pattern = const $CopyWithPlaceholder(),
|
||||
Object? priority = const $CopyWithPlaceholder(),
|
||||
Object? value = const $CopyWithPlaceholder(),
|
||||
}) {
|
||||
return RuleOut(
|
||||
enabled: enabled == const $CopyWithPlaceholder()
|
||||
? _value.enabled
|
||||
// ignore: cast_nullable_to_non_nullable
|
||||
: enabled as bool,
|
||||
id: id == const $CopyWithPlaceholder()
|
||||
? _value.id
|
||||
// ignore: cast_nullable_to_non_nullable
|
||||
: id as int,
|
||||
kind: kind == const $CopyWithPlaceholder()
|
||||
? _value.kind
|
||||
// ignore: cast_nullable_to_non_nullable
|
||||
: kind as RuleKind,
|
||||
lastMatchedAt: lastMatchedAt == const $CopyWithPlaceholder()
|
||||
? _value.lastMatchedAt
|
||||
// ignore: cast_nullable_to_non_nullable
|
||||
: lastMatchedAt as DateTime?,
|
||||
matchCount: matchCount == const $CopyWithPlaceholder()
|
||||
? _value.matchCount
|
||||
// ignore: cast_nullable_to_non_nullable
|
||||
: matchCount as int,
|
||||
matchType: matchType == const $CopyWithPlaceholder()
|
||||
? _value.matchType
|
||||
// ignore: cast_nullable_to_non_nullable
|
||||
: matchType as RuleMatchType,
|
||||
note: note == const $CopyWithPlaceholder()
|
||||
? _value.note
|
||||
// ignore: cast_nullable_to_non_nullable
|
||||
: note as String?,
|
||||
pattern: pattern == const $CopyWithPlaceholder()
|
||||
? _value.pattern
|
||||
// ignore: cast_nullable_to_non_nullable
|
||||
: pattern as String,
|
||||
priority: priority == const $CopyWithPlaceholder()
|
||||
? _value.priority
|
||||
// ignore: cast_nullable_to_non_nullable
|
||||
: priority as int,
|
||||
value: value == const $CopyWithPlaceholder()
|
||||
? _value.value
|
||||
// ignore: cast_nullable_to_non_nullable
|
||||
: value as String?,
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
extension $RuleOutCopyWith on RuleOut {
|
||||
/// Returns a callable class that can be used as follows: `instanceOfRuleOut.copyWith(...)` or like so:`instanceOfRuleOut.copyWith.fieldName(...)`.
|
||||
// ignore: library_private_types_in_public_api
|
||||
_$RuleOutCWProxy get copyWith => _$RuleOutCWProxyImpl(this);
|
||||
}
|
||||
|
||||
// **************************************************************************
|
||||
// JsonSerializableGenerator
|
||||
// **************************************************************************
|
||||
|
||||
RuleOut _$RuleOutFromJson(Map<String, dynamic> json) => $checkedCreate(
|
||||
'RuleOut',
|
||||
json,
|
||||
($checkedConvert) {
|
||||
$checkKeys(
|
||||
json,
|
||||
requiredKeys: const [
|
||||
'enabled',
|
||||
'id',
|
||||
'kind',
|
||||
'last_matched_at',
|
||||
'match_count',
|
||||
'match_type',
|
||||
'note',
|
||||
'pattern',
|
||||
'priority',
|
||||
'value',
|
||||
],
|
||||
);
|
||||
final val = RuleOut(
|
||||
enabled: $checkedConvert('enabled', (v) => v as bool),
|
||||
id: $checkedConvert('id', (v) => (v as num).toInt()),
|
||||
kind: $checkedConvert(
|
||||
'kind',
|
||||
(v) => $enumDecode(
|
||||
_$RuleKindEnumMap,
|
||||
v,
|
||||
unknownValue: RuleKind.unknownDefaultOpenApi,
|
||||
),
|
||||
),
|
||||
lastMatchedAt: $checkedConvert(
|
||||
'last_matched_at',
|
||||
(v) => v == null ? null : DateTime.parse(v as String),
|
||||
),
|
||||
matchCount: $checkedConvert('match_count', (v) => (v as num).toInt()),
|
||||
matchType: $checkedConvert(
|
||||
'match_type',
|
||||
(v) => $enumDecode(
|
||||
_$RuleMatchTypeEnumMap,
|
||||
v,
|
||||
unknownValue: RuleMatchType.unknownDefaultOpenApi,
|
||||
),
|
||||
),
|
||||
note: $checkedConvert('note', (v) => v as String?),
|
||||
pattern: $checkedConvert('pattern', (v) => v as String),
|
||||
priority: $checkedConvert('priority', (v) => (v as num).toInt()),
|
||||
value: $checkedConvert('value', (v) => v as String?),
|
||||
);
|
||||
return val;
|
||||
},
|
||||
fieldKeyMap: const {
|
||||
'lastMatchedAt': 'last_matched_at',
|
||||
'matchCount': 'match_count',
|
||||
'matchType': 'match_type',
|
||||
},
|
||||
);
|
||||
|
||||
Map<String, dynamic> _$RuleOutToJson(RuleOut instance) => <String, dynamic>{
|
||||
'enabled': instance.enabled,
|
||||
'id': instance.id,
|
||||
'kind': _$RuleKindEnumMap[instance.kind]!,
|
||||
'last_matched_at': instance.lastMatchedAt?.toIso8601String(),
|
||||
'match_count': instance.matchCount,
|
||||
'match_type': _$RuleMatchTypeEnumMap[instance.matchType]!,
|
||||
'note': instance.note,
|
||||
'pattern': instance.pattern,
|
||||
'priority': instance.priority,
|
||||
'value': instance.value,
|
||||
};
|
||||
|
||||
const _$RuleKindEnumMap = {
|
||||
RuleKind.savings: 'savings',
|
||||
RuleKind.oneOff: 'one_off',
|
||||
RuleKind.category: 'category',
|
||||
RuleKind.payee: 'payee',
|
||||
RuleKind.brokerTarget: 'broker_target',
|
||||
RuleKind.ignore: 'ignore',
|
||||
RuleKind.unknownDefaultOpenApi: 'unknown_default_open_api',
|
||||
};
|
||||
|
||||
const _$RuleMatchTypeEnumMap = {
|
||||
RuleMatchType.id: 'id',
|
||||
RuleMatchType.payee: 'payee',
|
||||
RuleMatchType.comment: 'comment',
|
||||
RuleMatchType.category: 'category',
|
||||
RuleMatchType.mcc: 'mcc',
|
||||
RuleMatchType.account: 'account',
|
||||
RuleMatchType.unknownDefaultOpenApi: 'unknown_default_open_api',
|
||||
};
|
||||
@@ -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_patch.g.dart';
|
||||
|
||||
|
||||
@CopyWith()
|
||||
@JsonSerializable(
|
||||
checked: true,
|
||||
createToJson: true,
|
||||
disallowUnrecognizedKeys: false,
|
||||
explicitToJson: true,
|
||||
)
|
||||
class RulePatch {
|
||||
/// Returns a new [RulePatch] instance.
|
||||
RulePatch({
|
||||
|
||||
this.enabled,
|
||||
|
||||
this.kind,
|
||||
|
||||
this.matchType,
|
||||
|
||||
this.note,
|
||||
|
||||
this.pattern,
|
||||
|
||||
this.priority,
|
||||
|
||||
this.value,
|
||||
});
|
||||
|
||||
@JsonKey(
|
||||
|
||||
name: r'enabled',
|
||||
required: false,
|
||||
includeIfNull: false,
|
||||
)
|
||||
|
||||
|
||||
final bool? enabled;
|
||||
|
||||
|
||||
|
||||
@JsonKey(
|
||||
|
||||
name: r'kind',
|
||||
required: false,
|
||||
includeIfNull: false,
|
||||
unknownEnumValue: RuleKind.unknownDefaultOpenApi,
|
||||
)
|
||||
|
||||
|
||||
final RuleKind? kind;
|
||||
|
||||
|
||||
|
||||
@JsonKey(
|
||||
|
||||
name: r'match_type',
|
||||
required: false,
|
||||
includeIfNull: false,
|
||||
unknownEnumValue: RuleMatchType.unknownDefaultOpenApi,
|
||||
)
|
||||
|
||||
|
||||
final RuleMatchType? matchType;
|
||||
|
||||
|
||||
|
||||
@JsonKey(
|
||||
|
||||
name: r'note',
|
||||
required: false,
|
||||
includeIfNull: false,
|
||||
)
|
||||
|
||||
|
||||
final String? note;
|
||||
|
||||
|
||||
|
||||
@JsonKey(
|
||||
|
||||
name: r'pattern',
|
||||
required: false,
|
||||
includeIfNull: false,
|
||||
)
|
||||
|
||||
|
||||
final String? pattern;
|
||||
|
||||
|
||||
|
||||
@JsonKey(
|
||||
|
||||
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 RulePatch &&
|
||||
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 == null ? 0 : enabled.hashCode) +
|
||||
(kind == null ? 0 : kind.hashCode) +
|
||||
(matchType == null ? 0 : matchType.hashCode) +
|
||||
(note == null ? 0 : note.hashCode) +
|
||||
(pattern == null ? 0 : pattern.hashCode) +
|
||||
(priority == null ? 0 : priority.hashCode) +
|
||||
(value == null ? 0 : value.hashCode);
|
||||
|
||||
factory RulePatch.fromJson(Map<String, dynamic> json) => _$RulePatchFromJson(json);
|
||||
|
||||
Map<String, dynamic> toJson() => _$RulePatchToJson(this);
|
||||
|
||||
@override
|
||||
String toString() {
|
||||
return toJson().toString();
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -0,0 +1,183 @@
|
||||
// GENERATED CODE - DO NOT MODIFY BY HAND
|
||||
|
||||
part of 'rule_patch.dart';
|
||||
|
||||
// **************************************************************************
|
||||
// CopyWithGenerator
|
||||
// **************************************************************************
|
||||
|
||||
abstract class _$RulePatchCWProxy {
|
||||
RulePatch enabled(bool? enabled);
|
||||
|
||||
RulePatch kind(RuleKind? kind);
|
||||
|
||||
RulePatch matchType(RuleMatchType? matchType);
|
||||
|
||||
RulePatch note(String? note);
|
||||
|
||||
RulePatch pattern(String? pattern);
|
||||
|
||||
RulePatch priority(int? priority);
|
||||
|
||||
RulePatch value(String? value);
|
||||
|
||||
/// This function **does support** nullification of nullable fields. All `null` values passed to `non-nullable` fields will be ignored. You can also use `RulePatch(...).copyWith.fieldName(...)` to override fields one at a time with nullification support.
|
||||
///
|
||||
/// Usage
|
||||
/// ```dart
|
||||
/// RulePatch(...).copyWith(id: 12, name: "My name")
|
||||
/// ````
|
||||
RulePatch call({
|
||||
bool? enabled,
|
||||
RuleKind? kind,
|
||||
RuleMatchType? matchType,
|
||||
String? note,
|
||||
String? pattern,
|
||||
int? priority,
|
||||
String? value,
|
||||
});
|
||||
}
|
||||
|
||||
/// Proxy class for `copyWith` functionality. This is a callable class and can be used as follows: `instanceOfRulePatch.copyWith(...)`. Additionally contains functions for specific fields e.g. `instanceOfRulePatch.copyWith.fieldName(...)`
|
||||
class _$RulePatchCWProxyImpl implements _$RulePatchCWProxy {
|
||||
const _$RulePatchCWProxyImpl(this._value);
|
||||
|
||||
final RulePatch _value;
|
||||
|
||||
@override
|
||||
RulePatch enabled(bool? enabled) => this(enabled: enabled);
|
||||
|
||||
@override
|
||||
RulePatch kind(RuleKind? kind) => this(kind: kind);
|
||||
|
||||
@override
|
||||
RulePatch matchType(RuleMatchType? matchType) => this(matchType: matchType);
|
||||
|
||||
@override
|
||||
RulePatch note(String? note) => this(note: note);
|
||||
|
||||
@override
|
||||
RulePatch pattern(String? pattern) => this(pattern: pattern);
|
||||
|
||||
@override
|
||||
RulePatch priority(int? priority) => this(priority: priority);
|
||||
|
||||
@override
|
||||
RulePatch value(String? value) => this(value: value);
|
||||
|
||||
@override
|
||||
/// This function **does support** nullification of nullable fields. All `null` values passed to `non-nullable` fields will be ignored. You can also use `RulePatch(...).copyWith.fieldName(...)` to override fields one at a time with nullification support.
|
||||
///
|
||||
/// Usage
|
||||
/// ```dart
|
||||
/// RulePatch(...).copyWith(id: 12, name: "My name")
|
||||
/// ````
|
||||
RulePatch call({
|
||||
Object? enabled = const $CopyWithPlaceholder(),
|
||||
Object? kind = const $CopyWithPlaceholder(),
|
||||
Object? matchType = const $CopyWithPlaceholder(),
|
||||
Object? note = const $CopyWithPlaceholder(),
|
||||
Object? pattern = const $CopyWithPlaceholder(),
|
||||
Object? priority = const $CopyWithPlaceholder(),
|
||||
Object? value = const $CopyWithPlaceholder(),
|
||||
}) {
|
||||
return RulePatch(
|
||||
enabled: enabled == const $CopyWithPlaceholder()
|
||||
? _value.enabled
|
||||
// ignore: cast_nullable_to_non_nullable
|
||||
: enabled as bool?,
|
||||
kind: kind == const $CopyWithPlaceholder()
|
||||
? _value.kind
|
||||
// ignore: cast_nullable_to_non_nullable
|
||||
: kind as RuleKind?,
|
||||
matchType: matchType == const $CopyWithPlaceholder()
|
||||
? _value.matchType
|
||||
// ignore: cast_nullable_to_non_nullable
|
||||
: matchType as RuleMatchType?,
|
||||
note: note == const $CopyWithPlaceholder()
|
||||
? _value.note
|
||||
// ignore: cast_nullable_to_non_nullable
|
||||
: note as String?,
|
||||
pattern: pattern == const $CopyWithPlaceholder()
|
||||
? _value.pattern
|
||||
// ignore: cast_nullable_to_non_nullable
|
||||
: pattern as String?,
|
||||
priority: priority == const $CopyWithPlaceholder()
|
||||
? _value.priority
|
||||
// ignore: cast_nullable_to_non_nullable
|
||||
: priority as int?,
|
||||
value: value == const $CopyWithPlaceholder()
|
||||
? _value.value
|
||||
// ignore: cast_nullable_to_non_nullable
|
||||
: value as String?,
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
extension $RulePatchCopyWith on RulePatch {
|
||||
/// Returns a callable class that can be used as follows: `instanceOfRulePatch.copyWith(...)` or like so:`instanceOfRulePatch.copyWith.fieldName(...)`.
|
||||
// ignore: library_private_types_in_public_api
|
||||
_$RulePatchCWProxy get copyWith => _$RulePatchCWProxyImpl(this);
|
||||
}
|
||||
|
||||
// **************************************************************************
|
||||
// JsonSerializableGenerator
|
||||
// **************************************************************************
|
||||
|
||||
RulePatch _$RulePatchFromJson(Map<String, dynamic> json) =>
|
||||
$checkedCreate('RulePatch', json, ($checkedConvert) {
|
||||
final val = RulePatch(
|
||||
enabled: $checkedConvert('enabled', (v) => v as bool?),
|
||||
kind: $checkedConvert(
|
||||
'kind',
|
||||
(v) => $enumDecodeNullable(
|
||||
_$RuleKindEnumMap,
|
||||
v,
|
||||
unknownValue: RuleKind.unknownDefaultOpenApi,
|
||||
),
|
||||
),
|
||||
matchType: $checkedConvert(
|
||||
'match_type',
|
||||
(v) => $enumDecodeNullable(
|
||||
_$RuleMatchTypeEnumMap,
|
||||
v,
|
||||
unknownValue: RuleMatchType.unknownDefaultOpenApi,
|
||||
),
|
||||
),
|
||||
note: $checkedConvert('note', (v) => v as String?),
|
||||
pattern: $checkedConvert('pattern', (v) => v as String?),
|
||||
priority: $checkedConvert('priority', (v) => (v as num?)?.toInt()),
|
||||
value: $checkedConvert('value', (v) => v as String?),
|
||||
);
|
||||
return val;
|
||||
}, fieldKeyMap: const {'matchType': 'match_type'});
|
||||
|
||||
Map<String, dynamic> _$RulePatchToJson(RulePatch instance) => <String, dynamic>{
|
||||
'enabled': ?instance.enabled,
|
||||
'kind': ?_$RuleKindEnumMap[instance.kind],
|
||||
'match_type': ?_$RuleMatchTypeEnumMap[instance.matchType],
|
||||
'note': ?instance.note,
|
||||
'pattern': ?instance.pattern,
|
||||
'priority': ?instance.priority,
|
||||
'value': ?instance.value,
|
||||
};
|
||||
|
||||
const _$RuleKindEnumMap = {
|
||||
RuleKind.savings: 'savings',
|
||||
RuleKind.oneOff: 'one_off',
|
||||
RuleKind.category: 'category',
|
||||
RuleKind.payee: 'payee',
|
||||
RuleKind.brokerTarget: 'broker_target',
|
||||
RuleKind.ignore: 'ignore',
|
||||
RuleKind.unknownDefaultOpenApi: 'unknown_default_open_api',
|
||||
};
|
||||
|
||||
const _$RuleMatchTypeEnumMap = {
|
||||
RuleMatchType.id: 'id',
|
||||
RuleMatchType.payee: 'payee',
|
||||
RuleMatchType.comment: 'comment',
|
||||
RuleMatchType.category: 'category',
|
||||
RuleMatchType.mcc: 'mcc',
|
||||
RuleMatchType.account: 'account',
|
||||
RuleMatchType.unknownDefaultOpenApi: 'unknown_default_open_api',
|
||||
};
|
||||
@@ -0,0 +1,24 @@
|
||||
//
|
||||
// AUTO-GENERATED FILE, DO NOT MODIFY!
|
||||
//
|
||||
|
||||
// ignore_for_file: unused_element
|
||||
import 'package:json_annotation/json_annotation.dart';
|
||||
|
||||
enum RunStatus {
|
||||
@JsonValue(r'running')
|
||||
running(r'running'),
|
||||
@JsonValue(r'ok')
|
||||
ok(r'ok'),
|
||||
@JsonValue(r'error')
|
||||
error(r'error'),
|
||||
@JsonValue(r'unknown_default_open_api')
|
||||
unknownDefaultOpenApi(r'unknown_default_open_api');
|
||||
|
||||
const RunStatus(this.value);
|
||||
|
||||
final String value;
|
||||
|
||||
@override
|
||||
String toString() => value;
|
||||
}
|
||||
@@ -0,0 +1,109 @@
|
||||
//
|
||||
// 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 'runway_out.g.dart';
|
||||
|
||||
|
||||
@CopyWith()
|
||||
@JsonSerializable(
|
||||
checked: true,
|
||||
createToJson: true,
|
||||
disallowUnrecognizedKeys: false,
|
||||
explicitToJson: true,
|
||||
)
|
||||
class RunwayOut {
|
||||
/// Returns a new [RunwayOut] instance.
|
||||
RunwayOut({
|
||||
|
||||
required this.asOf,
|
||||
|
||||
required this.avgBaseline3mRub,
|
||||
|
||||
required this.liquidReserveRub,
|
||||
|
||||
required this.runwayMonths,
|
||||
});
|
||||
|
||||
@JsonKey(
|
||||
|
||||
name: r'as_of',
|
||||
required: true,
|
||||
includeIfNull: false,
|
||||
)
|
||||
|
||||
|
||||
final DateTime asOf;
|
||||
|
||||
|
||||
|
||||
/// decimal as string
|
||||
@JsonKey(
|
||||
|
||||
name: r'avg_baseline_3m_rub',
|
||||
required: true,
|
||||
includeIfNull: false,
|
||||
)
|
||||
|
||||
|
||||
final String avgBaseline3mRub;
|
||||
|
||||
|
||||
|
||||
/// decimal as string
|
||||
@JsonKey(
|
||||
|
||||
name: r'liquid_reserve_rub',
|
||||
required: true,
|
||||
includeIfNull: false,
|
||||
)
|
||||
|
||||
|
||||
final String liquidReserveRub;
|
||||
|
||||
|
||||
|
||||
/// decimal as string
|
||||
@JsonKey(
|
||||
|
||||
name: r'runway_months',
|
||||
required: true,
|
||||
includeIfNull: true,
|
||||
)
|
||||
|
||||
|
||||
final String? runwayMonths;
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
@override
|
||||
bool operator ==(Object other) => identical(this, other) || other is RunwayOut &&
|
||||
other.asOf == asOf &&
|
||||
other.avgBaseline3mRub == avgBaseline3mRub &&
|
||||
other.liquidReserveRub == liquidReserveRub &&
|
||||
other.runwayMonths == runwayMonths;
|
||||
|
||||
@override
|
||||
int get hashCode =>
|
||||
asOf.hashCode +
|
||||
avgBaseline3mRub.hashCode +
|
||||
liquidReserveRub.hashCode +
|
||||
(runwayMonths == null ? 0 : runwayMonths.hashCode);
|
||||
|
||||
factory RunwayOut.fromJson(Map<String, dynamic> json) => _$RunwayOutFromJson(json);
|
||||
|
||||
Map<String, dynamic> toJson() => _$RunwayOutToJson(this);
|
||||
|
||||
@override
|
||||
String toString() {
|
||||
return toJson().toString();
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -0,0 +1,137 @@
|
||||
// GENERATED CODE - DO NOT MODIFY BY HAND
|
||||
|
||||
part of 'runway_out.dart';
|
||||
|
||||
// **************************************************************************
|
||||
// CopyWithGenerator
|
||||
// **************************************************************************
|
||||
|
||||
abstract class _$RunwayOutCWProxy {
|
||||
RunwayOut asOf(DateTime asOf);
|
||||
|
||||
RunwayOut avgBaseline3mRub(String avgBaseline3mRub);
|
||||
|
||||
RunwayOut liquidReserveRub(String liquidReserveRub);
|
||||
|
||||
RunwayOut runwayMonths(String? runwayMonths);
|
||||
|
||||
/// This function **does support** nullification of nullable fields. All `null` values passed to `non-nullable` fields will be ignored. You can also use `RunwayOut(...).copyWith.fieldName(...)` to override fields one at a time with nullification support.
|
||||
///
|
||||
/// Usage
|
||||
/// ```dart
|
||||
/// RunwayOut(...).copyWith(id: 12, name: "My name")
|
||||
/// ````
|
||||
RunwayOut call({
|
||||
DateTime asOf,
|
||||
String avgBaseline3mRub,
|
||||
String liquidReserveRub,
|
||||
String? runwayMonths,
|
||||
});
|
||||
}
|
||||
|
||||
/// Proxy class for `copyWith` functionality. This is a callable class and can be used as follows: `instanceOfRunwayOut.copyWith(...)`. Additionally contains functions for specific fields e.g. `instanceOfRunwayOut.copyWith.fieldName(...)`
|
||||
class _$RunwayOutCWProxyImpl implements _$RunwayOutCWProxy {
|
||||
const _$RunwayOutCWProxyImpl(this._value);
|
||||
|
||||
final RunwayOut _value;
|
||||
|
||||
@override
|
||||
RunwayOut asOf(DateTime asOf) => this(asOf: asOf);
|
||||
|
||||
@override
|
||||
RunwayOut avgBaseline3mRub(String avgBaseline3mRub) =>
|
||||
this(avgBaseline3mRub: avgBaseline3mRub);
|
||||
|
||||
@override
|
||||
RunwayOut liquidReserveRub(String liquidReserveRub) =>
|
||||
this(liquidReserveRub: liquidReserveRub);
|
||||
|
||||
@override
|
||||
RunwayOut runwayMonths(String? runwayMonths) =>
|
||||
this(runwayMonths: runwayMonths);
|
||||
|
||||
@override
|
||||
/// This function **does support** nullification of nullable fields. All `null` values passed to `non-nullable` fields will be ignored. You can also use `RunwayOut(...).copyWith.fieldName(...)` to override fields one at a time with nullification support.
|
||||
///
|
||||
/// Usage
|
||||
/// ```dart
|
||||
/// RunwayOut(...).copyWith(id: 12, name: "My name")
|
||||
/// ````
|
||||
RunwayOut call({
|
||||
Object? asOf = const $CopyWithPlaceholder(),
|
||||
Object? avgBaseline3mRub = const $CopyWithPlaceholder(),
|
||||
Object? liquidReserveRub = const $CopyWithPlaceholder(),
|
||||
Object? runwayMonths = const $CopyWithPlaceholder(),
|
||||
}) {
|
||||
return RunwayOut(
|
||||
asOf: asOf == const $CopyWithPlaceholder()
|
||||
? _value.asOf
|
||||
// ignore: cast_nullable_to_non_nullable
|
||||
: asOf as DateTime,
|
||||
avgBaseline3mRub: avgBaseline3mRub == const $CopyWithPlaceholder()
|
||||
? _value.avgBaseline3mRub
|
||||
// ignore: cast_nullable_to_non_nullable
|
||||
: avgBaseline3mRub as String,
|
||||
liquidReserveRub: liquidReserveRub == const $CopyWithPlaceholder()
|
||||
? _value.liquidReserveRub
|
||||
// ignore: cast_nullable_to_non_nullable
|
||||
: liquidReserveRub as String,
|
||||
runwayMonths: runwayMonths == const $CopyWithPlaceholder()
|
||||
? _value.runwayMonths
|
||||
// ignore: cast_nullable_to_non_nullable
|
||||
: runwayMonths as String?,
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
extension $RunwayOutCopyWith on RunwayOut {
|
||||
/// Returns a callable class that can be used as follows: `instanceOfRunwayOut.copyWith(...)` or like so:`instanceOfRunwayOut.copyWith.fieldName(...)`.
|
||||
// ignore: library_private_types_in_public_api
|
||||
_$RunwayOutCWProxy get copyWith => _$RunwayOutCWProxyImpl(this);
|
||||
}
|
||||
|
||||
// **************************************************************************
|
||||
// JsonSerializableGenerator
|
||||
// **************************************************************************
|
||||
|
||||
RunwayOut _$RunwayOutFromJson(Map<String, dynamic> json) => $checkedCreate(
|
||||
'RunwayOut',
|
||||
json,
|
||||
($checkedConvert) {
|
||||
$checkKeys(
|
||||
json,
|
||||
requiredKeys: const [
|
||||
'as_of',
|
||||
'avg_baseline_3m_rub',
|
||||
'liquid_reserve_rub',
|
||||
'runway_months',
|
||||
],
|
||||
);
|
||||
final val = RunwayOut(
|
||||
asOf: $checkedConvert('as_of', (v) => DateTime.parse(v as String)),
|
||||
avgBaseline3mRub: $checkedConvert(
|
||||
'avg_baseline_3m_rub',
|
||||
(v) => v as String,
|
||||
),
|
||||
liquidReserveRub: $checkedConvert(
|
||||
'liquid_reserve_rub',
|
||||
(v) => v as String,
|
||||
),
|
||||
runwayMonths: $checkedConvert('runway_months', (v) => v as String?),
|
||||
);
|
||||
return val;
|
||||
},
|
||||
fieldKeyMap: const {
|
||||
'asOf': 'as_of',
|
||||
'avgBaseline3mRub': 'avg_baseline_3m_rub',
|
||||
'liquidReserveRub': 'liquid_reserve_rub',
|
||||
'runwayMonths': 'runway_months',
|
||||
},
|
||||
);
|
||||
|
||||
Map<String, dynamic> _$RunwayOutToJson(RunwayOut instance) => <String, dynamic>{
|
||||
'as_of': instance.asOf.toIso8601String(),
|
||||
'avg_baseline_3m_rub': instance.avgBaseline3mRub,
|
||||
'liquid_reserve_rub': instance.liquidReserveRub,
|
||||
'runway_months': instance.runwayMonths,
|
||||
};
|
||||
@@ -0,0 +1,140 @@
|
||||
//
|
||||
// AUTO-GENERATED FILE, DO NOT MODIFY!
|
||||
//
|
||||
|
||||
// ignore_for_file: unused_element
|
||||
import 'package:fintracker_api/src/model/run_status.dart';
|
||||
import 'package:copy_with_extension/copy_with_extension.dart';
|
||||
import 'package:json_annotation/json_annotation.dart';
|
||||
|
||||
part 'source_status.g.dart';
|
||||
|
||||
|
||||
@CopyWith()
|
||||
@JsonSerializable(
|
||||
checked: true,
|
||||
createToJson: true,
|
||||
disallowUnrecognizedKeys: false,
|
||||
explicitToJson: true,
|
||||
)
|
||||
class SourceStatus {
|
||||
/// Returns a new [SourceStatus] instance.
|
||||
SourceStatus({
|
||||
|
||||
required this.cursor,
|
||||
|
||||
required this.lastRunAt,
|
||||
|
||||
required this.lastRunStatus,
|
||||
|
||||
required this.lastSuccessAt,
|
||||
|
||||
required this.queued,
|
||||
|
||||
required this.source_,
|
||||
});
|
||||
|
||||
@JsonKey(
|
||||
|
||||
name: r'cursor',
|
||||
required: true,
|
||||
includeIfNull: true,
|
||||
)
|
||||
|
||||
|
||||
final String? cursor;
|
||||
|
||||
|
||||
|
||||
@JsonKey(
|
||||
|
||||
name: r'last_run_at',
|
||||
required: true,
|
||||
includeIfNull: true,
|
||||
)
|
||||
|
||||
|
||||
final DateTime? lastRunAt;
|
||||
|
||||
|
||||
|
||||
@JsonKey(
|
||||
|
||||
name: r'last_run_status',
|
||||
required: true,
|
||||
includeIfNull: true,
|
||||
unknownEnumValue: RunStatus.unknownDefaultOpenApi,
|
||||
)
|
||||
|
||||
|
||||
final RunStatus? lastRunStatus;
|
||||
|
||||
|
||||
|
||||
@JsonKey(
|
||||
|
||||
name: r'last_success_at',
|
||||
required: true,
|
||||
includeIfNull: true,
|
||||
)
|
||||
|
||||
|
||||
final DateTime? lastSuccessAt;
|
||||
|
||||
|
||||
|
||||
@JsonKey(
|
||||
|
||||
name: r'queued',
|
||||
required: true,
|
||||
includeIfNull: false,
|
||||
)
|
||||
|
||||
|
||||
final bool queued;
|
||||
|
||||
|
||||
|
||||
@JsonKey(
|
||||
|
||||
name: r'source',
|
||||
required: true,
|
||||
includeIfNull: false,
|
||||
)
|
||||
|
||||
|
||||
final String source_;
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
@override
|
||||
bool operator ==(Object other) => identical(this, other) || other is SourceStatus &&
|
||||
other.cursor == cursor &&
|
||||
other.lastRunAt == lastRunAt &&
|
||||
other.lastRunStatus == lastRunStatus &&
|
||||
other.lastSuccessAt == lastSuccessAt &&
|
||||
other.queued == queued &&
|
||||
other.source_ == source_;
|
||||
|
||||
@override
|
||||
int get hashCode =>
|
||||
(cursor == null ? 0 : cursor.hashCode) +
|
||||
(lastRunAt == null ? 0 : lastRunAt.hashCode) +
|
||||
(lastRunStatus == null ? 0 : lastRunStatus.hashCode) +
|
||||
(lastSuccessAt == null ? 0 : lastSuccessAt.hashCode) +
|
||||
queued.hashCode +
|
||||
source_.hashCode;
|
||||
|
||||
factory SourceStatus.fromJson(Map<String, dynamic> json) => _$SourceStatusFromJson(json);
|
||||
|
||||
Map<String, dynamic> toJson() => _$SourceStatusToJson(this);
|
||||
|
||||
@override
|
||||
String toString() {
|
||||
return toJson().toString();
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -0,0 +1,180 @@
|
||||
// GENERATED CODE - DO NOT MODIFY BY HAND
|
||||
|
||||
part of 'source_status.dart';
|
||||
|
||||
// **************************************************************************
|
||||
// CopyWithGenerator
|
||||
// **************************************************************************
|
||||
|
||||
abstract class _$SourceStatusCWProxy {
|
||||
SourceStatus cursor(String? cursor);
|
||||
|
||||
SourceStatus lastRunAt(DateTime? lastRunAt);
|
||||
|
||||
SourceStatus lastRunStatus(RunStatus? lastRunStatus);
|
||||
|
||||
SourceStatus lastSuccessAt(DateTime? lastSuccessAt);
|
||||
|
||||
SourceStatus queued(bool queued);
|
||||
|
||||
SourceStatus source_(String source_);
|
||||
|
||||
/// This function **does support** nullification of nullable fields. All `null` values passed to `non-nullable` fields will be ignored. You can also use `SourceStatus(...).copyWith.fieldName(...)` to override fields one at a time with nullification support.
|
||||
///
|
||||
/// Usage
|
||||
/// ```dart
|
||||
/// SourceStatus(...).copyWith(id: 12, name: "My name")
|
||||
/// ````
|
||||
SourceStatus call({
|
||||
String? cursor,
|
||||
DateTime? lastRunAt,
|
||||
RunStatus? lastRunStatus,
|
||||
DateTime? lastSuccessAt,
|
||||
bool queued,
|
||||
String source_,
|
||||
});
|
||||
}
|
||||
|
||||
/// Proxy class for `copyWith` functionality. This is a callable class and can be used as follows: `instanceOfSourceStatus.copyWith(...)`. Additionally contains functions for specific fields e.g. `instanceOfSourceStatus.copyWith.fieldName(...)`
|
||||
class _$SourceStatusCWProxyImpl implements _$SourceStatusCWProxy {
|
||||
const _$SourceStatusCWProxyImpl(this._value);
|
||||
|
||||
final SourceStatus _value;
|
||||
|
||||
@override
|
||||
SourceStatus cursor(String? cursor) => this(cursor: cursor);
|
||||
|
||||
@override
|
||||
SourceStatus lastRunAt(DateTime? lastRunAt) => this(lastRunAt: lastRunAt);
|
||||
|
||||
@override
|
||||
SourceStatus lastRunStatus(RunStatus? lastRunStatus) =>
|
||||
this(lastRunStatus: lastRunStatus);
|
||||
|
||||
@override
|
||||
SourceStatus lastSuccessAt(DateTime? lastSuccessAt) =>
|
||||
this(lastSuccessAt: lastSuccessAt);
|
||||
|
||||
@override
|
||||
SourceStatus queued(bool queued) => this(queued: queued);
|
||||
|
||||
@override
|
||||
SourceStatus source_(String source_) => this(source_: source_);
|
||||
|
||||
@override
|
||||
/// This function **does support** nullification of nullable fields. All `null` values passed to `non-nullable` fields will be ignored. You can also use `SourceStatus(...).copyWith.fieldName(...)` to override fields one at a time with nullification support.
|
||||
///
|
||||
/// Usage
|
||||
/// ```dart
|
||||
/// SourceStatus(...).copyWith(id: 12, name: "My name")
|
||||
/// ````
|
||||
SourceStatus call({
|
||||
Object? cursor = const $CopyWithPlaceholder(),
|
||||
Object? lastRunAt = const $CopyWithPlaceholder(),
|
||||
Object? lastRunStatus = const $CopyWithPlaceholder(),
|
||||
Object? lastSuccessAt = const $CopyWithPlaceholder(),
|
||||
Object? queued = const $CopyWithPlaceholder(),
|
||||
Object? source_ = const $CopyWithPlaceholder(),
|
||||
}) {
|
||||
return SourceStatus(
|
||||
cursor: cursor == const $CopyWithPlaceholder()
|
||||
? _value.cursor
|
||||
// ignore: cast_nullable_to_non_nullable
|
||||
: cursor as String?,
|
||||
lastRunAt: lastRunAt == const $CopyWithPlaceholder()
|
||||
? _value.lastRunAt
|
||||
// ignore: cast_nullable_to_non_nullable
|
||||
: lastRunAt as DateTime?,
|
||||
lastRunStatus: lastRunStatus == const $CopyWithPlaceholder()
|
||||
? _value.lastRunStatus
|
||||
// ignore: cast_nullable_to_non_nullable
|
||||
: lastRunStatus as RunStatus?,
|
||||
lastSuccessAt: lastSuccessAt == const $CopyWithPlaceholder()
|
||||
? _value.lastSuccessAt
|
||||
// ignore: cast_nullable_to_non_nullable
|
||||
: lastSuccessAt as DateTime?,
|
||||
queued: queued == const $CopyWithPlaceholder()
|
||||
? _value.queued
|
||||
// ignore: cast_nullable_to_non_nullable
|
||||
: queued as bool,
|
||||
source_: source_ == const $CopyWithPlaceholder()
|
||||
? _value.source_
|
||||
// ignore: cast_nullable_to_non_nullable
|
||||
: source_ as String,
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
extension $SourceStatusCopyWith on SourceStatus {
|
||||
/// Returns a callable class that can be used as follows: `instanceOfSourceStatus.copyWith(...)` or like so:`instanceOfSourceStatus.copyWith.fieldName(...)`.
|
||||
// ignore: library_private_types_in_public_api
|
||||
_$SourceStatusCWProxy get copyWith => _$SourceStatusCWProxyImpl(this);
|
||||
}
|
||||
|
||||
// **************************************************************************
|
||||
// JsonSerializableGenerator
|
||||
// **************************************************************************
|
||||
|
||||
SourceStatus _$SourceStatusFromJson(Map<String, dynamic> json) =>
|
||||
$checkedCreate(
|
||||
'SourceStatus',
|
||||
json,
|
||||
($checkedConvert) {
|
||||
$checkKeys(
|
||||
json,
|
||||
requiredKeys: const [
|
||||
'cursor',
|
||||
'last_run_at',
|
||||
'last_run_status',
|
||||
'last_success_at',
|
||||
'queued',
|
||||
'source',
|
||||
],
|
||||
);
|
||||
final val = SourceStatus(
|
||||
cursor: $checkedConvert('cursor', (v) => v as String?),
|
||||
lastRunAt: $checkedConvert(
|
||||
'last_run_at',
|
||||
(v) => v == null ? null : DateTime.parse(v as String),
|
||||
),
|
||||
lastRunStatus: $checkedConvert(
|
||||
'last_run_status',
|
||||
(v) => $enumDecodeNullable(
|
||||
_$RunStatusEnumMap,
|
||||
v,
|
||||
unknownValue: RunStatus.unknownDefaultOpenApi,
|
||||
),
|
||||
),
|
||||
lastSuccessAt: $checkedConvert(
|
||||
'last_success_at',
|
||||
(v) => v == null ? null : DateTime.parse(v as String),
|
||||
),
|
||||
queued: $checkedConvert('queued', (v) => v as bool),
|
||||
source_: $checkedConvert('source', (v) => v as String),
|
||||
);
|
||||
return val;
|
||||
},
|
||||
fieldKeyMap: const {
|
||||
'lastRunAt': 'last_run_at',
|
||||
'lastRunStatus': 'last_run_status',
|
||||
'lastSuccessAt': 'last_success_at',
|
||||
'source_': 'source',
|
||||
},
|
||||
);
|
||||
|
||||
Map<String, dynamic> _$SourceStatusToJson(SourceStatus instance) =>
|
||||
<String, dynamic>{
|
||||
'cursor': instance.cursor,
|
||||
'last_run_at': instance.lastRunAt?.toIso8601String(),
|
||||
'last_run_status': _$RunStatusEnumMap[instance.lastRunStatus],
|
||||
'last_success_at': instance.lastSuccessAt?.toIso8601String(),
|
||||
'queued': instance.queued,
|
||||
'source': instance.source_,
|
||||
};
|
||||
|
||||
const _$RunStatusEnumMap = {
|
||||
RunStatus.running: 'running',
|
||||
RunStatus.ok: 'ok',
|
||||
RunStatus.error: 'error',
|
||||
RunStatus.unknownDefaultOpenApi: 'unknown_default_open_api',
|
||||
};
|
||||
@@ -0,0 +1,155 @@
|
||||
//
|
||||
// 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 'spending_row.g.dart';
|
||||
|
||||
|
||||
@CopyWith()
|
||||
@JsonSerializable(
|
||||
checked: true,
|
||||
createToJson: true,
|
||||
disallowUnrecognizedKeys: false,
|
||||
explicitToJson: true,
|
||||
)
|
||||
class SpendingRow {
|
||||
/// Returns a new [SpendingRow] instance.
|
||||
SpendingRow({
|
||||
|
||||
required this.amountRub,
|
||||
|
||||
required this.categoryId,
|
||||
|
||||
required this.categoryName,
|
||||
|
||||
required this.month,
|
||||
|
||||
required this.rootCategoryId,
|
||||
|
||||
required this.rootCategoryName,
|
||||
|
||||
required this.txnCount,
|
||||
});
|
||||
|
||||
/// decimal as string
|
||||
@JsonKey(
|
||||
|
||||
name: r'amount_rub',
|
||||
required: true,
|
||||
includeIfNull: false,
|
||||
)
|
||||
|
||||
|
||||
final String amountRub;
|
||||
|
||||
|
||||
|
||||
@JsonKey(
|
||||
|
||||
name: r'category_id',
|
||||
required: true,
|
||||
includeIfNull: true,
|
||||
)
|
||||
|
||||
|
||||
final int? categoryId;
|
||||
|
||||
|
||||
|
||||
@JsonKey(
|
||||
|
||||
name: r'category_name',
|
||||
required: true,
|
||||
includeIfNull: true,
|
||||
)
|
||||
|
||||
|
||||
final String? categoryName;
|
||||
|
||||
|
||||
|
||||
@JsonKey(
|
||||
|
||||
name: r'month',
|
||||
required: true,
|
||||
includeIfNull: false,
|
||||
)
|
||||
|
||||
|
||||
final DateTime month;
|
||||
|
||||
|
||||
|
||||
@JsonKey(
|
||||
|
||||
name: r'root_category_id',
|
||||
required: true,
|
||||
includeIfNull: true,
|
||||
)
|
||||
|
||||
|
||||
final int? rootCategoryId;
|
||||
|
||||
|
||||
|
||||
@JsonKey(
|
||||
|
||||
name: r'root_category_name',
|
||||
required: true,
|
||||
includeIfNull: true,
|
||||
)
|
||||
|
||||
|
||||
final String? rootCategoryName;
|
||||
|
||||
|
||||
|
||||
@JsonKey(
|
||||
|
||||
name: r'txn_count',
|
||||
required: true,
|
||||
includeIfNull: false,
|
||||
)
|
||||
|
||||
|
||||
final int txnCount;
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
@override
|
||||
bool operator ==(Object other) => identical(this, other) || other is SpendingRow &&
|
||||
other.amountRub == amountRub &&
|
||||
other.categoryId == categoryId &&
|
||||
other.categoryName == categoryName &&
|
||||
other.month == month &&
|
||||
other.rootCategoryId == rootCategoryId &&
|
||||
other.rootCategoryName == rootCategoryName &&
|
||||
other.txnCount == txnCount;
|
||||
|
||||
@override
|
||||
int get hashCode =>
|
||||
amountRub.hashCode +
|
||||
(categoryId == null ? 0 : categoryId.hashCode) +
|
||||
(categoryName == null ? 0 : categoryName.hashCode) +
|
||||
month.hashCode +
|
||||
(rootCategoryId == null ? 0 : rootCategoryId.hashCode) +
|
||||
(rootCategoryName == null ? 0 : rootCategoryName.hashCode) +
|
||||
txnCount.hashCode;
|
||||
|
||||
factory SpendingRow.fromJson(Map<String, dynamic> json) => _$SpendingRowFromJson(json);
|
||||
|
||||
Map<String, dynamic> toJson() => _$SpendingRowToJson(this);
|
||||
|
||||
@override
|
||||
String toString() {
|
||||
return toJson().toString();
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -0,0 +1,182 @@
|
||||
// GENERATED CODE - DO NOT MODIFY BY HAND
|
||||
|
||||
part of 'spending_row.dart';
|
||||
|
||||
// **************************************************************************
|
||||
// CopyWithGenerator
|
||||
// **************************************************************************
|
||||
|
||||
abstract class _$SpendingRowCWProxy {
|
||||
SpendingRow amountRub(String amountRub);
|
||||
|
||||
SpendingRow categoryId(int? categoryId);
|
||||
|
||||
SpendingRow categoryName(String? categoryName);
|
||||
|
||||
SpendingRow month(DateTime month);
|
||||
|
||||
SpendingRow rootCategoryId(int? rootCategoryId);
|
||||
|
||||
SpendingRow rootCategoryName(String? rootCategoryName);
|
||||
|
||||
SpendingRow 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 `SpendingRow(...).copyWith.fieldName(...)` to override fields one at a time with nullification support.
|
||||
///
|
||||
/// Usage
|
||||
/// ```dart
|
||||
/// SpendingRow(...).copyWith(id: 12, name: "My name")
|
||||
/// ````
|
||||
SpendingRow call({
|
||||
String amountRub,
|
||||
int? categoryId,
|
||||
String? categoryName,
|
||||
DateTime month,
|
||||
int? rootCategoryId,
|
||||
String? rootCategoryName,
|
||||
int txnCount,
|
||||
});
|
||||
}
|
||||
|
||||
/// Proxy class for `copyWith` functionality. This is a callable class and can be used as follows: `instanceOfSpendingRow.copyWith(...)`. Additionally contains functions for specific fields e.g. `instanceOfSpendingRow.copyWith.fieldName(...)`
|
||||
class _$SpendingRowCWProxyImpl implements _$SpendingRowCWProxy {
|
||||
const _$SpendingRowCWProxyImpl(this._value);
|
||||
|
||||
final SpendingRow _value;
|
||||
|
||||
@override
|
||||
SpendingRow amountRub(String amountRub) => this(amountRub: amountRub);
|
||||
|
||||
@override
|
||||
SpendingRow categoryId(int? categoryId) => this(categoryId: categoryId);
|
||||
|
||||
@override
|
||||
SpendingRow categoryName(String? categoryName) =>
|
||||
this(categoryName: categoryName);
|
||||
|
||||
@override
|
||||
SpendingRow month(DateTime month) => this(month: month);
|
||||
|
||||
@override
|
||||
SpendingRow rootCategoryId(int? rootCategoryId) =>
|
||||
this(rootCategoryId: rootCategoryId);
|
||||
|
||||
@override
|
||||
SpendingRow rootCategoryName(String? rootCategoryName) =>
|
||||
this(rootCategoryName: rootCategoryName);
|
||||
|
||||
@override
|
||||
SpendingRow 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 `SpendingRow(...).copyWith.fieldName(...)` to override fields one at a time with nullification support.
|
||||
///
|
||||
/// Usage
|
||||
/// ```dart
|
||||
/// SpendingRow(...).copyWith(id: 12, name: "My name")
|
||||
/// ````
|
||||
SpendingRow call({
|
||||
Object? amountRub = const $CopyWithPlaceholder(),
|
||||
Object? categoryId = const $CopyWithPlaceholder(),
|
||||
Object? categoryName = const $CopyWithPlaceholder(),
|
||||
Object? month = const $CopyWithPlaceholder(),
|
||||
Object? rootCategoryId = const $CopyWithPlaceholder(),
|
||||
Object? rootCategoryName = const $CopyWithPlaceholder(),
|
||||
Object? txnCount = const $CopyWithPlaceholder(),
|
||||
}) {
|
||||
return SpendingRow(
|
||||
amountRub: amountRub == const $CopyWithPlaceholder()
|
||||
? _value.amountRub
|
||||
// ignore: cast_nullable_to_non_nullable
|
||||
: amountRub as String,
|
||||
categoryId: categoryId == const $CopyWithPlaceholder()
|
||||
? _value.categoryId
|
||||
// ignore: cast_nullable_to_non_nullable
|
||||
: categoryId as int?,
|
||||
categoryName: categoryName == const $CopyWithPlaceholder()
|
||||
? _value.categoryName
|
||||
// ignore: cast_nullable_to_non_nullable
|
||||
: categoryName as String?,
|
||||
month: month == const $CopyWithPlaceholder()
|
||||
? _value.month
|
||||
// ignore: cast_nullable_to_non_nullable
|
||||
: month as DateTime,
|
||||
rootCategoryId: rootCategoryId == const $CopyWithPlaceholder()
|
||||
? _value.rootCategoryId
|
||||
// ignore: cast_nullable_to_non_nullable
|
||||
: rootCategoryId as int?,
|
||||
rootCategoryName: rootCategoryName == const $CopyWithPlaceholder()
|
||||
? _value.rootCategoryName
|
||||
// ignore: cast_nullable_to_non_nullable
|
||||
: rootCategoryName as String?,
|
||||
txnCount: txnCount == const $CopyWithPlaceholder()
|
||||
? _value.txnCount
|
||||
// ignore: cast_nullable_to_non_nullable
|
||||
: txnCount as int,
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
extension $SpendingRowCopyWith on SpendingRow {
|
||||
/// Returns a callable class that can be used as follows: `instanceOfSpendingRow.copyWith(...)` or like so:`instanceOfSpendingRow.copyWith.fieldName(...)`.
|
||||
// ignore: library_private_types_in_public_api
|
||||
_$SpendingRowCWProxy get copyWith => _$SpendingRowCWProxyImpl(this);
|
||||
}
|
||||
|
||||
// **************************************************************************
|
||||
// JsonSerializableGenerator
|
||||
// **************************************************************************
|
||||
|
||||
SpendingRow _$SpendingRowFromJson(Map<String, dynamic> json) => $checkedCreate(
|
||||
'SpendingRow',
|
||||
json,
|
||||
($checkedConvert) {
|
||||
$checkKeys(
|
||||
json,
|
||||
requiredKeys: const [
|
||||
'amount_rub',
|
||||
'category_id',
|
||||
'category_name',
|
||||
'month',
|
||||
'root_category_id',
|
||||
'root_category_name',
|
||||
'txn_count',
|
||||
],
|
||||
);
|
||||
final val = SpendingRow(
|
||||
amountRub: $checkedConvert('amount_rub', (v) => v as String),
|
||||
categoryId: $checkedConvert('category_id', (v) => (v as num?)?.toInt()),
|
||||
categoryName: $checkedConvert('category_name', (v) => v as String?),
|
||||
month: $checkedConvert('month', (v) => DateTime.parse(v as String)),
|
||||
rootCategoryId: $checkedConvert(
|
||||
'root_category_id',
|
||||
(v) => (v as num?)?.toInt(),
|
||||
),
|
||||
rootCategoryName: $checkedConvert(
|
||||
'root_category_name',
|
||||
(v) => v as String?,
|
||||
),
|
||||
txnCount: $checkedConvert('txn_count', (v) => (v as num).toInt()),
|
||||
);
|
||||
return val;
|
||||
},
|
||||
fieldKeyMap: const {
|
||||
'amountRub': 'amount_rub',
|
||||
'categoryId': 'category_id',
|
||||
'categoryName': 'category_name',
|
||||
'rootCategoryId': 'root_category_id',
|
||||
'rootCategoryName': 'root_category_name',
|
||||
'txnCount': 'txn_count',
|
||||
},
|
||||
);
|
||||
|
||||
Map<String, dynamic> _$SpendingRowToJson(SpendingRow instance) =>
|
||||
<String, dynamic>{
|
||||
'amount_rub': instance.amountRub,
|
||||
'category_id': instance.categoryId,
|
||||
'category_name': instance.categoryName,
|
||||
'month': instance.month.toIso8601String(),
|
||||
'root_category_id': instance.rootCategoryId,
|
||||
'root_category_name': instance.rootCategoryName,
|
||||
'txn_count': instance.txnCount,
|
||||
};
|
||||
@@ -0,0 +1,108 @@
|
||||
//
|
||||
// AUTO-GENERATED FILE, DO NOT MODIFY!
|
||||
//
|
||||
|
||||
// ignore_for_file: unused_element
|
||||
import 'package:fintracker_api/src/model/job_status.dart';
|
||||
import 'package:copy_with_extension/copy_with_extension.dart';
|
||||
import 'package:json_annotation/json_annotation.dart';
|
||||
|
||||
part 'sync_job_out.g.dart';
|
||||
|
||||
|
||||
@CopyWith()
|
||||
@JsonSerializable(
|
||||
checked: true,
|
||||
createToJson: true,
|
||||
disallowUnrecognizedKeys: false,
|
||||
explicitToJson: true,
|
||||
)
|
||||
class SyncJobOut {
|
||||
/// Returns a new [SyncJobOut] instance.
|
||||
SyncJobOut({
|
||||
|
||||
required this.id,
|
||||
|
||||
required this.requestedAt,
|
||||
|
||||
required this.source_,
|
||||
|
||||
required this.status,
|
||||
});
|
||||
|
||||
@JsonKey(
|
||||
|
||||
name: r'id',
|
||||
required: true,
|
||||
includeIfNull: false,
|
||||
)
|
||||
|
||||
|
||||
final String id;
|
||||
|
||||
|
||||
|
||||
@JsonKey(
|
||||
|
||||
name: r'requested_at',
|
||||
required: true,
|
||||
includeIfNull: false,
|
||||
)
|
||||
|
||||
|
||||
final DateTime requestedAt;
|
||||
|
||||
|
||||
|
||||
@JsonKey(
|
||||
|
||||
name: r'source',
|
||||
required: true,
|
||||
includeIfNull: false,
|
||||
)
|
||||
|
||||
|
||||
final String source_;
|
||||
|
||||
|
||||
|
||||
@JsonKey(
|
||||
|
||||
name: r'status',
|
||||
required: true,
|
||||
includeIfNull: false,
|
||||
unknownEnumValue: JobStatus.unknownDefaultOpenApi,
|
||||
)
|
||||
|
||||
|
||||
final JobStatus status;
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
@override
|
||||
bool operator ==(Object other) => identical(this, other) || other is SyncJobOut &&
|
||||
other.id == id &&
|
||||
other.requestedAt == requestedAt &&
|
||||
other.source_ == source_ &&
|
||||
other.status == status;
|
||||
|
||||
@override
|
||||
int get hashCode =>
|
||||
id.hashCode +
|
||||
requestedAt.hashCode +
|
||||
source_.hashCode +
|
||||
status.hashCode;
|
||||
|
||||
factory SyncJobOut.fromJson(Map<String, dynamic> json) => _$SyncJobOutFromJson(json);
|
||||
|
||||
Map<String, dynamic> toJson() => _$SyncJobOutToJson(this);
|
||||
|
||||
@override
|
||||
String toString() {
|
||||
return toJson().toString();
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -0,0 +1,138 @@
|
||||
// GENERATED CODE - DO NOT MODIFY BY HAND
|
||||
|
||||
part of 'sync_job_out.dart';
|
||||
|
||||
// **************************************************************************
|
||||
// CopyWithGenerator
|
||||
// **************************************************************************
|
||||
|
||||
abstract class _$SyncJobOutCWProxy {
|
||||
SyncJobOut id(String id);
|
||||
|
||||
SyncJobOut requestedAt(DateTime requestedAt);
|
||||
|
||||
SyncJobOut source_(String source_);
|
||||
|
||||
SyncJobOut status(JobStatus status);
|
||||
|
||||
/// This function **does support** nullification of nullable fields. All `null` values passed to `non-nullable` fields will be ignored. You can also use `SyncJobOut(...).copyWith.fieldName(...)` to override fields one at a time with nullification support.
|
||||
///
|
||||
/// Usage
|
||||
/// ```dart
|
||||
/// SyncJobOut(...).copyWith(id: 12, name: "My name")
|
||||
/// ````
|
||||
SyncJobOut call({
|
||||
String id,
|
||||
DateTime requestedAt,
|
||||
String source_,
|
||||
JobStatus status,
|
||||
});
|
||||
}
|
||||
|
||||
/// Proxy class for `copyWith` functionality. This is a callable class and can be used as follows: `instanceOfSyncJobOut.copyWith(...)`. Additionally contains functions for specific fields e.g. `instanceOfSyncJobOut.copyWith.fieldName(...)`
|
||||
class _$SyncJobOutCWProxyImpl implements _$SyncJobOutCWProxy {
|
||||
const _$SyncJobOutCWProxyImpl(this._value);
|
||||
|
||||
final SyncJobOut _value;
|
||||
|
||||
@override
|
||||
SyncJobOut id(String id) => this(id: id);
|
||||
|
||||
@override
|
||||
SyncJobOut requestedAt(DateTime requestedAt) =>
|
||||
this(requestedAt: requestedAt);
|
||||
|
||||
@override
|
||||
SyncJobOut source_(String source_) => this(source_: source_);
|
||||
|
||||
@override
|
||||
SyncJobOut status(JobStatus status) => this(status: status);
|
||||
|
||||
@override
|
||||
/// This function **does support** nullification of nullable fields. All `null` values passed to `non-nullable` fields will be ignored. You can also use `SyncJobOut(...).copyWith.fieldName(...)` to override fields one at a time with nullification support.
|
||||
///
|
||||
/// Usage
|
||||
/// ```dart
|
||||
/// SyncJobOut(...).copyWith(id: 12, name: "My name")
|
||||
/// ````
|
||||
SyncJobOut call({
|
||||
Object? id = const $CopyWithPlaceholder(),
|
||||
Object? requestedAt = const $CopyWithPlaceholder(),
|
||||
Object? source_ = const $CopyWithPlaceholder(),
|
||||
Object? status = const $CopyWithPlaceholder(),
|
||||
}) {
|
||||
return SyncJobOut(
|
||||
id: id == const $CopyWithPlaceholder()
|
||||
? _value.id
|
||||
// ignore: cast_nullable_to_non_nullable
|
||||
: id as String,
|
||||
requestedAt: requestedAt == const $CopyWithPlaceholder()
|
||||
? _value.requestedAt
|
||||
// ignore: cast_nullable_to_non_nullable
|
||||
: requestedAt as DateTime,
|
||||
source_: source_ == const $CopyWithPlaceholder()
|
||||
? _value.source_
|
||||
// ignore: cast_nullable_to_non_nullable
|
||||
: source_ as String,
|
||||
status: status == const $CopyWithPlaceholder()
|
||||
? _value.status
|
||||
// ignore: cast_nullable_to_non_nullable
|
||||
: status as JobStatus,
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
extension $SyncJobOutCopyWith on SyncJobOut {
|
||||
/// Returns a callable class that can be used as follows: `instanceOfSyncJobOut.copyWith(...)` or like so:`instanceOfSyncJobOut.copyWith.fieldName(...)`.
|
||||
// ignore: library_private_types_in_public_api
|
||||
_$SyncJobOutCWProxy get copyWith => _$SyncJobOutCWProxyImpl(this);
|
||||
}
|
||||
|
||||
// **************************************************************************
|
||||
// JsonSerializableGenerator
|
||||
// **************************************************************************
|
||||
|
||||
SyncJobOut _$SyncJobOutFromJson(Map<String, dynamic> json) => $checkedCreate(
|
||||
'SyncJobOut',
|
||||
json,
|
||||
($checkedConvert) {
|
||||
$checkKeys(
|
||||
json,
|
||||
requiredKeys: const ['id', 'requested_at', 'source', 'status'],
|
||||
);
|
||||
final val = SyncJobOut(
|
||||
id: $checkedConvert('id', (v) => v as String),
|
||||
requestedAt: $checkedConvert(
|
||||
'requested_at',
|
||||
(v) => DateTime.parse(v as String),
|
||||
),
|
||||
source_: $checkedConvert('source', (v) => v as String),
|
||||
status: $checkedConvert(
|
||||
'status',
|
||||
(v) => $enumDecode(
|
||||
_$JobStatusEnumMap,
|
||||
v,
|
||||
unknownValue: JobStatus.unknownDefaultOpenApi,
|
||||
),
|
||||
),
|
||||
);
|
||||
return val;
|
||||
},
|
||||
fieldKeyMap: const {'requestedAt': 'requested_at', 'source_': 'source'},
|
||||
);
|
||||
|
||||
Map<String, dynamic> _$SyncJobOutToJson(SyncJobOut instance) =>
|
||||
<String, dynamic>{
|
||||
'id': instance.id,
|
||||
'requested_at': instance.requestedAt.toIso8601String(),
|
||||
'source': instance.source_,
|
||||
'status': _$JobStatusEnumMap[instance.status]!,
|
||||
};
|
||||
|
||||
const _$JobStatusEnumMap = {
|
||||
JobStatus.queued: 'queued',
|
||||
JobStatus.running: 'running',
|
||||
JobStatus.done: 'done',
|
||||
JobStatus.error: 'error',
|
||||
JobStatus.unknownDefaultOpenApi: 'unknown_default_open_api',
|
||||
};
|
||||
@@ -0,0 +1,220 @@
|
||||
//
|
||||
// AUTO-GENERATED FILE, DO NOT MODIFY!
|
||||
//
|
||||
|
||||
// ignore_for_file: unused_element
|
||||
import 'package:fintracker_api/src/model/run_status.dart';
|
||||
import 'package:copy_with_extension/copy_with_extension.dart';
|
||||
import 'package:json_annotation/json_annotation.dart';
|
||||
|
||||
part 'sync_run_out.g.dart';
|
||||
|
||||
|
||||
@CopyWith()
|
||||
@JsonSerializable(
|
||||
checked: true,
|
||||
createToJson: true,
|
||||
disallowUnrecognizedKeys: false,
|
||||
explicitToJson: true,
|
||||
)
|
||||
class SyncRunOut {
|
||||
/// Returns a new [SyncRunOut] instance.
|
||||
SyncRunOut({
|
||||
|
||||
required this.counts,
|
||||
|
||||
required this.cursorAfter,
|
||||
|
||||
required this.cursorBefore,
|
||||
|
||||
required this.error,
|
||||
|
||||
required this.finishedAt,
|
||||
|
||||
required this.id,
|
||||
|
||||
required this.source_,
|
||||
|
||||
required this.startedAt,
|
||||
|
||||
required this.status,
|
||||
|
||||
required this.triggeredBy,
|
||||
|
||||
required this.warnings,
|
||||
});
|
||||
|
||||
@JsonKey(
|
||||
|
||||
name: r'counts',
|
||||
required: true,
|
||||
includeIfNull: true,
|
||||
)
|
||||
|
||||
|
||||
final Map<String, Object>? counts;
|
||||
|
||||
|
||||
|
||||
@JsonKey(
|
||||
|
||||
name: r'cursor_after',
|
||||
required: true,
|
||||
includeIfNull: true,
|
||||
)
|
||||
|
||||
|
||||
final String? cursorAfter;
|
||||
|
||||
|
||||
|
||||
@JsonKey(
|
||||
|
||||
name: r'cursor_before',
|
||||
required: true,
|
||||
includeIfNull: true,
|
||||
)
|
||||
|
||||
|
||||
final String? cursorBefore;
|
||||
|
||||
|
||||
|
||||
@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 String id;
|
||||
|
||||
|
||||
|
||||
@JsonKey(
|
||||
|
||||
name: r'source',
|
||||
required: true,
|
||||
includeIfNull: false,
|
||||
)
|
||||
|
||||
|
||||
final String source_;
|
||||
|
||||
|
||||
|
||||
@JsonKey(
|
||||
|
||||
name: r'started_at',
|
||||
required: true,
|
||||
includeIfNull: false,
|
||||
)
|
||||
|
||||
|
||||
final DateTime startedAt;
|
||||
|
||||
|
||||
|
||||
@JsonKey(
|
||||
|
||||
name: r'status',
|
||||
required: true,
|
||||
includeIfNull: false,
|
||||
unknownEnumValue: RunStatus.unknownDefaultOpenApi,
|
||||
)
|
||||
|
||||
|
||||
final RunStatus status;
|
||||
|
||||
|
||||
|
||||
@JsonKey(
|
||||
|
||||
name: r'triggered_by',
|
||||
required: true,
|
||||
includeIfNull: false,
|
||||
)
|
||||
|
||||
|
||||
final String triggeredBy;
|
||||
|
||||
|
||||
|
||||
@JsonKey(
|
||||
|
||||
name: r'warnings',
|
||||
required: true,
|
||||
includeIfNull: true,
|
||||
)
|
||||
|
||||
|
||||
final List<Object>? warnings;
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
@override
|
||||
bool operator ==(Object other) => identical(this, other) || other is SyncRunOut &&
|
||||
other.counts == counts &&
|
||||
other.cursorAfter == cursorAfter &&
|
||||
other.cursorBefore == cursorBefore &&
|
||||
other.error == error &&
|
||||
other.finishedAt == finishedAt &&
|
||||
other.id == id &&
|
||||
other.source_ == source_ &&
|
||||
other.startedAt == startedAt &&
|
||||
other.status == status &&
|
||||
other.triggeredBy == triggeredBy &&
|
||||
other.warnings == warnings;
|
||||
|
||||
@override
|
||||
int get hashCode =>
|
||||
(counts == null ? 0 : counts.hashCode) +
|
||||
(cursorAfter == null ? 0 : cursorAfter.hashCode) +
|
||||
(cursorBefore == null ? 0 : cursorBefore.hashCode) +
|
||||
(error == null ? 0 : error.hashCode) +
|
||||
(finishedAt == null ? 0 : finishedAt.hashCode) +
|
||||
id.hashCode +
|
||||
source_.hashCode +
|
||||
startedAt.hashCode +
|
||||
status.hashCode +
|
||||
triggeredBy.hashCode +
|
||||
(warnings == null ? 0 : warnings.hashCode);
|
||||
|
||||
factory SyncRunOut.fromJson(Map<String, dynamic> json) => _$SyncRunOutFromJson(json);
|
||||
|
||||
Map<String, dynamic> toJson() => _$SyncRunOutToJson(this);
|
||||
|
||||
@override
|
||||
String toString() {
|
||||
return toJson().toString();
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -0,0 +1,258 @@
|
||||
// GENERATED CODE - DO NOT MODIFY BY HAND
|
||||
|
||||
part of 'sync_run_out.dart';
|
||||
|
||||
// **************************************************************************
|
||||
// CopyWithGenerator
|
||||
// **************************************************************************
|
||||
|
||||
abstract class _$SyncRunOutCWProxy {
|
||||
SyncRunOut counts(Map<String, Object>? counts);
|
||||
|
||||
SyncRunOut cursorAfter(String? cursorAfter);
|
||||
|
||||
SyncRunOut cursorBefore(String? cursorBefore);
|
||||
|
||||
SyncRunOut error(String? error);
|
||||
|
||||
SyncRunOut finishedAt(DateTime? finishedAt);
|
||||
|
||||
SyncRunOut id(String id);
|
||||
|
||||
SyncRunOut source_(String source_);
|
||||
|
||||
SyncRunOut startedAt(DateTime startedAt);
|
||||
|
||||
SyncRunOut status(RunStatus status);
|
||||
|
||||
SyncRunOut triggeredBy(String triggeredBy);
|
||||
|
||||
SyncRunOut warnings(List<Object>? warnings);
|
||||
|
||||
/// This function **does support** nullification of nullable fields. All `null` values passed to `non-nullable` fields will be ignored. You can also use `SyncRunOut(...).copyWith.fieldName(...)` to override fields one at a time with nullification support.
|
||||
///
|
||||
/// Usage
|
||||
/// ```dart
|
||||
/// SyncRunOut(...).copyWith(id: 12, name: "My name")
|
||||
/// ````
|
||||
SyncRunOut call({
|
||||
Map<String, Object>? counts,
|
||||
String? cursorAfter,
|
||||
String? cursorBefore,
|
||||
String? error,
|
||||
DateTime? finishedAt,
|
||||
String id,
|
||||
String source_,
|
||||
DateTime startedAt,
|
||||
RunStatus status,
|
||||
String triggeredBy,
|
||||
List<Object>? warnings,
|
||||
});
|
||||
}
|
||||
|
||||
/// Proxy class for `copyWith` functionality. This is a callable class and can be used as follows: `instanceOfSyncRunOut.copyWith(...)`. Additionally contains functions for specific fields e.g. `instanceOfSyncRunOut.copyWith.fieldName(...)`
|
||||
class _$SyncRunOutCWProxyImpl implements _$SyncRunOutCWProxy {
|
||||
const _$SyncRunOutCWProxyImpl(this._value);
|
||||
|
||||
final SyncRunOut _value;
|
||||
|
||||
@override
|
||||
SyncRunOut counts(Map<String, Object>? counts) => this(counts: counts);
|
||||
|
||||
@override
|
||||
SyncRunOut cursorAfter(String? cursorAfter) => this(cursorAfter: cursorAfter);
|
||||
|
||||
@override
|
||||
SyncRunOut cursorBefore(String? cursorBefore) =>
|
||||
this(cursorBefore: cursorBefore);
|
||||
|
||||
@override
|
||||
SyncRunOut error(String? error) => this(error: error);
|
||||
|
||||
@override
|
||||
SyncRunOut finishedAt(DateTime? finishedAt) => this(finishedAt: finishedAt);
|
||||
|
||||
@override
|
||||
SyncRunOut id(String id) => this(id: id);
|
||||
|
||||
@override
|
||||
SyncRunOut source_(String source_) => this(source_: source_);
|
||||
|
||||
@override
|
||||
SyncRunOut startedAt(DateTime startedAt) => this(startedAt: startedAt);
|
||||
|
||||
@override
|
||||
SyncRunOut status(RunStatus status) => this(status: status);
|
||||
|
||||
@override
|
||||
SyncRunOut triggeredBy(String triggeredBy) => this(triggeredBy: triggeredBy);
|
||||
|
||||
@override
|
||||
SyncRunOut warnings(List<Object>? warnings) => this(warnings: warnings);
|
||||
|
||||
@override
|
||||
/// This function **does support** nullification of nullable fields. All `null` values passed to `non-nullable` fields will be ignored. You can also use `SyncRunOut(...).copyWith.fieldName(...)` to override fields one at a time with nullification support.
|
||||
///
|
||||
/// Usage
|
||||
/// ```dart
|
||||
/// SyncRunOut(...).copyWith(id: 12, name: "My name")
|
||||
/// ````
|
||||
SyncRunOut call({
|
||||
Object? counts = const $CopyWithPlaceholder(),
|
||||
Object? cursorAfter = const $CopyWithPlaceholder(),
|
||||
Object? cursorBefore = const $CopyWithPlaceholder(),
|
||||
Object? error = const $CopyWithPlaceholder(),
|
||||
Object? finishedAt = const $CopyWithPlaceholder(),
|
||||
Object? id = const $CopyWithPlaceholder(),
|
||||
Object? source_ = const $CopyWithPlaceholder(),
|
||||
Object? startedAt = const $CopyWithPlaceholder(),
|
||||
Object? status = const $CopyWithPlaceholder(),
|
||||
Object? triggeredBy = const $CopyWithPlaceholder(),
|
||||
Object? warnings = const $CopyWithPlaceholder(),
|
||||
}) {
|
||||
return SyncRunOut(
|
||||
counts: counts == const $CopyWithPlaceholder()
|
||||
? _value.counts
|
||||
// ignore: cast_nullable_to_non_nullable
|
||||
: counts as Map<String, Object>?,
|
||||
cursorAfter: cursorAfter == const $CopyWithPlaceholder()
|
||||
? _value.cursorAfter
|
||||
// ignore: cast_nullable_to_non_nullable
|
||||
: cursorAfter as String?,
|
||||
cursorBefore: cursorBefore == const $CopyWithPlaceholder()
|
||||
? _value.cursorBefore
|
||||
// ignore: cast_nullable_to_non_nullable
|
||||
: cursorBefore as String?,
|
||||
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 String,
|
||||
source_: source_ == const $CopyWithPlaceholder()
|
||||
? _value.source_
|
||||
// ignore: cast_nullable_to_non_nullable
|
||||
: source_ as String,
|
||||
startedAt: startedAt == const $CopyWithPlaceholder()
|
||||
? _value.startedAt
|
||||
// ignore: cast_nullable_to_non_nullable
|
||||
: startedAt as DateTime,
|
||||
status: status == const $CopyWithPlaceholder()
|
||||
? _value.status
|
||||
// ignore: cast_nullable_to_non_nullable
|
||||
: status as RunStatus,
|
||||
triggeredBy: triggeredBy == const $CopyWithPlaceholder()
|
||||
? _value.triggeredBy
|
||||
// ignore: cast_nullable_to_non_nullable
|
||||
: triggeredBy as String,
|
||||
warnings: warnings == const $CopyWithPlaceholder()
|
||||
? _value.warnings
|
||||
// ignore: cast_nullable_to_non_nullable
|
||||
: warnings as List<Object>?,
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
extension $SyncRunOutCopyWith on SyncRunOut {
|
||||
/// Returns a callable class that can be used as follows: `instanceOfSyncRunOut.copyWith(...)` or like so:`instanceOfSyncRunOut.copyWith.fieldName(...)`.
|
||||
// ignore: library_private_types_in_public_api
|
||||
_$SyncRunOutCWProxy get copyWith => _$SyncRunOutCWProxyImpl(this);
|
||||
}
|
||||
|
||||
// **************************************************************************
|
||||
// JsonSerializableGenerator
|
||||
// **************************************************************************
|
||||
|
||||
SyncRunOut _$SyncRunOutFromJson(Map<String, dynamic> json) => $checkedCreate(
|
||||
'SyncRunOut',
|
||||
json,
|
||||
($checkedConvert) {
|
||||
$checkKeys(
|
||||
json,
|
||||
requiredKeys: const [
|
||||
'counts',
|
||||
'cursor_after',
|
||||
'cursor_before',
|
||||
'error',
|
||||
'finished_at',
|
||||
'id',
|
||||
'source',
|
||||
'started_at',
|
||||
'status',
|
||||
'triggered_by',
|
||||
'warnings',
|
||||
],
|
||||
);
|
||||
final val = SyncRunOut(
|
||||
counts: $checkedConvert(
|
||||
'counts',
|
||||
(v) => (v as Map<String, dynamic>?)?.map(
|
||||
(k, e) => MapEntry(k, e as Object),
|
||||
),
|
||||
),
|
||||
cursorAfter: $checkedConvert('cursor_after', (v) => v as String?),
|
||||
cursorBefore: $checkedConvert('cursor_before', (v) => v as String?),
|
||||
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 String),
|
||||
source_: $checkedConvert('source', (v) => v as String),
|
||||
startedAt: $checkedConvert(
|
||||
'started_at',
|
||||
(v) => DateTime.parse(v as String),
|
||||
),
|
||||
status: $checkedConvert(
|
||||
'status',
|
||||
(v) => $enumDecode(
|
||||
_$RunStatusEnumMap,
|
||||
v,
|
||||
unknownValue: RunStatus.unknownDefaultOpenApi,
|
||||
),
|
||||
),
|
||||
triggeredBy: $checkedConvert('triggered_by', (v) => v as String),
|
||||
warnings: $checkedConvert(
|
||||
'warnings',
|
||||
(v) => (v as List<dynamic>?)?.map((e) => e as Object).toList(),
|
||||
),
|
||||
);
|
||||
return val;
|
||||
},
|
||||
fieldKeyMap: const {
|
||||
'cursorAfter': 'cursor_after',
|
||||
'cursorBefore': 'cursor_before',
|
||||
'finishedAt': 'finished_at',
|
||||
'source_': 'source',
|
||||
'startedAt': 'started_at',
|
||||
'triggeredBy': 'triggered_by',
|
||||
},
|
||||
);
|
||||
|
||||
Map<String, dynamic> _$SyncRunOutToJson(SyncRunOut instance) =>
|
||||
<String, dynamic>{
|
||||
'counts': instance.counts,
|
||||
'cursor_after': instance.cursorAfter,
|
||||
'cursor_before': instance.cursorBefore,
|
||||
'error': instance.error,
|
||||
'finished_at': instance.finishedAt?.toIso8601String(),
|
||||
'id': instance.id,
|
||||
'source': instance.source_,
|
||||
'started_at': instance.startedAt.toIso8601String(),
|
||||
'status': _$RunStatusEnumMap[instance.status]!,
|
||||
'triggered_by': instance.triggeredBy,
|
||||
'warnings': instance.warnings,
|
||||
};
|
||||
|
||||
const _$RunStatusEnumMap = {
|
||||
RunStatus.running: 'running',
|
||||
RunStatus.ok: 'ok',
|
||||
RunStatus.error: 'error',
|
||||
RunStatus.unknownDefaultOpenApi: 'unknown_default_open_api',
|
||||
};
|
||||
@@ -0,0 +1,106 @@
|
||||
//
|
||||
// AUTO-GENERATED FILE, DO NOT MODIFY!
|
||||
//
|
||||
|
||||
// ignore_for_file: unused_element
|
||||
import 'package:copy_with_extension/copy_with_extension.dart';
|
||||
import 'package:json_annotation/json_annotation.dart';
|
||||
|
||||
part 'token_pair.g.dart';
|
||||
|
||||
|
||||
@CopyWith()
|
||||
@JsonSerializable(
|
||||
checked: true,
|
||||
createToJson: true,
|
||||
disallowUnrecognizedKeys: false,
|
||||
explicitToJson: true,
|
||||
)
|
||||
class TokenPair {
|
||||
/// Returns a new [TokenPair] instance.
|
||||
TokenPair({
|
||||
|
||||
required this.accessToken,
|
||||
|
||||
required this.expiresIn,
|
||||
|
||||
required this.refreshToken,
|
||||
|
||||
this.tokenType = 'bearer',
|
||||
});
|
||||
|
||||
@JsonKey(
|
||||
|
||||
name: r'access_token',
|
||||
required: true,
|
||||
includeIfNull: false,
|
||||
)
|
||||
|
||||
|
||||
final String accessToken;
|
||||
|
||||
|
||||
|
||||
@JsonKey(
|
||||
|
||||
name: r'expires_in',
|
||||
required: true,
|
||||
includeIfNull: false,
|
||||
)
|
||||
|
||||
|
||||
final int expiresIn;
|
||||
|
||||
|
||||
|
||||
@JsonKey(
|
||||
|
||||
name: r'refresh_token',
|
||||
required: true,
|
||||
includeIfNull: false,
|
||||
)
|
||||
|
||||
|
||||
final String refreshToken;
|
||||
|
||||
|
||||
|
||||
@JsonKey(
|
||||
defaultValue: 'bearer',
|
||||
name: r'token_type',
|
||||
required: false,
|
||||
includeIfNull: false,
|
||||
)
|
||||
|
||||
|
||||
final String? tokenType;
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
@override
|
||||
bool operator ==(Object other) => identical(this, other) || other is TokenPair &&
|
||||
other.accessToken == accessToken &&
|
||||
other.expiresIn == expiresIn &&
|
||||
other.refreshToken == refreshToken &&
|
||||
other.tokenType == tokenType;
|
||||
|
||||
@override
|
||||
int get hashCode =>
|
||||
accessToken.hashCode +
|
||||
expiresIn.hashCode +
|
||||
refreshToken.hashCode +
|
||||
tokenType.hashCode;
|
||||
|
||||
factory TokenPair.fromJson(Map<String, dynamic> json) => _$TokenPairFromJson(json);
|
||||
|
||||
Map<String, dynamic> toJson() => _$TokenPairToJson(this);
|
||||
|
||||
@override
|
||||
String toString() {
|
||||
return toJson().toString();
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -0,0 +1,124 @@
|
||||
// GENERATED CODE - DO NOT MODIFY BY HAND
|
||||
|
||||
part of 'token_pair.dart';
|
||||
|
||||
// **************************************************************************
|
||||
// CopyWithGenerator
|
||||
// **************************************************************************
|
||||
|
||||
abstract class _$TokenPairCWProxy {
|
||||
TokenPair accessToken(String accessToken);
|
||||
|
||||
TokenPair expiresIn(int expiresIn);
|
||||
|
||||
TokenPair refreshToken(String refreshToken);
|
||||
|
||||
TokenPair tokenType(String? tokenType);
|
||||
|
||||
/// This function **does support** nullification of nullable fields. All `null` values passed to `non-nullable` fields will be ignored. You can also use `TokenPair(...).copyWith.fieldName(...)` to override fields one at a time with nullification support.
|
||||
///
|
||||
/// Usage
|
||||
/// ```dart
|
||||
/// TokenPair(...).copyWith(id: 12, name: "My name")
|
||||
/// ````
|
||||
TokenPair call({
|
||||
String accessToken,
|
||||
int expiresIn,
|
||||
String refreshToken,
|
||||
String? tokenType,
|
||||
});
|
||||
}
|
||||
|
||||
/// Proxy class for `copyWith` functionality. This is a callable class and can be used as follows: `instanceOfTokenPair.copyWith(...)`. Additionally contains functions for specific fields e.g. `instanceOfTokenPair.copyWith.fieldName(...)`
|
||||
class _$TokenPairCWProxyImpl implements _$TokenPairCWProxy {
|
||||
const _$TokenPairCWProxyImpl(this._value);
|
||||
|
||||
final TokenPair _value;
|
||||
|
||||
@override
|
||||
TokenPair accessToken(String accessToken) => this(accessToken: accessToken);
|
||||
|
||||
@override
|
||||
TokenPair expiresIn(int expiresIn) => this(expiresIn: expiresIn);
|
||||
|
||||
@override
|
||||
TokenPair refreshToken(String refreshToken) =>
|
||||
this(refreshToken: refreshToken);
|
||||
|
||||
@override
|
||||
TokenPair tokenType(String? tokenType) => this(tokenType: tokenType);
|
||||
|
||||
@override
|
||||
/// This function **does support** nullification of nullable fields. All `null` values passed to `non-nullable` fields will be ignored. You can also use `TokenPair(...).copyWith.fieldName(...)` to override fields one at a time with nullification support.
|
||||
///
|
||||
/// Usage
|
||||
/// ```dart
|
||||
/// TokenPair(...).copyWith(id: 12, name: "My name")
|
||||
/// ````
|
||||
TokenPair call({
|
||||
Object? accessToken = const $CopyWithPlaceholder(),
|
||||
Object? expiresIn = const $CopyWithPlaceholder(),
|
||||
Object? refreshToken = const $CopyWithPlaceholder(),
|
||||
Object? tokenType = const $CopyWithPlaceholder(),
|
||||
}) {
|
||||
return TokenPair(
|
||||
accessToken: accessToken == const $CopyWithPlaceholder()
|
||||
? _value.accessToken
|
||||
// ignore: cast_nullable_to_non_nullable
|
||||
: accessToken as String,
|
||||
expiresIn: expiresIn == const $CopyWithPlaceholder()
|
||||
? _value.expiresIn
|
||||
// ignore: cast_nullable_to_non_nullable
|
||||
: expiresIn as int,
|
||||
refreshToken: refreshToken == const $CopyWithPlaceholder()
|
||||
? _value.refreshToken
|
||||
// ignore: cast_nullable_to_non_nullable
|
||||
: refreshToken as String,
|
||||
tokenType: tokenType == const $CopyWithPlaceholder()
|
||||
? _value.tokenType
|
||||
// ignore: cast_nullable_to_non_nullable
|
||||
: tokenType as String?,
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
extension $TokenPairCopyWith on TokenPair {
|
||||
/// Returns a callable class that can be used as follows: `instanceOfTokenPair.copyWith(...)` or like so:`instanceOfTokenPair.copyWith.fieldName(...)`.
|
||||
// ignore: library_private_types_in_public_api
|
||||
_$TokenPairCWProxy get copyWith => _$TokenPairCWProxyImpl(this);
|
||||
}
|
||||
|
||||
// **************************************************************************
|
||||
// JsonSerializableGenerator
|
||||
// **************************************************************************
|
||||
|
||||
TokenPair _$TokenPairFromJson(Map<String, dynamic> json) => $checkedCreate(
|
||||
'TokenPair',
|
||||
json,
|
||||
($checkedConvert) {
|
||||
$checkKeys(
|
||||
json,
|
||||
requiredKeys: const ['access_token', 'expires_in', 'refresh_token'],
|
||||
);
|
||||
final val = TokenPair(
|
||||
accessToken: $checkedConvert('access_token', (v) => v as String),
|
||||
expiresIn: $checkedConvert('expires_in', (v) => (v as num).toInt()),
|
||||
refreshToken: $checkedConvert('refresh_token', (v) => v as String),
|
||||
tokenType: $checkedConvert('token_type', (v) => v as String? ?? 'bearer'),
|
||||
);
|
||||
return val;
|
||||
},
|
||||
fieldKeyMap: const {
|
||||
'accessToken': 'access_token',
|
||||
'expiresIn': 'expires_in',
|
||||
'refreshToken': 'refresh_token',
|
||||
'tokenType': 'token_type',
|
||||
},
|
||||
);
|
||||
|
||||
Map<String, dynamic> _$TokenPairToJson(TokenPair instance) => <String, dynamic>{
|
||||
'access_token': instance.accessToken,
|
||||
'expires_in': instance.expiresIn,
|
||||
'refresh_token': instance.refreshToken,
|
||||
'token_type': ?instance.tokenType,
|
||||
};
|
||||
@@ -0,0 +1,416 @@
|
||||
//
|
||||
// AUTO-GENERATED FILE, DO NOT MODIFY!
|
||||
//
|
||||
|
||||
// ignore_for_file: unused_element
|
||||
import 'package:fintracker_api/src/model/flow_type.dart';
|
||||
import 'package:copy_with_extension/copy_with_extension.dart';
|
||||
import 'package:json_annotation/json_annotation.dart';
|
||||
|
||||
part 'transaction_out.g.dart';
|
||||
|
||||
|
||||
@CopyWith()
|
||||
@JsonSerializable(
|
||||
checked: true,
|
||||
createToJson: true,
|
||||
disallowUnrecognizedKeys: false,
|
||||
explicitToJson: true,
|
||||
)
|
||||
class TransactionOut {
|
||||
/// Returns a new [TransactionOut] instance.
|
||||
TransactionOut({
|
||||
|
||||
required this.categoryId,
|
||||
|
||||
required this.comment,
|
||||
|
||||
required this.date,
|
||||
|
||||
required this.deleted,
|
||||
|
||||
required this.flowType,
|
||||
|
||||
required this.hold,
|
||||
|
||||
required this.id,
|
||||
|
||||
required this.income,
|
||||
|
||||
required this.incomeAccountId,
|
||||
|
||||
required this.incomeCurrency,
|
||||
|
||||
required this.incomeRub,
|
||||
|
||||
required this.isOneOff,
|
||||
|
||||
required this.mcc,
|
||||
|
||||
required this.outcome,
|
||||
|
||||
required this.outcomeAccountId,
|
||||
|
||||
required this.outcomeCurrency,
|
||||
|
||||
required this.outcomeRub,
|
||||
|
||||
required this.payee,
|
||||
|
||||
required this.payeeCanonical,
|
||||
|
||||
required this.sourceId,
|
||||
|
||||
required this.tags,
|
||||
|
||||
required this.tripId,
|
||||
|
||||
required this.ts,
|
||||
});
|
||||
|
||||
@JsonKey(
|
||||
|
||||
name: r'category_id',
|
||||
required: true,
|
||||
includeIfNull: true,
|
||||
)
|
||||
|
||||
|
||||
final int? categoryId;
|
||||
|
||||
|
||||
|
||||
@JsonKey(
|
||||
|
||||
name: r'comment',
|
||||
required: true,
|
||||
includeIfNull: true,
|
||||
)
|
||||
|
||||
|
||||
final String? comment;
|
||||
|
||||
|
||||
|
||||
@JsonKey(
|
||||
|
||||
name: r'date',
|
||||
required: true,
|
||||
includeIfNull: false,
|
||||
)
|
||||
|
||||
|
||||
final DateTime date;
|
||||
|
||||
|
||||
|
||||
@JsonKey(
|
||||
|
||||
name: r'deleted',
|
||||
required: true,
|
||||
includeIfNull: false,
|
||||
)
|
||||
|
||||
|
||||
final bool deleted;
|
||||
|
||||
|
||||
|
||||
@JsonKey(
|
||||
|
||||
name: r'flow_type',
|
||||
required: true,
|
||||
includeIfNull: false,
|
||||
unknownEnumValue: FlowType.unknownDefaultOpenApi,
|
||||
)
|
||||
|
||||
|
||||
final FlowType flowType;
|
||||
|
||||
|
||||
|
||||
@JsonKey(
|
||||
|
||||
name: r'hold',
|
||||
required: true,
|
||||
includeIfNull: false,
|
||||
)
|
||||
|
||||
|
||||
final bool hold;
|
||||
|
||||
|
||||
|
||||
@JsonKey(
|
||||
|
||||
name: r'id',
|
||||
required: true,
|
||||
includeIfNull: false,
|
||||
)
|
||||
|
||||
|
||||
final int id;
|
||||
|
||||
|
||||
|
||||
/// decimal as string
|
||||
@JsonKey(
|
||||
|
||||
name: r'income',
|
||||
required: true,
|
||||
includeIfNull: false,
|
||||
)
|
||||
|
||||
|
||||
final String income;
|
||||
|
||||
|
||||
|
||||
@JsonKey(
|
||||
|
||||
name: r'income_account_id',
|
||||
required: true,
|
||||
includeIfNull: true,
|
||||
)
|
||||
|
||||
|
||||
final int? incomeAccountId;
|
||||
|
||||
|
||||
|
||||
@JsonKey(
|
||||
|
||||
name: r'income_currency',
|
||||
required: true,
|
||||
includeIfNull: true,
|
||||
)
|
||||
|
||||
|
||||
final String? incomeCurrency;
|
||||
|
||||
|
||||
|
||||
/// decimal as string
|
||||
@JsonKey(
|
||||
|
||||
name: r'income_rub',
|
||||
required: true,
|
||||
includeIfNull: true,
|
||||
)
|
||||
|
||||
|
||||
final String? incomeRub;
|
||||
|
||||
|
||||
|
||||
@JsonKey(
|
||||
|
||||
name: r'is_one_off',
|
||||
required: true,
|
||||
includeIfNull: false,
|
||||
)
|
||||
|
||||
|
||||
final bool isOneOff;
|
||||
|
||||
|
||||
|
||||
@JsonKey(
|
||||
|
||||
name: r'mcc',
|
||||
required: true,
|
||||
includeIfNull: true,
|
||||
)
|
||||
|
||||
|
||||
final int? mcc;
|
||||
|
||||
|
||||
|
||||
/// decimal as string
|
||||
@JsonKey(
|
||||
|
||||
name: r'outcome',
|
||||
required: true,
|
||||
includeIfNull: false,
|
||||
)
|
||||
|
||||
|
||||
final String outcome;
|
||||
|
||||
|
||||
|
||||
@JsonKey(
|
||||
|
||||
name: r'outcome_account_id',
|
||||
required: true,
|
||||
includeIfNull: true,
|
||||
)
|
||||
|
||||
|
||||
final int? outcomeAccountId;
|
||||
|
||||
|
||||
|
||||
@JsonKey(
|
||||
|
||||
name: r'outcome_currency',
|
||||
required: true,
|
||||
includeIfNull: true,
|
||||
)
|
||||
|
||||
|
||||
final String? outcomeCurrency;
|
||||
|
||||
|
||||
|
||||
/// decimal as string
|
||||
@JsonKey(
|
||||
|
||||
name: r'outcome_rub',
|
||||
required: true,
|
||||
includeIfNull: true,
|
||||
)
|
||||
|
||||
|
||||
final String? outcomeRub;
|
||||
|
||||
|
||||
|
||||
@JsonKey(
|
||||
|
||||
name: r'payee',
|
||||
required: true,
|
||||
includeIfNull: true,
|
||||
)
|
||||
|
||||
|
||||
final String? payee;
|
||||
|
||||
|
||||
|
||||
@JsonKey(
|
||||
|
||||
name: r'payee_canonical',
|
||||
required: true,
|
||||
includeIfNull: true,
|
||||
)
|
||||
|
||||
|
||||
final String? payeeCanonical;
|
||||
|
||||
|
||||
|
||||
@JsonKey(
|
||||
|
||||
name: r'source_id',
|
||||
required: true,
|
||||
includeIfNull: false,
|
||||
)
|
||||
|
||||
|
||||
final String sourceId;
|
||||
|
||||
|
||||
|
||||
@JsonKey(
|
||||
|
||||
name: r'tags',
|
||||
required: true,
|
||||
includeIfNull: false,
|
||||
)
|
||||
|
||||
|
||||
final List<int> tags;
|
||||
|
||||
|
||||
|
||||
@JsonKey(
|
||||
|
||||
name: r'trip_id',
|
||||
required: true,
|
||||
includeIfNull: true,
|
||||
)
|
||||
|
||||
|
||||
final int? tripId;
|
||||
|
||||
|
||||
|
||||
@JsonKey(
|
||||
|
||||
name: r'ts',
|
||||
required: true,
|
||||
includeIfNull: false,
|
||||
)
|
||||
|
||||
|
||||
final DateTime ts;
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
@override
|
||||
bool operator ==(Object other) => identical(this, other) || other is TransactionOut &&
|
||||
other.categoryId == categoryId &&
|
||||
other.comment == comment &&
|
||||
other.date == date &&
|
||||
other.deleted == deleted &&
|
||||
other.flowType == flowType &&
|
||||
other.hold == hold &&
|
||||
other.id == id &&
|
||||
other.income == income &&
|
||||
other.incomeAccountId == incomeAccountId &&
|
||||
other.incomeCurrency == incomeCurrency &&
|
||||
other.incomeRub == incomeRub &&
|
||||
other.isOneOff == isOneOff &&
|
||||
other.mcc == mcc &&
|
||||
other.outcome == outcome &&
|
||||
other.outcomeAccountId == outcomeAccountId &&
|
||||
other.outcomeCurrency == outcomeCurrency &&
|
||||
other.outcomeRub == outcomeRub &&
|
||||
other.payee == payee &&
|
||||
other.payeeCanonical == payeeCanonical &&
|
||||
other.sourceId == sourceId &&
|
||||
other.tags == tags &&
|
||||
other.tripId == tripId &&
|
||||
other.ts == ts;
|
||||
|
||||
@override
|
||||
int get hashCode =>
|
||||
(categoryId == null ? 0 : categoryId.hashCode) +
|
||||
(comment == null ? 0 : comment.hashCode) +
|
||||
date.hashCode +
|
||||
deleted.hashCode +
|
||||
flowType.hashCode +
|
||||
hold.hashCode +
|
||||
id.hashCode +
|
||||
income.hashCode +
|
||||
(incomeAccountId == null ? 0 : incomeAccountId.hashCode) +
|
||||
(incomeCurrency == null ? 0 : incomeCurrency.hashCode) +
|
||||
(incomeRub == null ? 0 : incomeRub.hashCode) +
|
||||
isOneOff.hashCode +
|
||||
(mcc == null ? 0 : mcc.hashCode) +
|
||||
outcome.hashCode +
|
||||
(outcomeAccountId == null ? 0 : outcomeAccountId.hashCode) +
|
||||
(outcomeCurrency == null ? 0 : outcomeCurrency.hashCode) +
|
||||
(outcomeRub == null ? 0 : outcomeRub.hashCode) +
|
||||
(payee == null ? 0 : payee.hashCode) +
|
||||
(payeeCanonical == null ? 0 : payeeCanonical.hashCode) +
|
||||
sourceId.hashCode +
|
||||
tags.hashCode +
|
||||
(tripId == null ? 0 : tripId.hashCode) +
|
||||
ts.hashCode;
|
||||
|
||||
factory TransactionOut.fromJson(Map<String, dynamic> json) => _$TransactionOutFromJson(json);
|
||||
|
||||
Map<String, dynamic> toJson() => _$TransactionOutToJson(this);
|
||||
|
||||
@override
|
||||
String toString() {
|
||||
return toJson().toString();
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -0,0 +1,437 @@
|
||||
// GENERATED CODE - DO NOT MODIFY BY HAND
|
||||
|
||||
part of 'transaction_out.dart';
|
||||
|
||||
// **************************************************************************
|
||||
// CopyWithGenerator
|
||||
// **************************************************************************
|
||||
|
||||
abstract class _$TransactionOutCWProxy {
|
||||
TransactionOut categoryId(int? categoryId);
|
||||
|
||||
TransactionOut comment(String? comment);
|
||||
|
||||
TransactionOut date(DateTime date);
|
||||
|
||||
TransactionOut deleted(bool deleted);
|
||||
|
||||
TransactionOut flowType(FlowType flowType);
|
||||
|
||||
TransactionOut hold(bool hold);
|
||||
|
||||
TransactionOut id(int id);
|
||||
|
||||
TransactionOut income(String income);
|
||||
|
||||
TransactionOut incomeAccountId(int? incomeAccountId);
|
||||
|
||||
TransactionOut incomeCurrency(String? incomeCurrency);
|
||||
|
||||
TransactionOut incomeRub(String? incomeRub);
|
||||
|
||||
TransactionOut isOneOff(bool isOneOff);
|
||||
|
||||
TransactionOut mcc(int? mcc);
|
||||
|
||||
TransactionOut outcome(String outcome);
|
||||
|
||||
TransactionOut outcomeAccountId(int? outcomeAccountId);
|
||||
|
||||
TransactionOut outcomeCurrency(String? outcomeCurrency);
|
||||
|
||||
TransactionOut outcomeRub(String? outcomeRub);
|
||||
|
||||
TransactionOut payee(String? payee);
|
||||
|
||||
TransactionOut payeeCanonical(String? payeeCanonical);
|
||||
|
||||
TransactionOut sourceId(String sourceId);
|
||||
|
||||
TransactionOut tags(List<int> tags);
|
||||
|
||||
TransactionOut tripId(int? tripId);
|
||||
|
||||
TransactionOut ts(DateTime ts);
|
||||
|
||||
/// This function **does support** nullification of nullable fields. All `null` values passed to `non-nullable` fields will be ignored. You can also use `TransactionOut(...).copyWith.fieldName(...)` to override fields one at a time with nullification support.
|
||||
///
|
||||
/// Usage
|
||||
/// ```dart
|
||||
/// TransactionOut(...).copyWith(id: 12, name: "My name")
|
||||
/// ````
|
||||
TransactionOut call({
|
||||
int? categoryId,
|
||||
String? comment,
|
||||
DateTime date,
|
||||
bool deleted,
|
||||
FlowType flowType,
|
||||
bool hold,
|
||||
int id,
|
||||
String income,
|
||||
int? incomeAccountId,
|
||||
String? incomeCurrency,
|
||||
String? incomeRub,
|
||||
bool isOneOff,
|
||||
int? mcc,
|
||||
String outcome,
|
||||
int? outcomeAccountId,
|
||||
String? outcomeCurrency,
|
||||
String? outcomeRub,
|
||||
String? payee,
|
||||
String? payeeCanonical,
|
||||
String sourceId,
|
||||
List<int> tags,
|
||||
int? tripId,
|
||||
DateTime ts,
|
||||
});
|
||||
}
|
||||
|
||||
/// Proxy class for `copyWith` functionality. This is a callable class and can be used as follows: `instanceOfTransactionOut.copyWith(...)`. Additionally contains functions for specific fields e.g. `instanceOfTransactionOut.copyWith.fieldName(...)`
|
||||
class _$TransactionOutCWProxyImpl implements _$TransactionOutCWProxy {
|
||||
const _$TransactionOutCWProxyImpl(this._value);
|
||||
|
||||
final TransactionOut _value;
|
||||
|
||||
@override
|
||||
TransactionOut categoryId(int? categoryId) => this(categoryId: categoryId);
|
||||
|
||||
@override
|
||||
TransactionOut comment(String? comment) => this(comment: comment);
|
||||
|
||||
@override
|
||||
TransactionOut date(DateTime date) => this(date: date);
|
||||
|
||||
@override
|
||||
TransactionOut deleted(bool deleted) => this(deleted: deleted);
|
||||
|
||||
@override
|
||||
TransactionOut flowType(FlowType flowType) => this(flowType: flowType);
|
||||
|
||||
@override
|
||||
TransactionOut hold(bool hold) => this(hold: hold);
|
||||
|
||||
@override
|
||||
TransactionOut id(int id) => this(id: id);
|
||||
|
||||
@override
|
||||
TransactionOut income(String income) => this(income: income);
|
||||
|
||||
@override
|
||||
TransactionOut incomeAccountId(int? incomeAccountId) =>
|
||||
this(incomeAccountId: incomeAccountId);
|
||||
|
||||
@override
|
||||
TransactionOut incomeCurrency(String? incomeCurrency) =>
|
||||
this(incomeCurrency: incomeCurrency);
|
||||
|
||||
@override
|
||||
TransactionOut incomeRub(String? incomeRub) => this(incomeRub: incomeRub);
|
||||
|
||||
@override
|
||||
TransactionOut isOneOff(bool isOneOff) => this(isOneOff: isOneOff);
|
||||
|
||||
@override
|
||||
TransactionOut mcc(int? mcc) => this(mcc: mcc);
|
||||
|
||||
@override
|
||||
TransactionOut outcome(String outcome) => this(outcome: outcome);
|
||||
|
||||
@override
|
||||
TransactionOut outcomeAccountId(int? outcomeAccountId) =>
|
||||
this(outcomeAccountId: outcomeAccountId);
|
||||
|
||||
@override
|
||||
TransactionOut outcomeCurrency(String? outcomeCurrency) =>
|
||||
this(outcomeCurrency: outcomeCurrency);
|
||||
|
||||
@override
|
||||
TransactionOut outcomeRub(String? outcomeRub) => this(outcomeRub: outcomeRub);
|
||||
|
||||
@override
|
||||
TransactionOut payee(String? payee) => this(payee: payee);
|
||||
|
||||
@override
|
||||
TransactionOut payeeCanonical(String? payeeCanonical) =>
|
||||
this(payeeCanonical: payeeCanonical);
|
||||
|
||||
@override
|
||||
TransactionOut sourceId(String sourceId) => this(sourceId: sourceId);
|
||||
|
||||
@override
|
||||
TransactionOut tags(List<int> tags) => this(tags: tags);
|
||||
|
||||
@override
|
||||
TransactionOut tripId(int? tripId) => this(tripId: tripId);
|
||||
|
||||
@override
|
||||
TransactionOut ts(DateTime ts) => this(ts: ts);
|
||||
|
||||
@override
|
||||
/// This function **does support** nullification of nullable fields. All `null` values passed to `non-nullable` fields will be ignored. You can also use `TransactionOut(...).copyWith.fieldName(...)` to override fields one at a time with nullification support.
|
||||
///
|
||||
/// Usage
|
||||
/// ```dart
|
||||
/// TransactionOut(...).copyWith(id: 12, name: "My name")
|
||||
/// ````
|
||||
TransactionOut call({
|
||||
Object? categoryId = const $CopyWithPlaceholder(),
|
||||
Object? comment = const $CopyWithPlaceholder(),
|
||||
Object? date = const $CopyWithPlaceholder(),
|
||||
Object? deleted = const $CopyWithPlaceholder(),
|
||||
Object? flowType = const $CopyWithPlaceholder(),
|
||||
Object? hold = const $CopyWithPlaceholder(),
|
||||
Object? id = const $CopyWithPlaceholder(),
|
||||
Object? income = const $CopyWithPlaceholder(),
|
||||
Object? incomeAccountId = const $CopyWithPlaceholder(),
|
||||
Object? incomeCurrency = const $CopyWithPlaceholder(),
|
||||
Object? incomeRub = const $CopyWithPlaceholder(),
|
||||
Object? isOneOff = const $CopyWithPlaceholder(),
|
||||
Object? mcc = const $CopyWithPlaceholder(),
|
||||
Object? outcome = const $CopyWithPlaceholder(),
|
||||
Object? outcomeAccountId = const $CopyWithPlaceholder(),
|
||||
Object? outcomeCurrency = const $CopyWithPlaceholder(),
|
||||
Object? outcomeRub = const $CopyWithPlaceholder(),
|
||||
Object? payee = const $CopyWithPlaceholder(),
|
||||
Object? payeeCanonical = const $CopyWithPlaceholder(),
|
||||
Object? sourceId = const $CopyWithPlaceholder(),
|
||||
Object? tags = const $CopyWithPlaceholder(),
|
||||
Object? tripId = const $CopyWithPlaceholder(),
|
||||
Object? ts = const $CopyWithPlaceholder(),
|
||||
}) {
|
||||
return TransactionOut(
|
||||
categoryId: categoryId == const $CopyWithPlaceholder()
|
||||
? _value.categoryId
|
||||
// ignore: cast_nullable_to_non_nullable
|
||||
: categoryId as int?,
|
||||
comment: comment == const $CopyWithPlaceholder()
|
||||
? _value.comment
|
||||
// ignore: cast_nullable_to_non_nullable
|
||||
: comment as String?,
|
||||
date: date == const $CopyWithPlaceholder()
|
||||
? _value.date
|
||||
// ignore: cast_nullable_to_non_nullable
|
||||
: date as DateTime,
|
||||
deleted: deleted == const $CopyWithPlaceholder()
|
||||
? _value.deleted
|
||||
// ignore: cast_nullable_to_non_nullable
|
||||
: deleted as bool,
|
||||
flowType: flowType == const $CopyWithPlaceholder()
|
||||
? _value.flowType
|
||||
// ignore: cast_nullable_to_non_nullable
|
||||
: flowType as FlowType,
|
||||
hold: hold == const $CopyWithPlaceholder()
|
||||
? _value.hold
|
||||
// ignore: cast_nullable_to_non_nullable
|
||||
: hold as bool,
|
||||
id: id == const $CopyWithPlaceholder()
|
||||
? _value.id
|
||||
// ignore: cast_nullable_to_non_nullable
|
||||
: id as int,
|
||||
income: income == const $CopyWithPlaceholder()
|
||||
? _value.income
|
||||
// ignore: cast_nullable_to_non_nullable
|
||||
: income as String,
|
||||
incomeAccountId: incomeAccountId == const $CopyWithPlaceholder()
|
||||
? _value.incomeAccountId
|
||||
// ignore: cast_nullable_to_non_nullable
|
||||
: incomeAccountId as int?,
|
||||
incomeCurrency: incomeCurrency == const $CopyWithPlaceholder()
|
||||
? _value.incomeCurrency
|
||||
// ignore: cast_nullable_to_non_nullable
|
||||
: incomeCurrency as String?,
|
||||
incomeRub: incomeRub == const $CopyWithPlaceholder()
|
||||
? _value.incomeRub
|
||||
// ignore: cast_nullable_to_non_nullable
|
||||
: incomeRub as String?,
|
||||
isOneOff: isOneOff == const $CopyWithPlaceholder()
|
||||
? _value.isOneOff
|
||||
// ignore: cast_nullable_to_non_nullable
|
||||
: isOneOff as bool,
|
||||
mcc: mcc == const $CopyWithPlaceholder()
|
||||
? _value.mcc
|
||||
// ignore: cast_nullable_to_non_nullable
|
||||
: mcc as int?,
|
||||
outcome: outcome == const $CopyWithPlaceholder()
|
||||
? _value.outcome
|
||||
// ignore: cast_nullable_to_non_nullable
|
||||
: outcome as String,
|
||||
outcomeAccountId: outcomeAccountId == const $CopyWithPlaceholder()
|
||||
? _value.outcomeAccountId
|
||||
// ignore: cast_nullable_to_non_nullable
|
||||
: outcomeAccountId as int?,
|
||||
outcomeCurrency: outcomeCurrency == const $CopyWithPlaceholder()
|
||||
? _value.outcomeCurrency
|
||||
// ignore: cast_nullable_to_non_nullable
|
||||
: outcomeCurrency as String?,
|
||||
outcomeRub: outcomeRub == const $CopyWithPlaceholder()
|
||||
? _value.outcomeRub
|
||||
// ignore: cast_nullable_to_non_nullable
|
||||
: outcomeRub as String?,
|
||||
payee: payee == const $CopyWithPlaceholder()
|
||||
? _value.payee
|
||||
// ignore: cast_nullable_to_non_nullable
|
||||
: payee as String?,
|
||||
payeeCanonical: payeeCanonical == const $CopyWithPlaceholder()
|
||||
? _value.payeeCanonical
|
||||
// ignore: cast_nullable_to_non_nullable
|
||||
: payeeCanonical as String?,
|
||||
sourceId: sourceId == const $CopyWithPlaceholder()
|
||||
? _value.sourceId
|
||||
// ignore: cast_nullable_to_non_nullable
|
||||
: sourceId as String,
|
||||
tags: tags == const $CopyWithPlaceholder()
|
||||
? _value.tags
|
||||
// ignore: cast_nullable_to_non_nullable
|
||||
: tags as List<int>,
|
||||
tripId: tripId == const $CopyWithPlaceholder()
|
||||
? _value.tripId
|
||||
// ignore: cast_nullable_to_non_nullable
|
||||
: tripId as int?,
|
||||
ts: ts == const $CopyWithPlaceholder()
|
||||
? _value.ts
|
||||
// ignore: cast_nullable_to_non_nullable
|
||||
: ts as DateTime,
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
extension $TransactionOutCopyWith on TransactionOut {
|
||||
/// Returns a callable class that can be used as follows: `instanceOfTransactionOut.copyWith(...)` or like so:`instanceOfTransactionOut.copyWith.fieldName(...)`.
|
||||
// ignore: library_private_types_in_public_api
|
||||
_$TransactionOutCWProxy get copyWith => _$TransactionOutCWProxyImpl(this);
|
||||
}
|
||||
|
||||
// **************************************************************************
|
||||
// JsonSerializableGenerator
|
||||
// **************************************************************************
|
||||
|
||||
TransactionOut _$TransactionOutFromJson(
|
||||
Map<String, dynamic> json,
|
||||
) => $checkedCreate(
|
||||
'TransactionOut',
|
||||
json,
|
||||
($checkedConvert) {
|
||||
$checkKeys(
|
||||
json,
|
||||
requiredKeys: const [
|
||||
'category_id',
|
||||
'comment',
|
||||
'date',
|
||||
'deleted',
|
||||
'flow_type',
|
||||
'hold',
|
||||
'id',
|
||||
'income',
|
||||
'income_account_id',
|
||||
'income_currency',
|
||||
'income_rub',
|
||||
'is_one_off',
|
||||
'mcc',
|
||||
'outcome',
|
||||
'outcome_account_id',
|
||||
'outcome_currency',
|
||||
'outcome_rub',
|
||||
'payee',
|
||||
'payee_canonical',
|
||||
'source_id',
|
||||
'tags',
|
||||
'trip_id',
|
||||
'ts',
|
||||
],
|
||||
);
|
||||
final val = TransactionOut(
|
||||
categoryId: $checkedConvert('category_id', (v) => (v as num?)?.toInt()),
|
||||
comment: $checkedConvert('comment', (v) => v as String?),
|
||||
date: $checkedConvert('date', (v) => DateTime.parse(v as String)),
|
||||
deleted: $checkedConvert('deleted', (v) => v as bool),
|
||||
flowType: $checkedConvert(
|
||||
'flow_type',
|
||||
(v) => $enumDecode(
|
||||
_$FlowTypeEnumMap,
|
||||
v,
|
||||
unknownValue: FlowType.unknownDefaultOpenApi,
|
||||
),
|
||||
),
|
||||
hold: $checkedConvert('hold', (v) => v as bool),
|
||||
id: $checkedConvert('id', (v) => (v as num).toInt()),
|
||||
income: $checkedConvert('income', (v) => v as String),
|
||||
incomeAccountId: $checkedConvert(
|
||||
'income_account_id',
|
||||
(v) => (v as num?)?.toInt(),
|
||||
),
|
||||
incomeCurrency: $checkedConvert('income_currency', (v) => v as String?),
|
||||
incomeRub: $checkedConvert('income_rub', (v) => v as String?),
|
||||
isOneOff: $checkedConvert('is_one_off', (v) => v as bool),
|
||||
mcc: $checkedConvert('mcc', (v) => (v as num?)?.toInt()),
|
||||
outcome: $checkedConvert('outcome', (v) => v as String),
|
||||
outcomeAccountId: $checkedConvert(
|
||||
'outcome_account_id',
|
||||
(v) => (v as num?)?.toInt(),
|
||||
),
|
||||
outcomeCurrency: $checkedConvert('outcome_currency', (v) => v as String?),
|
||||
outcomeRub: $checkedConvert('outcome_rub', (v) => v as String?),
|
||||
payee: $checkedConvert('payee', (v) => v as String?),
|
||||
payeeCanonical: $checkedConvert('payee_canonical', (v) => v as String?),
|
||||
sourceId: $checkedConvert('source_id', (v) => v as String),
|
||||
tags: $checkedConvert(
|
||||
'tags',
|
||||
(v) => (v as List<dynamic>).map((e) => (e as num).toInt()).toList(),
|
||||
),
|
||||
tripId: $checkedConvert('trip_id', (v) => (v as num?)?.toInt()),
|
||||
ts: $checkedConvert('ts', (v) => DateTime.parse(v as String)),
|
||||
);
|
||||
return val;
|
||||
},
|
||||
fieldKeyMap: const {
|
||||
'categoryId': 'category_id',
|
||||
'flowType': 'flow_type',
|
||||
'incomeAccountId': 'income_account_id',
|
||||
'incomeCurrency': 'income_currency',
|
||||
'incomeRub': 'income_rub',
|
||||
'isOneOff': 'is_one_off',
|
||||
'outcomeAccountId': 'outcome_account_id',
|
||||
'outcomeCurrency': 'outcome_currency',
|
||||
'outcomeRub': 'outcome_rub',
|
||||
'payeeCanonical': 'payee_canonical',
|
||||
'sourceId': 'source_id',
|
||||
'tripId': 'trip_id',
|
||||
},
|
||||
);
|
||||
|
||||
Map<String, dynamic> _$TransactionOutToJson(TransactionOut instance) =>
|
||||
<String, dynamic>{
|
||||
'category_id': instance.categoryId,
|
||||
'comment': instance.comment,
|
||||
'date': instance.date.toIso8601String(),
|
||||
'deleted': instance.deleted,
|
||||
'flow_type': _$FlowTypeEnumMap[instance.flowType]!,
|
||||
'hold': instance.hold,
|
||||
'id': instance.id,
|
||||
'income': instance.income,
|
||||
'income_account_id': instance.incomeAccountId,
|
||||
'income_currency': instance.incomeCurrency,
|
||||
'income_rub': instance.incomeRub,
|
||||
'is_one_off': instance.isOneOff,
|
||||
'mcc': instance.mcc,
|
||||
'outcome': instance.outcome,
|
||||
'outcome_account_id': instance.outcomeAccountId,
|
||||
'outcome_currency': instance.outcomeCurrency,
|
||||
'outcome_rub': instance.outcomeRub,
|
||||
'payee': instance.payee,
|
||||
'payee_canonical': instance.payeeCanonical,
|
||||
'source_id': instance.sourceId,
|
||||
'tags': instance.tags,
|
||||
'trip_id': instance.tripId,
|
||||
'ts': instance.ts.toIso8601String(),
|
||||
};
|
||||
|
||||
const _$FlowTypeEnumMap = {
|
||||
FlowType.income: 'income',
|
||||
FlowType.expense: 'expense',
|
||||
FlowType.internalTransfer: 'internal_transfer',
|
||||
FlowType.savingsTransfer: 'savings_transfer',
|
||||
FlowType.brokerExternalFlow: 'broker_external_flow',
|
||||
FlowType.deleted: 'deleted',
|
||||
FlowType.other: 'other',
|
||||
FlowType.unknownDefaultOpenApi: 'unknown_default_open_api',
|
||||
};
|
||||
@@ -0,0 +1,107 @@
|
||||
//
|
||||
// AUTO-GENERATED FILE, DO NOT MODIFY!
|
||||
//
|
||||
|
||||
// ignore_for_file: unused_element
|
||||
import 'package:fintracker_api/src/model/transaction_out.dart';
|
||||
import 'package:copy_with_extension/copy_with_extension.dart';
|
||||
import 'package:json_annotation/json_annotation.dart';
|
||||
|
||||
part 'transaction_page.g.dart';
|
||||
|
||||
|
||||
@CopyWith()
|
||||
@JsonSerializable(
|
||||
checked: true,
|
||||
createToJson: true,
|
||||
disallowUnrecognizedKeys: false,
|
||||
explicitToJson: true,
|
||||
)
|
||||
class TransactionPage {
|
||||
/// Returns a new [TransactionPage] instance.
|
||||
TransactionPage({
|
||||
|
||||
required this.items,
|
||||
|
||||
required this.page,
|
||||
|
||||
required this.pageSize,
|
||||
|
||||
required this.total,
|
||||
});
|
||||
|
||||
@JsonKey(
|
||||
|
||||
name: r'items',
|
||||
required: true,
|
||||
includeIfNull: false,
|
||||
)
|
||||
|
||||
|
||||
final List<TransactionOut> items;
|
||||
|
||||
|
||||
|
||||
@JsonKey(
|
||||
|
||||
name: r'page',
|
||||
required: true,
|
||||
includeIfNull: false,
|
||||
)
|
||||
|
||||
|
||||
final int page;
|
||||
|
||||
|
||||
|
||||
@JsonKey(
|
||||
|
||||
name: r'page_size',
|
||||
required: true,
|
||||
includeIfNull: false,
|
||||
)
|
||||
|
||||
|
||||
final int pageSize;
|
||||
|
||||
|
||||
|
||||
@JsonKey(
|
||||
|
||||
name: r'total',
|
||||
required: true,
|
||||
includeIfNull: false,
|
||||
)
|
||||
|
||||
|
||||
final int total;
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
@override
|
||||
bool operator ==(Object other) => identical(this, other) || other is TransactionPage &&
|
||||
other.items == items &&
|
||||
other.page == page &&
|
||||
other.pageSize == pageSize &&
|
||||
other.total == total;
|
||||
|
||||
@override
|
||||
int get hashCode =>
|
||||
items.hashCode +
|
||||
page.hashCode +
|
||||
pageSize.hashCode +
|
||||
total.hashCode;
|
||||
|
||||
factory TransactionPage.fromJson(Map<String, dynamic> json) => _$TransactionPageFromJson(json);
|
||||
|
||||
Map<String, dynamic> toJson() => _$TransactionPageToJson(this);
|
||||
|
||||
@override
|
||||
String toString() {
|
||||
return toJson().toString();
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -0,0 +1,120 @@
|
||||
// GENERATED CODE - DO NOT MODIFY BY HAND
|
||||
|
||||
part of 'transaction_page.dart';
|
||||
|
||||
// **************************************************************************
|
||||
// CopyWithGenerator
|
||||
// **************************************************************************
|
||||
|
||||
abstract class _$TransactionPageCWProxy {
|
||||
TransactionPage items(List<TransactionOut> items);
|
||||
|
||||
TransactionPage page(int page);
|
||||
|
||||
TransactionPage pageSize(int pageSize);
|
||||
|
||||
TransactionPage total(int total);
|
||||
|
||||
/// This function **does support** nullification of nullable fields. All `null` values passed to `non-nullable` fields will be ignored. You can also use `TransactionPage(...).copyWith.fieldName(...)` to override fields one at a time with nullification support.
|
||||
///
|
||||
/// Usage
|
||||
/// ```dart
|
||||
/// TransactionPage(...).copyWith(id: 12, name: "My name")
|
||||
/// ````
|
||||
TransactionPage call({
|
||||
List<TransactionOut> items,
|
||||
int page,
|
||||
int pageSize,
|
||||
int total,
|
||||
});
|
||||
}
|
||||
|
||||
/// Proxy class for `copyWith` functionality. This is a callable class and can be used as follows: `instanceOfTransactionPage.copyWith(...)`. Additionally contains functions for specific fields e.g. `instanceOfTransactionPage.copyWith.fieldName(...)`
|
||||
class _$TransactionPageCWProxyImpl implements _$TransactionPageCWProxy {
|
||||
const _$TransactionPageCWProxyImpl(this._value);
|
||||
|
||||
final TransactionPage _value;
|
||||
|
||||
@override
|
||||
TransactionPage items(List<TransactionOut> items) => this(items: items);
|
||||
|
||||
@override
|
||||
TransactionPage page(int page) => this(page: page);
|
||||
|
||||
@override
|
||||
TransactionPage pageSize(int pageSize) => this(pageSize: pageSize);
|
||||
|
||||
@override
|
||||
TransactionPage total(int total) => this(total: total);
|
||||
|
||||
@override
|
||||
/// This function **does support** nullification of nullable fields. All `null` values passed to `non-nullable` fields will be ignored. You can also use `TransactionPage(...).copyWith.fieldName(...)` to override fields one at a time with nullification support.
|
||||
///
|
||||
/// Usage
|
||||
/// ```dart
|
||||
/// TransactionPage(...).copyWith(id: 12, name: "My name")
|
||||
/// ````
|
||||
TransactionPage call({
|
||||
Object? items = const $CopyWithPlaceholder(),
|
||||
Object? page = const $CopyWithPlaceholder(),
|
||||
Object? pageSize = const $CopyWithPlaceholder(),
|
||||
Object? total = const $CopyWithPlaceholder(),
|
||||
}) {
|
||||
return TransactionPage(
|
||||
items: items == const $CopyWithPlaceholder()
|
||||
? _value.items
|
||||
// ignore: cast_nullable_to_non_nullable
|
||||
: items as List<TransactionOut>,
|
||||
page: page == const $CopyWithPlaceholder()
|
||||
? _value.page
|
||||
// ignore: cast_nullable_to_non_nullable
|
||||
: page as int,
|
||||
pageSize: pageSize == const $CopyWithPlaceholder()
|
||||
? _value.pageSize
|
||||
// ignore: cast_nullable_to_non_nullable
|
||||
: pageSize as int,
|
||||
total: total == const $CopyWithPlaceholder()
|
||||
? _value.total
|
||||
// ignore: cast_nullable_to_non_nullable
|
||||
: total as int,
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
extension $TransactionPageCopyWith on TransactionPage {
|
||||
/// Returns a callable class that can be used as follows: `instanceOfTransactionPage.copyWith(...)` or like so:`instanceOfTransactionPage.copyWith.fieldName(...)`.
|
||||
// ignore: library_private_types_in_public_api
|
||||
_$TransactionPageCWProxy get copyWith => _$TransactionPageCWProxyImpl(this);
|
||||
}
|
||||
|
||||
// **************************************************************************
|
||||
// JsonSerializableGenerator
|
||||
// **************************************************************************
|
||||
|
||||
TransactionPage _$TransactionPageFromJson(Map<String, dynamic> json) =>
|
||||
$checkedCreate('TransactionPage', json, ($checkedConvert) {
|
||||
$checkKeys(
|
||||
json,
|
||||
requiredKeys: const ['items', 'page', 'page_size', 'total'],
|
||||
);
|
||||
final val = TransactionPage(
|
||||
items: $checkedConvert(
|
||||
'items',
|
||||
(v) => (v as List<dynamic>)
|
||||
.map((e) => TransactionOut.fromJson(e as Map<String, dynamic>))
|
||||
.toList(),
|
||||
),
|
||||
page: $checkedConvert('page', (v) => (v as num).toInt()),
|
||||
pageSize: $checkedConvert('page_size', (v) => (v as num).toInt()),
|
||||
total: $checkedConvert('total', (v) => (v as num).toInt()),
|
||||
);
|
||||
return val;
|
||||
}, fieldKeyMap: const {'pageSize': 'page_size'});
|
||||
|
||||
Map<String, dynamic> _$TransactionPageToJson(TransactionPage instance) =>
|
||||
<String, dynamic>{
|
||||
'items': instance.items.map((e) => e.toJson()).toList(),
|
||||
'page': instance.page,
|
||||
'page_size': instance.pageSize,
|
||||
'total': instance.total,
|
||||
};
|
||||
@@ -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 'user_out.g.dart';
|
||||
|
||||
|
||||
@CopyWith()
|
||||
@JsonSerializable(
|
||||
checked: true,
|
||||
createToJson: true,
|
||||
disallowUnrecognizedKeys: false,
|
||||
explicitToJson: true,
|
||||
)
|
||||
class UserOut {
|
||||
/// Returns a new [UserOut] instance.
|
||||
UserOut({
|
||||
|
||||
required this.email,
|
||||
|
||||
required this.id,
|
||||
});
|
||||
|
||||
@JsonKey(
|
||||
|
||||
name: r'email',
|
||||
required: true,
|
||||
includeIfNull: false,
|
||||
)
|
||||
|
||||
|
||||
final String email;
|
||||
|
||||
|
||||
|
||||
@JsonKey(
|
||||
|
||||
name: r'id',
|
||||
required: true,
|
||||
includeIfNull: false,
|
||||
)
|
||||
|
||||
|
||||
final int id;
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
@override
|
||||
bool operator ==(Object other) => identical(this, other) || other is UserOut &&
|
||||
other.email == email &&
|
||||
other.id == id;
|
||||
|
||||
@override
|
||||
int get hashCode =>
|
||||
email.hashCode +
|
||||
id.hashCode;
|
||||
|
||||
factory UserOut.fromJson(Map<String, dynamic> json) => _$UserOutFromJson(json);
|
||||
|
||||
Map<String, dynamic> toJson() => _$UserOutToJson(this);
|
||||
|
||||
@override
|
||||
String toString() {
|
||||
return toJson().toString();
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -0,0 +1,82 @@
|
||||
// GENERATED CODE - DO NOT MODIFY BY HAND
|
||||
|
||||
part of 'user_out.dart';
|
||||
|
||||
// **************************************************************************
|
||||
// CopyWithGenerator
|
||||
// **************************************************************************
|
||||
|
||||
abstract class _$UserOutCWProxy {
|
||||
UserOut email(String email);
|
||||
|
||||
UserOut id(int id);
|
||||
|
||||
/// This function **does support** nullification of nullable fields. All `null` values passed to `non-nullable` fields will be ignored. You can also use `UserOut(...).copyWith.fieldName(...)` to override fields one at a time with nullification support.
|
||||
///
|
||||
/// Usage
|
||||
/// ```dart
|
||||
/// UserOut(...).copyWith(id: 12, name: "My name")
|
||||
/// ````
|
||||
UserOut call({String email, int id});
|
||||
}
|
||||
|
||||
/// Proxy class for `copyWith` functionality. This is a callable class and can be used as follows: `instanceOfUserOut.copyWith(...)`. Additionally contains functions for specific fields e.g. `instanceOfUserOut.copyWith.fieldName(...)`
|
||||
class _$UserOutCWProxyImpl implements _$UserOutCWProxy {
|
||||
const _$UserOutCWProxyImpl(this._value);
|
||||
|
||||
final UserOut _value;
|
||||
|
||||
@override
|
||||
UserOut email(String email) => this(email: email);
|
||||
|
||||
@override
|
||||
UserOut id(int id) => this(id: id);
|
||||
|
||||
@override
|
||||
/// This function **does support** nullification of nullable fields. All `null` values passed to `non-nullable` fields will be ignored. You can also use `UserOut(...).copyWith.fieldName(...)` to override fields one at a time with nullification support.
|
||||
///
|
||||
/// Usage
|
||||
/// ```dart
|
||||
/// UserOut(...).copyWith(id: 12, name: "My name")
|
||||
/// ````
|
||||
UserOut call({
|
||||
Object? email = const $CopyWithPlaceholder(),
|
||||
Object? id = const $CopyWithPlaceholder(),
|
||||
}) {
|
||||
return UserOut(
|
||||
email: email == const $CopyWithPlaceholder()
|
||||
? _value.email
|
||||
// ignore: cast_nullable_to_non_nullable
|
||||
: email as String,
|
||||
id: id == const $CopyWithPlaceholder()
|
||||
? _value.id
|
||||
// ignore: cast_nullable_to_non_nullable
|
||||
: id as int,
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
extension $UserOutCopyWith on UserOut {
|
||||
/// Returns a callable class that can be used as follows: `instanceOfUserOut.copyWith(...)` or like so:`instanceOfUserOut.copyWith.fieldName(...)`.
|
||||
// ignore: library_private_types_in_public_api
|
||||
_$UserOutCWProxy get copyWith => _$UserOutCWProxyImpl(this);
|
||||
}
|
||||
|
||||
// **************************************************************************
|
||||
// JsonSerializableGenerator
|
||||
// **************************************************************************
|
||||
|
||||
UserOut _$UserOutFromJson(Map<String, dynamic> json) =>
|
||||
$checkedCreate('UserOut', json, ($checkedConvert) {
|
||||
$checkKeys(json, requiredKeys: const ['email', 'id']);
|
||||
final val = UserOut(
|
||||
email: $checkedConvert('email', (v) => v as String),
|
||||
id: $checkedConvert('id', (v) => (v as num).toInt()),
|
||||
);
|
||||
return val;
|
||||
});
|
||||
|
||||
Map<String, dynamic> _$UserOutToJson(UserOut instance) => <String, dynamic>{
|
||||
'email': instance.email,
|
||||
'id': instance.id,
|
||||
};
|
||||
Reference in New Issue
Block a user