chore(app): сгенерированный Dart-клиент
just gen-client — покрывает links, cashflow-broker, ручные цены, imports/pending, goals/income/rebalance/tax/benchmarks.
This commit is contained in:
@@ -10,15 +10,22 @@ import 'package:fintracker_api/src/auth/oauth.dart';
|
||||
import 'package:fintracker_api/src/api/accounts_api.dart';
|
||||
import 'package:fintracker_api/src/api/analytics_api.dart';
|
||||
import 'package:fintracker_api/src/api/auth_api.dart';
|
||||
import 'package:fintracker_api/src/api/benchmarks_api.dart';
|
||||
import 'package:fintracker_api/src/api/cashflow_api.dart';
|
||||
import 'package:fintracker_api/src/api/categories_api.dart';
|
||||
import 'package:fintracker_api/src/api/events_api.dart';
|
||||
import 'package:fintracker_api/src/api/goals_api.dart';
|
||||
import 'package:fintracker_api/src/api/health_api.dart';
|
||||
import 'package:fintracker_api/src/api/imports_api.dart';
|
||||
import 'package:fintracker_api/src/api/income_api.dart';
|
||||
import 'package:fintracker_api/src/api/instruments_api.dart';
|
||||
import 'package:fintracker_api/src/api/links_api.dart';
|
||||
import 'package:fintracker_api/src/api/metrics_api.dart';
|
||||
import 'package:fintracker_api/src/api/networth_api.dart';
|
||||
import 'package:fintracker_api/src/api/rebalance_api.dart';
|
||||
import 'package:fintracker_api/src/api/rules_api.dart';
|
||||
import 'package:fintracker_api/src/api/sync_api.dart';
|
||||
import 'package:fintracker_api/src/api/tax_api.dart';
|
||||
import 'package:fintracker_api/src/api/transactions_api.dart';
|
||||
|
||||
class FintrackerApi {
|
||||
@@ -130,6 +137,12 @@ class FintrackerApi {
|
||||
return AuthApi(dio);
|
||||
}
|
||||
|
||||
/// Get BenchmarksApi instance, base route and serializer can be overridden by a given but be careful,
|
||||
/// by doing that all interceptors will not be executed
|
||||
BenchmarksApi getBenchmarksApi() {
|
||||
return BenchmarksApi(dio);
|
||||
}
|
||||
|
||||
/// Get CashflowApi instance, base route and serializer can be overridden by a given but be careful,
|
||||
/// by doing that all interceptors will not be executed
|
||||
CashflowApi getCashflowApi() {
|
||||
@@ -148,18 +161,42 @@ class FintrackerApi {
|
||||
return EventsApi(dio);
|
||||
}
|
||||
|
||||
/// Get GoalsApi instance, base route and serializer can be overridden by a given but be careful,
|
||||
/// by doing that all interceptors will not be executed
|
||||
GoalsApi getGoalsApi() {
|
||||
return GoalsApi(dio);
|
||||
}
|
||||
|
||||
/// Get HealthApi instance, base route and serializer can be overridden by a given but be careful,
|
||||
/// by doing that all interceptors will not be executed
|
||||
HealthApi getHealthApi() {
|
||||
return HealthApi(dio);
|
||||
}
|
||||
|
||||
/// Get ImportsApi instance, base route and serializer can be overridden by a given but be careful,
|
||||
/// by doing that all interceptors will not be executed
|
||||
ImportsApi getImportsApi() {
|
||||
return ImportsApi(dio);
|
||||
}
|
||||
|
||||
/// Get IncomeApi instance, base route and serializer can be overridden by a given but be careful,
|
||||
/// by doing that all interceptors will not be executed
|
||||
IncomeApi getIncomeApi() {
|
||||
return IncomeApi(dio);
|
||||
}
|
||||
|
||||
/// Get InstrumentsApi instance, base route and serializer can be overridden by a given but be careful,
|
||||
/// by doing that all interceptors will not be executed
|
||||
InstrumentsApi getInstrumentsApi() {
|
||||
return InstrumentsApi(dio);
|
||||
}
|
||||
|
||||
/// Get LinksApi instance, base route and serializer can be overridden by a given but be careful,
|
||||
/// by doing that all interceptors will not be executed
|
||||
LinksApi getLinksApi() {
|
||||
return LinksApi(dio);
|
||||
}
|
||||
|
||||
/// Get MetricsApi instance, base route and serializer can be overridden by a given but be careful,
|
||||
/// by doing that all interceptors will not be executed
|
||||
MetricsApi getMetricsApi() {
|
||||
@@ -172,6 +209,12 @@ class FintrackerApi {
|
||||
return NetworthApi(dio);
|
||||
}
|
||||
|
||||
/// Get RebalanceApi instance, base route and serializer can be overridden by a given but be careful,
|
||||
/// by doing that all interceptors will not be executed
|
||||
RebalanceApi getRebalanceApi() {
|
||||
return RebalanceApi(dio);
|
||||
}
|
||||
|
||||
/// Get RulesApi instance, base route and serializer can be overridden by a given but be careful,
|
||||
/// by doing that all interceptors will not be executed
|
||||
RulesApi getRulesApi() {
|
||||
@@ -184,6 +227,12 @@ class FintrackerApi {
|
||||
return SyncApi(dio);
|
||||
}
|
||||
|
||||
/// Get TaxApi instance, base route and serializer can be overridden by a given but be careful,
|
||||
/// by doing that all interceptors will not be executed
|
||||
TaxApi getTaxApi() {
|
||||
return TaxApi(dio);
|
||||
}
|
||||
|
||||
/// Get TransactionsApi instance, base route and serializer can be overridden by a given but be careful,
|
||||
/// by doing that all interceptors will not be executed
|
||||
TransactionsApi getTransactionsApi() {
|
||||
|
||||
@@ -11,6 +11,7 @@ import 'package:dio/dio.dart';
|
||||
|
||||
import 'package:fintracker_api/src/model/allocation_bucket.dart';
|
||||
import 'package:fintracker_api/src/model/allocation_dimension.dart';
|
||||
import 'package:fintracker_api/src/model/cash_flow_broker_month.dart';
|
||||
import 'package:fintracker_api/src/model/holding_out.dart';
|
||||
import 'package:fintracker_api/src/model/problem.dart';
|
||||
import 'package:fintracker_api/src/model/returns_out.dart';
|
||||
@@ -110,6 +111,89 @@ _responseData = rawData == null ? null : deserialize<List<AllocationBucket>, All
|
||||
);
|
||||
}
|
||||
|
||||
/// Cashflow Broker
|
||||
/// Money moved across the brokerage boundary, by month: the other half of cash flow that `metric_cash_flow_monthly` (ZenMoney spending) does not cover.
|
||||
///
|
||||
/// Parameters:
|
||||
/// * [scope] - all | account:<id> | portfolio:<id>
|
||||
/// * [cancelToken] - A [CancelToken] that can be used to cancel the operation
|
||||
/// * [headers] - Can be used to add additional headers to the request
|
||||
/// * [extras] - Can be used to add flags to the request
|
||||
/// * [validateStatus] - A [ValidateStatus] callback that can be used to determine request success based on the HTTP status of the response
|
||||
/// * [onSendProgress] - A [ProgressCallback] that can be used to get the send progress
|
||||
/// * [onReceiveProgress] - A [ProgressCallback] that can be used to get the receive progress
|
||||
///
|
||||
/// Returns a [Future] containing a [Response] with a [List<CashFlowBrokerMonth>] as data
|
||||
/// Throws [DioException] if API call or serialization fails
|
||||
Future<Response<List<CashFlowBrokerMonth>>> analyticsCashflowBroker({
|
||||
String? scope = 'all',
|
||||
CancelToken? cancelToken,
|
||||
Map<String, dynamic>? headers,
|
||||
Map<String, dynamic>? extra,
|
||||
ValidateStatus? validateStatus,
|
||||
ProgressCallback? onSendProgress,
|
||||
ProgressCallback? onReceiveProgress,
|
||||
}) async {
|
||||
final _path = r'/api/v1/analytics/cashflow-broker';
|
||||
final _options = Options(
|
||||
method: r'GET',
|
||||
headers: <String, dynamic>{
|
||||
...?headers,
|
||||
},
|
||||
extra: <String, dynamic>{
|
||||
'secure': <Map<String, String>>[
|
||||
{
|
||||
'type': 'http',
|
||||
'scheme': 'bearer',
|
||||
'name': 'HTTPBearer',
|
||||
},
|
||||
],
|
||||
...?extra,
|
||||
},
|
||||
validateStatus: validateStatus,
|
||||
);
|
||||
|
||||
final _queryParameters = <String, dynamic>{
|
||||
if (scope != null) r'scope': scope,
|
||||
};
|
||||
|
||||
final _response = await _dio.request<Object>(
|
||||
_path,
|
||||
options: _options,
|
||||
queryParameters: _queryParameters,
|
||||
cancelToken: cancelToken,
|
||||
onSendProgress: onSendProgress,
|
||||
onReceiveProgress: onReceiveProgress,
|
||||
);
|
||||
|
||||
List<CashFlowBrokerMonth>? _responseData;
|
||||
|
||||
try {
|
||||
final rawData = _response.data;
|
||||
_responseData = rawData == null ? null : deserialize<List<CashFlowBrokerMonth>, CashFlowBrokerMonth>(rawData, 'List<CashFlowBrokerMonth>', growable: true);
|
||||
|
||||
} catch (error, stackTrace) {
|
||||
throw DioException(
|
||||
requestOptions: _response.requestOptions,
|
||||
response: _response,
|
||||
type: DioExceptionType.unknown,
|
||||
error: error,
|
||||
stackTrace: stackTrace,
|
||||
);
|
||||
}
|
||||
|
||||
return Response<List<CashFlowBrokerMonth>>(
|
||||
data: _responseData,
|
||||
headers: _response.headers,
|
||||
isRedirect: _response.isRedirect,
|
||||
requestOptions: _response.requestOptions,
|
||||
redirects: _response.redirects,
|
||||
statusCode: _response.statusCode,
|
||||
statusMessage: _response.statusMessage,
|
||||
extra: _response.extra,
|
||||
);
|
||||
}
|
||||
|
||||
/// Holdings
|
||||
/// Open positions, most valuable first; unpriced ones last with null values.
|
||||
///
|
||||
|
||||
@@ -0,0 +1,435 @@
|
||||
//
|
||||
// AUTO-GENERATED FILE, DO NOT MODIFY!
|
||||
//
|
||||
|
||||
import 'dart:async';
|
||||
|
||||
// ignore: unused_import
|
||||
import 'dart:convert';
|
||||
import 'package:fintracker_api/src/deserialize.dart';
|
||||
import 'package:dio/dio.dart';
|
||||
|
||||
import 'package:fintracker_api/src/model/benchmark_comparison.dart';
|
||||
import 'package:fintracker_api/src/model/benchmark_create.dart';
|
||||
import 'package:fintracker_api/src/model/benchmark_out.dart';
|
||||
import 'package:fintracker_api/src/model/benchmark_patch.dart';
|
||||
import 'package:fintracker_api/src/model/problem.dart';
|
||||
|
||||
class BenchmarksApi {
|
||||
|
||||
final Dio _dio;
|
||||
|
||||
const BenchmarksApi(this._dio);
|
||||
|
||||
/// Benchmarks
|
||||
/// The portfolio's TWR beside each benchmark's, on the same grid of days. `days_skipped` is returned on both sides and is not cosmetic: a non-zero value on either means the two chains did not cover the same days, and the difference is then an approximation of an excess return rather than one.
|
||||
///
|
||||
/// Parameters:
|
||||
/// * [scope] - all | account:<id> | portfolio:<id>
|
||||
/// * [period] - repeatable: 1m 3m 6m ytd 1y 3y all
|
||||
/// * [cancelToken] - A [CancelToken] that can be used to cancel the operation
|
||||
/// * [headers] - Can be used to add additional headers to the request
|
||||
/// * [extras] - Can be used to add flags to the request
|
||||
/// * [validateStatus] - A [ValidateStatus] callback that can be used to determine request success based on the HTTP status of the response
|
||||
/// * [onSendProgress] - A [ProgressCallback] that can be used to get the send progress
|
||||
/// * [onReceiveProgress] - A [ProgressCallback] that can be used to get the receive progress
|
||||
///
|
||||
/// Returns a [Future] containing a [Response] with a [BenchmarkComparison] as data
|
||||
/// Throws [DioException] if API call or serialization fails
|
||||
Future<Response<BenchmarkComparison>> benchmarksBenchmarks({
|
||||
String? scope = 'all',
|
||||
List<String?>? period,
|
||||
CancelToken? cancelToken,
|
||||
Map<String, dynamic>? headers,
|
||||
Map<String, dynamic>? extra,
|
||||
ValidateStatus? validateStatus,
|
||||
ProgressCallback? onSendProgress,
|
||||
ProgressCallback? onReceiveProgress,
|
||||
}) async {
|
||||
final _path = r'/api/v1/analytics/benchmarks';
|
||||
final _options = Options(
|
||||
method: r'GET',
|
||||
headers: <String, dynamic>{
|
||||
...?headers,
|
||||
},
|
||||
extra: <String, dynamic>{
|
||||
'secure': <Map<String, String>>[
|
||||
{
|
||||
'type': 'http',
|
||||
'scheme': 'bearer',
|
||||
'name': 'HTTPBearer',
|
||||
},
|
||||
],
|
||||
...?extra,
|
||||
},
|
||||
validateStatus: validateStatus,
|
||||
);
|
||||
|
||||
final _queryParameters = <String, dynamic>{
|
||||
if (scope != null) r'scope': scope,
|
||||
if (period != null) r'period': period,
|
||||
};
|
||||
|
||||
final _response = await _dio.request<Object>(
|
||||
_path,
|
||||
options: _options,
|
||||
queryParameters: _queryParameters,
|
||||
cancelToken: cancelToken,
|
||||
onSendProgress: onSendProgress,
|
||||
onReceiveProgress: onReceiveProgress,
|
||||
);
|
||||
|
||||
BenchmarkComparison? _responseData;
|
||||
|
||||
try {
|
||||
final rawData = _response.data;
|
||||
_responseData = rawData == null ? null : deserialize<BenchmarkComparison, BenchmarkComparison>(rawData, 'BenchmarkComparison', growable: true);
|
||||
|
||||
} catch (error, stackTrace) {
|
||||
throw DioException(
|
||||
requestOptions: _response.requestOptions,
|
||||
response: _response,
|
||||
type: DioExceptionType.unknown,
|
||||
error: error,
|
||||
stackTrace: stackTrace,
|
||||
);
|
||||
}
|
||||
|
||||
return Response<BenchmarkComparison>(
|
||||
data: _responseData,
|
||||
headers: _response.headers,
|
||||
isRedirect: _response.isRedirect,
|
||||
requestOptions: _response.requestOptions,
|
||||
redirects: _response.redirects,
|
||||
statusCode: _response.statusCode,
|
||||
statusMessage: _response.statusMessage,
|
||||
extra: _response.extra,
|
||||
);
|
||||
}
|
||||
|
||||
/// Create
|
||||
///
|
||||
///
|
||||
/// Parameters:
|
||||
/// * [benchmarkCreate]
|
||||
/// * [cancelToken] - A [CancelToken] that can be used to cancel the operation
|
||||
/// * [headers] - Can be used to add additional headers to the request
|
||||
/// * [extras] - Can be used to add flags to the request
|
||||
/// * [validateStatus] - A [ValidateStatus] callback that can be used to determine request success based on the HTTP status of the response
|
||||
/// * [onSendProgress] - A [ProgressCallback] that can be used to get the send progress
|
||||
/// * [onReceiveProgress] - A [ProgressCallback] that can be used to get the receive progress
|
||||
///
|
||||
/// Returns a [Future] containing a [Response] with a [BenchmarkOut] as data
|
||||
/// Throws [DioException] if API call or serialization fails
|
||||
Future<Response<BenchmarkOut>> benchmarksCreate({
|
||||
required BenchmarkCreate benchmarkCreate,
|
||||
CancelToken? cancelToken,
|
||||
Map<String, dynamic>? headers,
|
||||
Map<String, dynamic>? extra,
|
||||
ValidateStatus? validateStatus,
|
||||
ProgressCallback? onSendProgress,
|
||||
ProgressCallback? onReceiveProgress,
|
||||
}) async {
|
||||
final _path = r'/api/v1/benchmarks';
|
||||
final _options = Options(
|
||||
method: r'POST',
|
||||
headers: <String, dynamic>{
|
||||
...?headers,
|
||||
},
|
||||
extra: <String, dynamic>{
|
||||
'secure': <Map<String, String>>[
|
||||
{
|
||||
'type': 'http',
|
||||
'scheme': 'bearer',
|
||||
'name': 'HTTPBearer',
|
||||
},
|
||||
],
|
||||
...?extra,
|
||||
},
|
||||
contentType: 'application/json',
|
||||
validateStatus: validateStatus,
|
||||
);
|
||||
|
||||
dynamic _bodyData;
|
||||
|
||||
try {
|
||||
_bodyData = jsonEncode(benchmarkCreate);
|
||||
|
||||
} catch(error, stackTrace) {
|
||||
throw DioException(
|
||||
requestOptions: _options.compose(
|
||||
_dio.options,
|
||||
_path,
|
||||
),
|
||||
type: DioExceptionType.unknown,
|
||||
error: error,
|
||||
stackTrace: stackTrace,
|
||||
);
|
||||
}
|
||||
|
||||
final _response = await _dio.request<Object>(
|
||||
_path,
|
||||
data: _bodyData,
|
||||
options: _options,
|
||||
cancelToken: cancelToken,
|
||||
onSendProgress: onSendProgress,
|
||||
onReceiveProgress: onReceiveProgress,
|
||||
);
|
||||
|
||||
BenchmarkOut? _responseData;
|
||||
|
||||
try {
|
||||
final rawData = _response.data;
|
||||
_responseData = rawData == null ? null : deserialize<BenchmarkOut, BenchmarkOut>(rawData, 'BenchmarkOut', growable: true);
|
||||
|
||||
} catch (error, stackTrace) {
|
||||
throw DioException(
|
||||
requestOptions: _response.requestOptions,
|
||||
response: _response,
|
||||
type: DioExceptionType.unknown,
|
||||
error: error,
|
||||
stackTrace: stackTrace,
|
||||
);
|
||||
}
|
||||
|
||||
return Response<BenchmarkOut>(
|
||||
data: _responseData,
|
||||
headers: _response.headers,
|
||||
isRedirect: _response.isRedirect,
|
||||
requestOptions: _response.requestOptions,
|
||||
redirects: _response.redirects,
|
||||
statusCode: _response.statusCode,
|
||||
statusMessage: _response.statusMessage,
|
||||
extra: _response.extra,
|
||||
);
|
||||
}
|
||||
|
||||
/// Delete
|
||||
///
|
||||
///
|
||||
/// Parameters:
|
||||
/// * [benchmarkId]
|
||||
/// * [cancelToken] - A [CancelToken] that can be used to cancel the operation
|
||||
/// * [headers] - Can be used to add additional headers to the request
|
||||
/// * [extras] - Can be used to add flags to the request
|
||||
/// * [validateStatus] - A [ValidateStatus] callback that can be used to determine request success based on the HTTP status of the response
|
||||
/// * [onSendProgress] - A [ProgressCallback] that can be used to get the send progress
|
||||
/// * [onReceiveProgress] - A [ProgressCallback] that can be used to get the receive progress
|
||||
///
|
||||
/// Returns a [Future]
|
||||
/// Throws [DioException] if API call or serialization fails
|
||||
Future<Response<void>> benchmarksDelete({
|
||||
required int benchmarkId,
|
||||
CancelToken? cancelToken,
|
||||
Map<String, dynamic>? headers,
|
||||
Map<String, dynamic>? extra,
|
||||
ValidateStatus? validateStatus,
|
||||
ProgressCallback? onSendProgress,
|
||||
ProgressCallback? onReceiveProgress,
|
||||
}) async {
|
||||
final _path = r'/api/v1/benchmarks/{benchmark_id}'.replaceAll('{' r'benchmark_id' '}', benchmarkId.toString());
|
||||
final _options = Options(
|
||||
method: r'DELETE',
|
||||
headers: <String, dynamic>{
|
||||
...?headers,
|
||||
},
|
||||
extra: <String, dynamic>{
|
||||
'secure': <Map<String, String>>[
|
||||
{
|
||||
'type': 'http',
|
||||
'scheme': 'bearer',
|
||||
'name': 'HTTPBearer',
|
||||
},
|
||||
],
|
||||
...?extra,
|
||||
},
|
||||
validateStatus: validateStatus,
|
||||
);
|
||||
|
||||
final _response = await _dio.request<Object>(
|
||||
_path,
|
||||
options: _options,
|
||||
cancelToken: cancelToken,
|
||||
onSendProgress: onSendProgress,
|
||||
onReceiveProgress: onReceiveProgress,
|
||||
);
|
||||
|
||||
return _response;
|
||||
}
|
||||
|
||||
/// List
|
||||
/// Every benchmark, defaults first — the order the comparison block shows them in.
|
||||
///
|
||||
/// Parameters:
|
||||
/// * [cancelToken] - A [CancelToken] that can be used to cancel the operation
|
||||
/// * [headers] - Can be used to add additional headers to the request
|
||||
/// * [extras] - Can be used to add flags to the request
|
||||
/// * [validateStatus] - A [ValidateStatus] callback that can be used to determine request success based on the HTTP status of the response
|
||||
/// * [onSendProgress] - A [ProgressCallback] that can be used to get the send progress
|
||||
/// * [onReceiveProgress] - A [ProgressCallback] that can be used to get the receive progress
|
||||
///
|
||||
/// Returns a [Future] containing a [Response] with a [List<BenchmarkOut>] as data
|
||||
/// Throws [DioException] if API call or serialization fails
|
||||
Future<Response<List<BenchmarkOut>>> benchmarksList({
|
||||
CancelToken? cancelToken,
|
||||
Map<String, dynamic>? headers,
|
||||
Map<String, dynamic>? extra,
|
||||
ValidateStatus? validateStatus,
|
||||
ProgressCallback? onSendProgress,
|
||||
ProgressCallback? onReceiveProgress,
|
||||
}) async {
|
||||
final _path = r'/api/v1/benchmarks';
|
||||
final _options = Options(
|
||||
method: r'GET',
|
||||
headers: <String, dynamic>{
|
||||
...?headers,
|
||||
},
|
||||
extra: <String, dynamic>{
|
||||
'secure': <Map<String, String>>[
|
||||
{
|
||||
'type': 'http',
|
||||
'scheme': 'bearer',
|
||||
'name': 'HTTPBearer',
|
||||
},
|
||||
],
|
||||
...?extra,
|
||||
},
|
||||
validateStatus: validateStatus,
|
||||
);
|
||||
|
||||
final _response = await _dio.request<Object>(
|
||||
_path,
|
||||
options: _options,
|
||||
cancelToken: cancelToken,
|
||||
onSendProgress: onSendProgress,
|
||||
onReceiveProgress: onReceiveProgress,
|
||||
);
|
||||
|
||||
List<BenchmarkOut>? _responseData;
|
||||
|
||||
try {
|
||||
final rawData = _response.data;
|
||||
_responseData = rawData == null ? null : deserialize<List<BenchmarkOut>, BenchmarkOut>(rawData, 'List<BenchmarkOut>', growable: true);
|
||||
|
||||
} catch (error, stackTrace) {
|
||||
throw DioException(
|
||||
requestOptions: _response.requestOptions,
|
||||
response: _response,
|
||||
type: DioExceptionType.unknown,
|
||||
error: error,
|
||||
stackTrace: stackTrace,
|
||||
);
|
||||
}
|
||||
|
||||
return Response<List<BenchmarkOut>>(
|
||||
data: _responseData,
|
||||
headers: _response.headers,
|
||||
isRedirect: _response.isRedirect,
|
||||
requestOptions: _response.requestOptions,
|
||||
redirects: _response.redirects,
|
||||
statusCode: _response.statusCode,
|
||||
statusMessage: _response.statusMessage,
|
||||
extra: _response.extra,
|
||||
);
|
||||
}
|
||||
|
||||
/// Patch
|
||||
///
|
||||
///
|
||||
/// Parameters:
|
||||
/// * [benchmarkId]
|
||||
/// * [benchmarkPatch]
|
||||
/// * [cancelToken] - A [CancelToken] that can be used to cancel the operation
|
||||
/// * [headers] - Can be used to add additional headers to the request
|
||||
/// * [extras] - Can be used to add flags to the request
|
||||
/// * [validateStatus] - A [ValidateStatus] callback that can be used to determine request success based on the HTTP status of the response
|
||||
/// * [onSendProgress] - A [ProgressCallback] that can be used to get the send progress
|
||||
/// * [onReceiveProgress] - A [ProgressCallback] that can be used to get the receive progress
|
||||
///
|
||||
/// Returns a [Future] containing a [Response] with a [BenchmarkOut] as data
|
||||
/// Throws [DioException] if API call or serialization fails
|
||||
Future<Response<BenchmarkOut>> benchmarksPatch({
|
||||
required int benchmarkId,
|
||||
required BenchmarkPatch benchmarkPatch,
|
||||
CancelToken? cancelToken,
|
||||
Map<String, dynamic>? headers,
|
||||
Map<String, dynamic>? extra,
|
||||
ValidateStatus? validateStatus,
|
||||
ProgressCallback? onSendProgress,
|
||||
ProgressCallback? onReceiveProgress,
|
||||
}) async {
|
||||
final _path = r'/api/v1/benchmarks/{benchmark_id}'.replaceAll('{' r'benchmark_id' '}', benchmarkId.toString());
|
||||
final _options = Options(
|
||||
method: r'PATCH',
|
||||
headers: <String, dynamic>{
|
||||
...?headers,
|
||||
},
|
||||
extra: <String, dynamic>{
|
||||
'secure': <Map<String, String>>[
|
||||
{
|
||||
'type': 'http',
|
||||
'scheme': 'bearer',
|
||||
'name': 'HTTPBearer',
|
||||
},
|
||||
],
|
||||
...?extra,
|
||||
},
|
||||
contentType: 'application/json',
|
||||
validateStatus: validateStatus,
|
||||
);
|
||||
|
||||
dynamic _bodyData;
|
||||
|
||||
try {
|
||||
_bodyData = jsonEncode(benchmarkPatch);
|
||||
|
||||
} catch(error, stackTrace) {
|
||||
throw DioException(
|
||||
requestOptions: _options.compose(
|
||||
_dio.options,
|
||||
_path,
|
||||
),
|
||||
type: DioExceptionType.unknown,
|
||||
error: error,
|
||||
stackTrace: stackTrace,
|
||||
);
|
||||
}
|
||||
|
||||
final _response = await _dio.request<Object>(
|
||||
_path,
|
||||
data: _bodyData,
|
||||
options: _options,
|
||||
cancelToken: cancelToken,
|
||||
onSendProgress: onSendProgress,
|
||||
onReceiveProgress: onReceiveProgress,
|
||||
);
|
||||
|
||||
BenchmarkOut? _responseData;
|
||||
|
||||
try {
|
||||
final rawData = _response.data;
|
||||
_responseData = rawData == null ? null : deserialize<BenchmarkOut, BenchmarkOut>(rawData, 'BenchmarkOut', growable: true);
|
||||
|
||||
} catch (error, stackTrace) {
|
||||
throw DioException(
|
||||
requestOptions: _response.requestOptions,
|
||||
response: _response,
|
||||
type: DioExceptionType.unknown,
|
||||
error: error,
|
||||
stackTrace: stackTrace,
|
||||
);
|
||||
}
|
||||
|
||||
return Response<BenchmarkOut>(
|
||||
data: _responseData,
|
||||
headers: _response.headers,
|
||||
isRedirect: _response.isRedirect,
|
||||
requestOptions: _response.requestOptions,
|
||||
redirects: _response.redirects,
|
||||
statusCode: _response.statusCode,
|
||||
statusMessage: _response.statusMessage,
|
||||
extra: _response.extra,
|
||||
);
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,434 @@
|
||||
//
|
||||
// AUTO-GENERATED FILE, DO NOT MODIFY!
|
||||
//
|
||||
|
||||
import 'dart:async';
|
||||
|
||||
// ignore: unused_import
|
||||
import 'dart:convert';
|
||||
import 'package:fintracker_api/src/deserialize.dart';
|
||||
import 'package:dio/dio.dart';
|
||||
|
||||
import 'package:fintracker_api/src/model/goal_create.dart';
|
||||
import 'package:fintracker_api/src/model/goal_out.dart';
|
||||
import 'package:fintracker_api/src/model/goal_patch.dart';
|
||||
import 'package:fintracker_api/src/model/goal_progress_out.dart';
|
||||
import 'package:fintracker_api/src/model/problem.dart';
|
||||
|
||||
class GoalsApi {
|
||||
|
||||
final Dio _dio;
|
||||
|
||||
const GoalsApi(this._dio);
|
||||
|
||||
/// Create
|
||||
///
|
||||
///
|
||||
/// Parameters:
|
||||
/// * [goalCreate]
|
||||
/// * [cancelToken] - A [CancelToken] that can be used to cancel the operation
|
||||
/// * [headers] - Can be used to add additional headers to the request
|
||||
/// * [extras] - Can be used to add flags to the request
|
||||
/// * [validateStatus] - A [ValidateStatus] callback that can be used to determine request success based on the HTTP status of the response
|
||||
/// * [onSendProgress] - A [ProgressCallback] that can be used to get the send progress
|
||||
/// * [onReceiveProgress] - A [ProgressCallback] that can be used to get the receive progress
|
||||
///
|
||||
/// Returns a [Future] containing a [Response] with a [GoalOut] as data
|
||||
/// Throws [DioException] if API call or serialization fails
|
||||
Future<Response<GoalOut>> goalsCreate({
|
||||
required GoalCreate goalCreate,
|
||||
CancelToken? cancelToken,
|
||||
Map<String, dynamic>? headers,
|
||||
Map<String, dynamic>? extra,
|
||||
ValidateStatus? validateStatus,
|
||||
ProgressCallback? onSendProgress,
|
||||
ProgressCallback? onReceiveProgress,
|
||||
}) async {
|
||||
final _path = r'/api/v1/goals';
|
||||
final _options = Options(
|
||||
method: r'POST',
|
||||
headers: <String, dynamic>{
|
||||
...?headers,
|
||||
},
|
||||
extra: <String, dynamic>{
|
||||
'secure': <Map<String, String>>[
|
||||
{
|
||||
'type': 'http',
|
||||
'scheme': 'bearer',
|
||||
'name': 'HTTPBearer',
|
||||
},
|
||||
],
|
||||
...?extra,
|
||||
},
|
||||
contentType: 'application/json',
|
||||
validateStatus: validateStatus,
|
||||
);
|
||||
|
||||
dynamic _bodyData;
|
||||
|
||||
try {
|
||||
_bodyData = jsonEncode(goalCreate);
|
||||
|
||||
} catch(error, stackTrace) {
|
||||
throw DioException(
|
||||
requestOptions: _options.compose(
|
||||
_dio.options,
|
||||
_path,
|
||||
),
|
||||
type: DioExceptionType.unknown,
|
||||
error: error,
|
||||
stackTrace: stackTrace,
|
||||
);
|
||||
}
|
||||
|
||||
final _response = await _dio.request<Object>(
|
||||
_path,
|
||||
data: _bodyData,
|
||||
options: _options,
|
||||
cancelToken: cancelToken,
|
||||
onSendProgress: onSendProgress,
|
||||
onReceiveProgress: onReceiveProgress,
|
||||
);
|
||||
|
||||
GoalOut? _responseData;
|
||||
|
||||
try {
|
||||
final rawData = _response.data;
|
||||
_responseData = rawData == null ? null : deserialize<GoalOut, GoalOut>(rawData, 'GoalOut', growable: true);
|
||||
|
||||
} catch (error, stackTrace) {
|
||||
throw DioException(
|
||||
requestOptions: _response.requestOptions,
|
||||
response: _response,
|
||||
type: DioExceptionType.unknown,
|
||||
error: error,
|
||||
stackTrace: stackTrace,
|
||||
);
|
||||
}
|
||||
|
||||
return Response<GoalOut>(
|
||||
data: _responseData,
|
||||
headers: _response.headers,
|
||||
isRedirect: _response.isRedirect,
|
||||
requestOptions: _response.requestOptions,
|
||||
redirects: _response.redirects,
|
||||
statusCode: _response.statusCode,
|
||||
statusMessage: _response.statusMessage,
|
||||
extra: _response.extra,
|
||||
);
|
||||
}
|
||||
|
||||
/// Delete
|
||||
///
|
||||
///
|
||||
/// Parameters:
|
||||
/// * [goalId]
|
||||
/// * [cancelToken] - A [CancelToken] that can be used to cancel the operation
|
||||
/// * [headers] - Can be used to add additional headers to the request
|
||||
/// * [extras] - Can be used to add flags to the request
|
||||
/// * [validateStatus] - A [ValidateStatus] callback that can be used to determine request success based on the HTTP status of the response
|
||||
/// * [onSendProgress] - A [ProgressCallback] that can be used to get the send progress
|
||||
/// * [onReceiveProgress] - A [ProgressCallback] that can be used to get the receive progress
|
||||
///
|
||||
/// Returns a [Future]
|
||||
/// Throws [DioException] if API call or serialization fails
|
||||
Future<Response<void>> goalsDelete({
|
||||
required int goalId,
|
||||
CancelToken? cancelToken,
|
||||
Map<String, dynamic>? headers,
|
||||
Map<String, dynamic>? extra,
|
||||
ValidateStatus? validateStatus,
|
||||
ProgressCallback? onSendProgress,
|
||||
ProgressCallback? onReceiveProgress,
|
||||
}) async {
|
||||
final _path = r'/api/v1/goals/{goal_id}'.replaceAll('{' r'goal_id' '}', goalId.toString());
|
||||
final _options = Options(
|
||||
method: r'DELETE',
|
||||
headers: <String, dynamic>{
|
||||
...?headers,
|
||||
},
|
||||
extra: <String, dynamic>{
|
||||
'secure': <Map<String, String>>[
|
||||
{
|
||||
'type': 'http',
|
||||
'scheme': 'bearer',
|
||||
'name': 'HTTPBearer',
|
||||
},
|
||||
],
|
||||
...?extra,
|
||||
},
|
||||
validateStatus: validateStatus,
|
||||
);
|
||||
|
||||
final _response = await _dio.request<Object>(
|
||||
_path,
|
||||
options: _options,
|
||||
cancelToken: cancelToken,
|
||||
onSendProgress: onSendProgress,
|
||||
onReceiveProgress: onReceiveProgress,
|
||||
);
|
||||
|
||||
return _response;
|
||||
}
|
||||
|
||||
/// List
|
||||
///
|
||||
///
|
||||
/// Parameters:
|
||||
/// * [includeArchived]
|
||||
/// * [cancelToken] - A [CancelToken] that can be used to cancel the operation
|
||||
/// * [headers] - Can be used to add additional headers to the request
|
||||
/// * [extras] - Can be used to add flags to the request
|
||||
/// * [validateStatus] - A [ValidateStatus] callback that can be used to determine request success based on the HTTP status of the response
|
||||
/// * [onSendProgress] - A [ProgressCallback] that can be used to get the send progress
|
||||
/// * [onReceiveProgress] - A [ProgressCallback] that can be used to get the receive progress
|
||||
///
|
||||
/// Returns a [Future] containing a [Response] with a [List<GoalOut>] as data
|
||||
/// Throws [DioException] if API call or serialization fails
|
||||
Future<Response<List<GoalOut>>> goalsList({
|
||||
bool? includeArchived = false,
|
||||
CancelToken? cancelToken,
|
||||
Map<String, dynamic>? headers,
|
||||
Map<String, dynamic>? extra,
|
||||
ValidateStatus? validateStatus,
|
||||
ProgressCallback? onSendProgress,
|
||||
ProgressCallback? onReceiveProgress,
|
||||
}) async {
|
||||
final _path = r'/api/v1/goals';
|
||||
final _options = Options(
|
||||
method: r'GET',
|
||||
headers: <String, dynamic>{
|
||||
...?headers,
|
||||
},
|
||||
extra: <String, dynamic>{
|
||||
'secure': <Map<String, String>>[
|
||||
{
|
||||
'type': 'http',
|
||||
'scheme': 'bearer',
|
||||
'name': 'HTTPBearer',
|
||||
},
|
||||
],
|
||||
...?extra,
|
||||
},
|
||||
validateStatus: validateStatus,
|
||||
);
|
||||
|
||||
final _queryParameters = <String, dynamic>{
|
||||
if (includeArchived != null) r'include_archived': includeArchived,
|
||||
};
|
||||
|
||||
final _response = await _dio.request<Object>(
|
||||
_path,
|
||||
options: _options,
|
||||
queryParameters: _queryParameters,
|
||||
cancelToken: cancelToken,
|
||||
onSendProgress: onSendProgress,
|
||||
onReceiveProgress: onReceiveProgress,
|
||||
);
|
||||
|
||||
List<GoalOut>? _responseData;
|
||||
|
||||
try {
|
||||
final rawData = _response.data;
|
||||
_responseData = rawData == null ? null : deserialize<List<GoalOut>, GoalOut>(rawData, 'List<GoalOut>', growable: true);
|
||||
|
||||
} catch (error, stackTrace) {
|
||||
throw DioException(
|
||||
requestOptions: _response.requestOptions,
|
||||
response: _response,
|
||||
type: DioExceptionType.unknown,
|
||||
error: error,
|
||||
stackTrace: stackTrace,
|
||||
);
|
||||
}
|
||||
|
||||
return Response<List<GoalOut>>(
|
||||
data: _responseData,
|
||||
headers: _response.headers,
|
||||
isRedirect: _response.isRedirect,
|
||||
requestOptions: _response.requestOptions,
|
||||
redirects: _response.redirects,
|
||||
statusCode: _response.statusCode,
|
||||
statusMessage: _response.statusMessage,
|
||||
extra: _response.extra,
|
||||
);
|
||||
}
|
||||
|
||||
/// Patch
|
||||
///
|
||||
///
|
||||
/// Parameters:
|
||||
/// * [goalId]
|
||||
/// * [goalPatch]
|
||||
/// * [cancelToken] - A [CancelToken] that can be used to cancel the operation
|
||||
/// * [headers] - Can be used to add additional headers to the request
|
||||
/// * [extras] - Can be used to add flags to the request
|
||||
/// * [validateStatus] - A [ValidateStatus] callback that can be used to determine request success based on the HTTP status of the response
|
||||
/// * [onSendProgress] - A [ProgressCallback] that can be used to get the send progress
|
||||
/// * [onReceiveProgress] - A [ProgressCallback] that can be used to get the receive progress
|
||||
///
|
||||
/// Returns a [Future] containing a [Response] with a [GoalOut] as data
|
||||
/// Throws [DioException] if API call or serialization fails
|
||||
Future<Response<GoalOut>> goalsPatch({
|
||||
required int goalId,
|
||||
required GoalPatch goalPatch,
|
||||
CancelToken? cancelToken,
|
||||
Map<String, dynamic>? headers,
|
||||
Map<String, dynamic>? extra,
|
||||
ValidateStatus? validateStatus,
|
||||
ProgressCallback? onSendProgress,
|
||||
ProgressCallback? onReceiveProgress,
|
||||
}) async {
|
||||
final _path = r'/api/v1/goals/{goal_id}'.replaceAll('{' r'goal_id' '}', goalId.toString());
|
||||
final _options = Options(
|
||||
method: r'PATCH',
|
||||
headers: <String, dynamic>{
|
||||
...?headers,
|
||||
},
|
||||
extra: <String, dynamic>{
|
||||
'secure': <Map<String, String>>[
|
||||
{
|
||||
'type': 'http',
|
||||
'scheme': 'bearer',
|
||||
'name': 'HTTPBearer',
|
||||
},
|
||||
],
|
||||
...?extra,
|
||||
},
|
||||
contentType: 'application/json',
|
||||
validateStatus: validateStatus,
|
||||
);
|
||||
|
||||
dynamic _bodyData;
|
||||
|
||||
try {
|
||||
_bodyData = jsonEncode(goalPatch);
|
||||
|
||||
} catch(error, stackTrace) {
|
||||
throw DioException(
|
||||
requestOptions: _options.compose(
|
||||
_dio.options,
|
||||
_path,
|
||||
),
|
||||
type: DioExceptionType.unknown,
|
||||
error: error,
|
||||
stackTrace: stackTrace,
|
||||
);
|
||||
}
|
||||
|
||||
final _response = await _dio.request<Object>(
|
||||
_path,
|
||||
data: _bodyData,
|
||||
options: _options,
|
||||
cancelToken: cancelToken,
|
||||
onSendProgress: onSendProgress,
|
||||
onReceiveProgress: onReceiveProgress,
|
||||
);
|
||||
|
||||
GoalOut? _responseData;
|
||||
|
||||
try {
|
||||
final rawData = _response.data;
|
||||
_responseData = rawData == null ? null : deserialize<GoalOut, GoalOut>(rawData, 'GoalOut', growable: true);
|
||||
|
||||
} catch (error, stackTrace) {
|
||||
throw DioException(
|
||||
requestOptions: _response.requestOptions,
|
||||
response: _response,
|
||||
type: DioExceptionType.unknown,
|
||||
error: error,
|
||||
stackTrace: stackTrace,
|
||||
);
|
||||
}
|
||||
|
||||
return Response<GoalOut>(
|
||||
data: _responseData,
|
||||
headers: _response.headers,
|
||||
isRedirect: _response.isRedirect,
|
||||
requestOptions: _response.requestOptions,
|
||||
redirects: _response.redirects,
|
||||
statusCode: _response.statusCode,
|
||||
statusMessage: _response.statusMessage,
|
||||
extra: _response.extra,
|
||||
);
|
||||
}
|
||||
|
||||
/// Progress
|
||||
///
|
||||
///
|
||||
/// Parameters:
|
||||
/// * [goalId]
|
||||
/// * [cancelToken] - A [CancelToken] that can be used to cancel the operation
|
||||
/// * [headers] - Can be used to add additional headers to the request
|
||||
/// * [extras] - Can be used to add flags to the request
|
||||
/// * [validateStatus] - A [ValidateStatus] callback that can be used to determine request success based on the HTTP status of the response
|
||||
/// * [onSendProgress] - A [ProgressCallback] that can be used to get the send progress
|
||||
/// * [onReceiveProgress] - A [ProgressCallback] that can be used to get the receive progress
|
||||
///
|
||||
/// Returns a [Future] containing a [Response] with a [GoalProgressOut] as data
|
||||
/// Throws [DioException] if API call or serialization fails
|
||||
Future<Response<GoalProgressOut>> goalsProgress({
|
||||
required int goalId,
|
||||
CancelToken? cancelToken,
|
||||
Map<String, dynamic>? headers,
|
||||
Map<String, dynamic>? extra,
|
||||
ValidateStatus? validateStatus,
|
||||
ProgressCallback? onSendProgress,
|
||||
ProgressCallback? onReceiveProgress,
|
||||
}) async {
|
||||
final _path = r'/api/v1/goals/{goal_id}/progress'.replaceAll('{' r'goal_id' '}', goalId.toString());
|
||||
final _options = Options(
|
||||
method: r'GET',
|
||||
headers: <String, dynamic>{
|
||||
...?headers,
|
||||
},
|
||||
extra: <String, dynamic>{
|
||||
'secure': <Map<String, String>>[
|
||||
{
|
||||
'type': 'http',
|
||||
'scheme': 'bearer',
|
||||
'name': 'HTTPBearer',
|
||||
},
|
||||
],
|
||||
...?extra,
|
||||
},
|
||||
validateStatus: validateStatus,
|
||||
);
|
||||
|
||||
final _response = await _dio.request<Object>(
|
||||
_path,
|
||||
options: _options,
|
||||
cancelToken: cancelToken,
|
||||
onSendProgress: onSendProgress,
|
||||
onReceiveProgress: onReceiveProgress,
|
||||
);
|
||||
|
||||
GoalProgressOut? _responseData;
|
||||
|
||||
try {
|
||||
final rawData = _response.data;
|
||||
_responseData = rawData == null ? null : deserialize<GoalProgressOut, GoalProgressOut>(rawData, 'GoalProgressOut', growable: true);
|
||||
|
||||
} catch (error, stackTrace) {
|
||||
throw DioException(
|
||||
requestOptions: _response.requestOptions,
|
||||
response: _response,
|
||||
type: DioExceptionType.unknown,
|
||||
error: error,
|
||||
stackTrace: stackTrace,
|
||||
);
|
||||
}
|
||||
|
||||
return Response<GoalProgressOut>(
|
||||
data: _responseData,
|
||||
headers: _response.headers,
|
||||
isRedirect: _response.isRedirect,
|
||||
requestOptions: _response.requestOptions,
|
||||
redirects: _response.redirects,
|
||||
statusCode: _response.statusCode,
|
||||
statusMessage: _response.statusMessage,
|
||||
extra: _response.extra,
|
||||
);
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,448 @@
|
||||
//
|
||||
// AUTO-GENERATED FILE, DO NOT MODIFY!
|
||||
//
|
||||
|
||||
import 'dart:async';
|
||||
|
||||
// ignore: unused_import
|
||||
import 'dart:convert';
|
||||
import 'package:fintracker_api/src/deserialize.dart';
|
||||
import 'package:dio/dio.dart';
|
||||
|
||||
import 'package:fintracker_api/src/model/commit_request.dart';
|
||||
import 'package:fintracker_api/src/model/import_preview.dart';
|
||||
import 'package:fintracker_api/src/model/import_result.dart';
|
||||
import 'package:fintracker_api/src/model/import_summary.dart';
|
||||
import 'package:fintracker_api/src/model/problem.dart';
|
||||
|
||||
class ImportsApi {
|
||||
|
||||
final Dio _dio;
|
||||
|
||||
const ImportsApi(this._dio);
|
||||
|
||||
/// Commit
|
||||
/// Write the file's events into the ledger and rebuild every metric.
|
||||
///
|
||||
/// Parameters:
|
||||
/// * [importId]
|
||||
/// * [commitRequest]
|
||||
/// * [cancelToken] - A [CancelToken] that can be used to cancel the operation
|
||||
/// * [headers] - Can be used to add additional headers to the request
|
||||
/// * [extras] - Can be used to add flags to the request
|
||||
/// * [validateStatus] - A [ValidateStatus] callback that can be used to determine request success based on the HTTP status of the response
|
||||
/// * [onSendProgress] - A [ProgressCallback] that can be used to get the send progress
|
||||
/// * [onReceiveProgress] - A [ProgressCallback] that can be used to get the receive progress
|
||||
///
|
||||
/// Returns a [Future] containing a [Response] with a [ImportResult] as data
|
||||
/// Throws [DioException] if API call or serialization fails
|
||||
Future<Response<ImportResult>> importsCommit({
|
||||
required int importId,
|
||||
required CommitRequest commitRequest,
|
||||
CancelToken? cancelToken,
|
||||
Map<String, dynamic>? headers,
|
||||
Map<String, dynamic>? extra,
|
||||
ValidateStatus? validateStatus,
|
||||
ProgressCallback? onSendProgress,
|
||||
ProgressCallback? onReceiveProgress,
|
||||
}) async {
|
||||
final _path = r'/api/v1/imports/{import_id}/commit'.replaceAll('{' r'import_id' '}', importId.toString());
|
||||
final _options = Options(
|
||||
method: r'POST',
|
||||
headers: <String, dynamic>{
|
||||
...?headers,
|
||||
},
|
||||
extra: <String, dynamic>{
|
||||
'secure': <Map<String, String>>[
|
||||
{
|
||||
'type': 'http',
|
||||
'scheme': 'bearer',
|
||||
'name': 'HTTPBearer',
|
||||
},
|
||||
],
|
||||
...?extra,
|
||||
},
|
||||
contentType: 'application/json',
|
||||
validateStatus: validateStatus,
|
||||
);
|
||||
|
||||
dynamic _bodyData;
|
||||
|
||||
try {
|
||||
_bodyData = jsonEncode(commitRequest);
|
||||
|
||||
} catch(error, stackTrace) {
|
||||
throw DioException(
|
||||
requestOptions: _options.compose(
|
||||
_dio.options,
|
||||
_path,
|
||||
),
|
||||
type: DioExceptionType.unknown,
|
||||
error: error,
|
||||
stackTrace: stackTrace,
|
||||
);
|
||||
}
|
||||
|
||||
final _response = await _dio.request<Object>(
|
||||
_path,
|
||||
data: _bodyData,
|
||||
options: _options,
|
||||
cancelToken: cancelToken,
|
||||
onSendProgress: onSendProgress,
|
||||
onReceiveProgress: onReceiveProgress,
|
||||
);
|
||||
|
||||
ImportResult? _responseData;
|
||||
|
||||
try {
|
||||
final rawData = _response.data;
|
||||
_responseData = rawData == null ? null : deserialize<ImportResult, ImportResult>(rawData, 'ImportResult', growable: true);
|
||||
|
||||
} catch (error, stackTrace) {
|
||||
throw DioException(
|
||||
requestOptions: _response.requestOptions,
|
||||
response: _response,
|
||||
type: DioExceptionType.unknown,
|
||||
error: error,
|
||||
stackTrace: stackTrace,
|
||||
);
|
||||
}
|
||||
|
||||
return Response<ImportResult>(
|
||||
data: _responseData,
|
||||
headers: _response.headers,
|
||||
isRedirect: _response.isRedirect,
|
||||
requestOptions: _response.requestOptions,
|
||||
redirects: _response.redirects,
|
||||
statusCode: _response.statusCode,
|
||||
statusMessage: _response.statusMessage,
|
||||
extra: _response.extra,
|
||||
);
|
||||
}
|
||||
|
||||
/// Create
|
||||
/// Upload a report, parse it and show what committing it would do. Writes no event.
|
||||
///
|
||||
/// Parameters:
|
||||
/// * [file] - the report itself
|
||||
/// * [accountId] - target account, if known
|
||||
/// * [parser] - force a parser from registry.names()
|
||||
/// * [cancelToken] - A [CancelToken] that can be used to cancel the operation
|
||||
/// * [headers] - Can be used to add additional headers to the request
|
||||
/// * [extras] - Can be used to add flags to the request
|
||||
/// * [validateStatus] - A [ValidateStatus] callback that can be used to determine request success based on the HTTP status of the response
|
||||
/// * [onSendProgress] - A [ProgressCallback] that can be used to get the send progress
|
||||
/// * [onReceiveProgress] - A [ProgressCallback] that can be used to get the receive progress
|
||||
///
|
||||
/// Returns a [Future] containing a [Response] with a [ImportPreview] as data
|
||||
/// Throws [DioException] if API call or serialization fails
|
||||
Future<Response<ImportPreview>> importsCreate({
|
||||
required MultipartFile file,
|
||||
int? accountId,
|
||||
String? parser,
|
||||
CancelToken? cancelToken,
|
||||
Map<String, dynamic>? headers,
|
||||
Map<String, dynamic>? extra,
|
||||
ValidateStatus? validateStatus,
|
||||
ProgressCallback? onSendProgress,
|
||||
ProgressCallback? onReceiveProgress,
|
||||
}) async {
|
||||
final _path = r'/api/v1/imports';
|
||||
final _options = Options(
|
||||
method: r'POST',
|
||||
headers: <String, dynamic>{
|
||||
...?headers,
|
||||
},
|
||||
extra: <String, dynamic>{
|
||||
'secure': <Map<String, String>>[
|
||||
{
|
||||
'type': 'http',
|
||||
'scheme': 'bearer',
|
||||
'name': 'HTTPBearer',
|
||||
},
|
||||
],
|
||||
...?extra,
|
||||
},
|
||||
contentType: 'multipart/form-data',
|
||||
validateStatus: validateStatus,
|
||||
);
|
||||
|
||||
dynamic _bodyData;
|
||||
|
||||
try {
|
||||
_bodyData = FormData.fromMap(<String, dynamic>{
|
||||
r'account_id': accountId,
|
||||
r'file': file,
|
||||
r'parser': parser,
|
||||
});
|
||||
|
||||
} catch(error, stackTrace) {
|
||||
throw DioException(
|
||||
requestOptions: _options.compose(
|
||||
_dio.options,
|
||||
_path,
|
||||
),
|
||||
type: DioExceptionType.unknown,
|
||||
error: error,
|
||||
stackTrace: stackTrace,
|
||||
);
|
||||
}
|
||||
|
||||
final _response = await _dio.request<Object>(
|
||||
_path,
|
||||
data: _bodyData,
|
||||
options: _options,
|
||||
cancelToken: cancelToken,
|
||||
onSendProgress: onSendProgress,
|
||||
onReceiveProgress: onReceiveProgress,
|
||||
);
|
||||
|
||||
ImportPreview? _responseData;
|
||||
|
||||
try {
|
||||
final rawData = _response.data;
|
||||
_responseData = rawData == null ? null : deserialize<ImportPreview, ImportPreview>(rawData, 'ImportPreview', growable: true);
|
||||
|
||||
} catch (error, stackTrace) {
|
||||
throw DioException(
|
||||
requestOptions: _response.requestOptions,
|
||||
response: _response,
|
||||
type: DioExceptionType.unknown,
|
||||
error: error,
|
||||
stackTrace: stackTrace,
|
||||
);
|
||||
}
|
||||
|
||||
return Response<ImportPreview>(
|
||||
data: _responseData,
|
||||
headers: _response.headers,
|
||||
isRedirect: _response.isRedirect,
|
||||
requestOptions: _response.requestOptions,
|
||||
redirects: _response.redirects,
|
||||
statusCode: _response.statusCode,
|
||||
statusMessage: _response.statusMessage,
|
||||
extra: _response.extra,
|
||||
);
|
||||
}
|
||||
|
||||
/// Delete
|
||||
/// Drop an uncommitted import. A committed one stays: `raw_*` is append-only.
|
||||
///
|
||||
/// Parameters:
|
||||
/// * [importId]
|
||||
/// * [cancelToken] - A [CancelToken] that can be used to cancel the operation
|
||||
/// * [headers] - Can be used to add additional headers to the request
|
||||
/// * [extras] - Can be used to add flags to the request
|
||||
/// * [validateStatus] - A [ValidateStatus] callback that can be used to determine request success based on the HTTP status of the response
|
||||
/// * [onSendProgress] - A [ProgressCallback] that can be used to get the send progress
|
||||
/// * [onReceiveProgress] - A [ProgressCallback] that can be used to get the receive progress
|
||||
///
|
||||
/// Returns a [Future]
|
||||
/// Throws [DioException] if API call or serialization fails
|
||||
Future<Response<void>> importsDelete({
|
||||
required int importId,
|
||||
CancelToken? cancelToken,
|
||||
Map<String, dynamic>? headers,
|
||||
Map<String, dynamic>? extra,
|
||||
ValidateStatus? validateStatus,
|
||||
ProgressCallback? onSendProgress,
|
||||
ProgressCallback? onReceiveProgress,
|
||||
}) async {
|
||||
final _path = r'/api/v1/imports/{import_id}'.replaceAll('{' r'import_id' '}', importId.toString());
|
||||
final _options = Options(
|
||||
method: r'DELETE',
|
||||
headers: <String, dynamic>{
|
||||
...?headers,
|
||||
},
|
||||
extra: <String, dynamic>{
|
||||
'secure': <Map<String, String>>[
|
||||
{
|
||||
'type': 'http',
|
||||
'scheme': 'bearer',
|
||||
'name': 'HTTPBearer',
|
||||
},
|
||||
],
|
||||
...?extra,
|
||||
},
|
||||
validateStatus: validateStatus,
|
||||
);
|
||||
|
||||
final _response = await _dio.request<Object>(
|
||||
_path,
|
||||
options: _options,
|
||||
cancelToken: cancelToken,
|
||||
onSendProgress: onSendProgress,
|
||||
onReceiveProgress: onReceiveProgress,
|
||||
);
|
||||
|
||||
return _response;
|
||||
}
|
||||
|
||||
/// Get
|
||||
/// The preview again — recomputed for an uncommitted import, replayed for a committed one.
|
||||
///
|
||||
/// Parameters:
|
||||
/// * [importId]
|
||||
/// * [cancelToken] - A [CancelToken] that can be used to cancel the operation
|
||||
/// * [headers] - Can be used to add additional headers to the request
|
||||
/// * [extras] - Can be used to add flags to the request
|
||||
/// * [validateStatus] - A [ValidateStatus] callback that can be used to determine request success based on the HTTP status of the response
|
||||
/// * [onSendProgress] - A [ProgressCallback] that can be used to get the send progress
|
||||
/// * [onReceiveProgress] - A [ProgressCallback] that can be used to get the receive progress
|
||||
///
|
||||
/// Returns a [Future] containing a [Response] with a [ImportPreview] as data
|
||||
/// Throws [DioException] if API call or serialization fails
|
||||
Future<Response<ImportPreview>> importsGet({
|
||||
required int importId,
|
||||
CancelToken? cancelToken,
|
||||
Map<String, dynamic>? headers,
|
||||
Map<String, dynamic>? extra,
|
||||
ValidateStatus? validateStatus,
|
||||
ProgressCallback? onSendProgress,
|
||||
ProgressCallback? onReceiveProgress,
|
||||
}) async {
|
||||
final _path = r'/api/v1/imports/{import_id}'.replaceAll('{' r'import_id' '}', importId.toString());
|
||||
final _options = Options(
|
||||
method: r'GET',
|
||||
headers: <String, dynamic>{
|
||||
...?headers,
|
||||
},
|
||||
extra: <String, dynamic>{
|
||||
'secure': <Map<String, String>>[
|
||||
{
|
||||
'type': 'http',
|
||||
'scheme': 'bearer',
|
||||
'name': 'HTTPBearer',
|
||||
},
|
||||
],
|
||||
...?extra,
|
||||
},
|
||||
validateStatus: validateStatus,
|
||||
);
|
||||
|
||||
final _response = await _dio.request<Object>(
|
||||
_path,
|
||||
options: _options,
|
||||
cancelToken: cancelToken,
|
||||
onSendProgress: onSendProgress,
|
||||
onReceiveProgress: onReceiveProgress,
|
||||
);
|
||||
|
||||
ImportPreview? _responseData;
|
||||
|
||||
try {
|
||||
final rawData = _response.data;
|
||||
_responseData = rawData == null ? null : deserialize<ImportPreview, ImportPreview>(rawData, 'ImportPreview', growable: true);
|
||||
|
||||
} catch (error, stackTrace) {
|
||||
throw DioException(
|
||||
requestOptions: _response.requestOptions,
|
||||
response: _response,
|
||||
type: DioExceptionType.unknown,
|
||||
error: error,
|
||||
stackTrace: stackTrace,
|
||||
);
|
||||
}
|
||||
|
||||
return Response<ImportPreview>(
|
||||
data: _responseData,
|
||||
headers: _response.headers,
|
||||
isRedirect: _response.isRedirect,
|
||||
requestOptions: _response.requestOptions,
|
||||
redirects: _response.redirects,
|
||||
statusCode: _response.statusCode,
|
||||
statusMessage: _response.statusMessage,
|
||||
extra: _response.extra,
|
||||
);
|
||||
}
|
||||
|
||||
/// List
|
||||
/// Newest imports first, with the counters each was committed with.
|
||||
///
|
||||
/// Parameters:
|
||||
/// * [status] - uploaded | parsed | committed | failed
|
||||
/// * [limit]
|
||||
/// * [offset]
|
||||
/// * [cancelToken] - A [CancelToken] that can be used to cancel the operation
|
||||
/// * [headers] - Can be used to add additional headers to the request
|
||||
/// * [extras] - Can be used to add flags to the request
|
||||
/// * [validateStatus] - A [ValidateStatus] callback that can be used to determine request success based on the HTTP status of the response
|
||||
/// * [onSendProgress] - A [ProgressCallback] that can be used to get the send progress
|
||||
/// * [onReceiveProgress] - A [ProgressCallback] that can be used to get the receive progress
|
||||
///
|
||||
/// Returns a [Future] containing a [Response] with a [List<ImportSummary>] as data
|
||||
/// Throws [DioException] if API call or serialization fails
|
||||
Future<Response<List<ImportSummary>>> importsList({
|
||||
String? status,
|
||||
int? limit = 50,
|
||||
int? offset = 0,
|
||||
CancelToken? cancelToken,
|
||||
Map<String, dynamic>? headers,
|
||||
Map<String, dynamic>? extra,
|
||||
ValidateStatus? validateStatus,
|
||||
ProgressCallback? onSendProgress,
|
||||
ProgressCallback? onReceiveProgress,
|
||||
}) async {
|
||||
final _path = r'/api/v1/imports';
|
||||
final _options = Options(
|
||||
method: r'GET',
|
||||
headers: <String, dynamic>{
|
||||
...?headers,
|
||||
},
|
||||
extra: <String, dynamic>{
|
||||
'secure': <Map<String, String>>[
|
||||
{
|
||||
'type': 'http',
|
||||
'scheme': 'bearer',
|
||||
'name': 'HTTPBearer',
|
||||
},
|
||||
],
|
||||
...?extra,
|
||||
},
|
||||
validateStatus: validateStatus,
|
||||
);
|
||||
|
||||
final _queryParameters = <String, dynamic>{
|
||||
if (status != null) r'status': status,
|
||||
if (limit != null) r'limit': limit,
|
||||
if (offset != null) r'offset': offset,
|
||||
};
|
||||
|
||||
final _response = await _dio.request<Object>(
|
||||
_path,
|
||||
options: _options,
|
||||
queryParameters: _queryParameters,
|
||||
cancelToken: cancelToken,
|
||||
onSendProgress: onSendProgress,
|
||||
onReceiveProgress: onReceiveProgress,
|
||||
);
|
||||
|
||||
List<ImportSummary>? _responseData;
|
||||
|
||||
try {
|
||||
final rawData = _response.data;
|
||||
_responseData = rawData == null ? null : deserialize<List<ImportSummary>, ImportSummary>(rawData, 'List<ImportSummary>', growable: true);
|
||||
|
||||
} catch (error, stackTrace) {
|
||||
throw DioException(
|
||||
requestOptions: _response.requestOptions,
|
||||
response: _response,
|
||||
type: DioExceptionType.unknown,
|
||||
error: error,
|
||||
stackTrace: stackTrace,
|
||||
);
|
||||
}
|
||||
|
||||
return Response<List<ImportSummary>>(
|
||||
data: _responseData,
|
||||
headers: _response.headers,
|
||||
isRedirect: _response.isRedirect,
|
||||
requestOptions: _response.requestOptions,
|
||||
redirects: _response.redirects,
|
||||
statusCode: _response.statusCode,
|
||||
statusMessage: _response.statusMessage,
|
||||
extra: _response.extra,
|
||||
);
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,296 @@
|
||||
//
|
||||
// AUTO-GENERATED FILE, DO NOT MODIFY!
|
||||
//
|
||||
|
||||
import 'dart:async';
|
||||
|
||||
// ignore: unused_import
|
||||
import 'dart:convert';
|
||||
import 'package:fintracker_api/src/deserialize.dart';
|
||||
import 'package:dio/dio.dart';
|
||||
|
||||
import 'package:fintracker_api/src/model/calendar_out.dart';
|
||||
import 'package:fintracker_api/src/model/forecast_out.dart';
|
||||
import 'package:fintracker_api/src/model/history_out.dart';
|
||||
import 'package:fintracker_api/src/model/problem.dart';
|
||||
|
||||
class IncomeApi {
|
||||
|
||||
final Dio _dio;
|
||||
|
||||
const IncomeApi(this._dio);
|
||||
|
||||
/// Calendar
|
||||
/// Payments in a window, one row each; defaults to the next 12 months, forecast only.
|
||||
///
|
||||
/// Parameters:
|
||||
/// * [scope] - all | account:<id> | portfolio:<id>
|
||||
/// * [dateFrom]
|
||||
/// * [dateTo]
|
||||
/// * [includePaid]
|
||||
/// * [cancelToken] - A [CancelToken] that can be used to cancel the operation
|
||||
/// * [headers] - Can be used to add additional headers to the request
|
||||
/// * [extras] - Can be used to add flags to the request
|
||||
/// * [validateStatus] - A [ValidateStatus] callback that can be used to determine request success based on the HTTP status of the response
|
||||
/// * [onSendProgress] - A [ProgressCallback] that can be used to get the send progress
|
||||
/// * [onReceiveProgress] - A [ProgressCallback] that can be used to get the receive progress
|
||||
///
|
||||
/// Returns a [Future] containing a [Response] with a [CalendarOut] as data
|
||||
/// Throws [DioException] if API call or serialization fails
|
||||
Future<Response<CalendarOut>> incomeCalendar({
|
||||
String? scope = 'all',
|
||||
DateTime? dateFrom,
|
||||
DateTime? dateTo,
|
||||
bool? includePaid = false,
|
||||
CancelToken? cancelToken,
|
||||
Map<String, dynamic>? headers,
|
||||
Map<String, dynamic>? extra,
|
||||
ValidateStatus? validateStatus,
|
||||
ProgressCallback? onSendProgress,
|
||||
ProgressCallback? onReceiveProgress,
|
||||
}) async {
|
||||
final _path = r'/api/v1/income/calendar';
|
||||
final _options = Options(
|
||||
method: r'GET',
|
||||
headers: <String, dynamic>{
|
||||
...?headers,
|
||||
},
|
||||
extra: <String, dynamic>{
|
||||
'secure': <Map<String, String>>[
|
||||
{
|
||||
'type': 'http',
|
||||
'scheme': 'bearer',
|
||||
'name': 'HTTPBearer',
|
||||
},
|
||||
],
|
||||
...?extra,
|
||||
},
|
||||
validateStatus: validateStatus,
|
||||
);
|
||||
|
||||
final _queryParameters = <String, dynamic>{
|
||||
if (scope != null) r'scope': scope,
|
||||
if (dateFrom != null) r'date_from': dateFrom,
|
||||
if (dateTo != null) r'date_to': dateTo,
|
||||
if (includePaid != null) r'include_paid': includePaid,
|
||||
};
|
||||
|
||||
final _response = await _dio.request<Object>(
|
||||
_path,
|
||||
options: _options,
|
||||
queryParameters: _queryParameters,
|
||||
cancelToken: cancelToken,
|
||||
onSendProgress: onSendProgress,
|
||||
onReceiveProgress: onReceiveProgress,
|
||||
);
|
||||
|
||||
CalendarOut? _responseData;
|
||||
|
||||
try {
|
||||
final rawData = _response.data;
|
||||
_responseData = rawData == null ? null : deserialize<CalendarOut, CalendarOut>(rawData, 'CalendarOut', growable: true);
|
||||
|
||||
} catch (error, stackTrace) {
|
||||
throw DioException(
|
||||
requestOptions: _response.requestOptions,
|
||||
response: _response,
|
||||
type: DioExceptionType.unknown,
|
||||
error: error,
|
||||
stackTrace: stackTrace,
|
||||
);
|
||||
}
|
||||
|
||||
return Response<CalendarOut>(
|
||||
data: _responseData,
|
||||
headers: _response.headers,
|
||||
isRedirect: _response.isRedirect,
|
||||
requestOptions: _response.requestOptions,
|
||||
redirects: _response.redirects,
|
||||
statusCode: _response.statusCode,
|
||||
statusMessage: _response.statusMessage,
|
||||
extra: _response.extra,
|
||||
);
|
||||
}
|
||||
|
||||
/// Forecast
|
||||
/// Expected income per month, split by basis, plus the yield it implies.
|
||||
///
|
||||
/// Parameters:
|
||||
/// * [scope] - all | account:<id> | portfolio:<id>
|
||||
/// * [months]
|
||||
/// * [cancelToken] - A [CancelToken] that can be used to cancel the operation
|
||||
/// * [headers] - Can be used to add additional headers to the request
|
||||
/// * [extras] - Can be used to add flags to the request
|
||||
/// * [validateStatus] - A [ValidateStatus] callback that can be used to determine request success based on the HTTP status of the response
|
||||
/// * [onSendProgress] - A [ProgressCallback] that can be used to get the send progress
|
||||
/// * [onReceiveProgress] - A [ProgressCallback] that can be used to get the receive progress
|
||||
///
|
||||
/// Returns a [Future] containing a [Response] with a [ForecastOut] as data
|
||||
/// Throws [DioException] if API call or serialization fails
|
||||
Future<Response<ForecastOut>> incomeForecast({
|
||||
String? scope = 'all',
|
||||
int? months = 12,
|
||||
CancelToken? cancelToken,
|
||||
Map<String, dynamic>? headers,
|
||||
Map<String, dynamic>? extra,
|
||||
ValidateStatus? validateStatus,
|
||||
ProgressCallback? onSendProgress,
|
||||
ProgressCallback? onReceiveProgress,
|
||||
}) async {
|
||||
final _path = r'/api/v1/income/forecast';
|
||||
final _options = Options(
|
||||
method: r'GET',
|
||||
headers: <String, dynamic>{
|
||||
...?headers,
|
||||
},
|
||||
extra: <String, dynamic>{
|
||||
'secure': <Map<String, String>>[
|
||||
{
|
||||
'type': 'http',
|
||||
'scheme': 'bearer',
|
||||
'name': 'HTTPBearer',
|
||||
},
|
||||
],
|
||||
...?extra,
|
||||
},
|
||||
validateStatus: validateStatus,
|
||||
);
|
||||
|
||||
final _queryParameters = <String, dynamic>{
|
||||
if (scope != null) r'scope': scope,
|
||||
if (months != null) r'months': months,
|
||||
};
|
||||
|
||||
final _response = await _dio.request<Object>(
|
||||
_path,
|
||||
options: _options,
|
||||
queryParameters: _queryParameters,
|
||||
cancelToken: cancelToken,
|
||||
onSendProgress: onSendProgress,
|
||||
onReceiveProgress: onReceiveProgress,
|
||||
);
|
||||
|
||||
ForecastOut? _responseData;
|
||||
|
||||
try {
|
||||
final rawData = _response.data;
|
||||
_responseData = rawData == null ? null : deserialize<ForecastOut, ForecastOut>(rawData, 'ForecastOut', growable: true);
|
||||
|
||||
} catch (error, stackTrace) {
|
||||
throw DioException(
|
||||
requestOptions: _response.requestOptions,
|
||||
response: _response,
|
||||
type: DioExceptionType.unknown,
|
||||
error: error,
|
||||
stackTrace: stackTrace,
|
||||
);
|
||||
}
|
||||
|
||||
return Response<ForecastOut>(
|
||||
data: _responseData,
|
||||
headers: _response.headers,
|
||||
isRedirect: _response.isRedirect,
|
||||
requestOptions: _response.requestOptions,
|
||||
redirects: _response.redirects,
|
||||
statusCode: _response.statusCode,
|
||||
statusMessage: _response.statusMessage,
|
||||
extra: _response.extra,
|
||||
);
|
||||
}
|
||||
|
||||
/// History
|
||||
/// Income actually received, grouped by month, kind and currency. `group` exists for the contract's sake and accepts only `month`: the table is stored monthly, and a finer grouping would have to re-read the ledger, which is what the calendar's `paid` rows already do per payment.
|
||||
///
|
||||
/// Parameters:
|
||||
/// * [scope] - all | account:<id> | portfolio:<id>
|
||||
/// * [group] - month
|
||||
/// * [dateFrom]
|
||||
/// * [dateTo]
|
||||
/// * [kind] - dividend | coupon | …
|
||||
/// * [cancelToken] - A [CancelToken] that can be used to cancel the operation
|
||||
/// * [headers] - Can be used to add additional headers to the request
|
||||
/// * [extras] - Can be used to add flags to the request
|
||||
/// * [validateStatus] - A [ValidateStatus] callback that can be used to determine request success based on the HTTP status of the response
|
||||
/// * [onSendProgress] - A [ProgressCallback] that can be used to get the send progress
|
||||
/// * [onReceiveProgress] - A [ProgressCallback] that can be used to get the receive progress
|
||||
///
|
||||
/// Returns a [Future] containing a [Response] with a [HistoryOut] as data
|
||||
/// Throws [DioException] if API call or serialization fails
|
||||
Future<Response<HistoryOut>> incomeHistory({
|
||||
String? scope = 'all',
|
||||
String? group = 'month',
|
||||
DateTime? dateFrom,
|
||||
DateTime? dateTo,
|
||||
String? kind,
|
||||
CancelToken? cancelToken,
|
||||
Map<String, dynamic>? headers,
|
||||
Map<String, dynamic>? extra,
|
||||
ValidateStatus? validateStatus,
|
||||
ProgressCallback? onSendProgress,
|
||||
ProgressCallback? onReceiveProgress,
|
||||
}) async {
|
||||
final _path = r'/api/v1/income/history';
|
||||
final _options = Options(
|
||||
method: r'GET',
|
||||
headers: <String, dynamic>{
|
||||
...?headers,
|
||||
},
|
||||
extra: <String, dynamic>{
|
||||
'secure': <Map<String, String>>[
|
||||
{
|
||||
'type': 'http',
|
||||
'scheme': 'bearer',
|
||||
'name': 'HTTPBearer',
|
||||
},
|
||||
],
|
||||
...?extra,
|
||||
},
|
||||
validateStatus: validateStatus,
|
||||
);
|
||||
|
||||
final _queryParameters = <String, dynamic>{
|
||||
if (scope != null) r'scope': scope,
|
||||
if (group != null) r'group': group,
|
||||
if (dateFrom != null) r'date_from': dateFrom,
|
||||
if (dateTo != null) r'date_to': dateTo,
|
||||
if (kind != null) r'kind': kind,
|
||||
};
|
||||
|
||||
final _response = await _dio.request<Object>(
|
||||
_path,
|
||||
options: _options,
|
||||
queryParameters: _queryParameters,
|
||||
cancelToken: cancelToken,
|
||||
onSendProgress: onSendProgress,
|
||||
onReceiveProgress: onReceiveProgress,
|
||||
);
|
||||
|
||||
HistoryOut? _responseData;
|
||||
|
||||
try {
|
||||
final rawData = _response.data;
|
||||
_responseData = rawData == null ? null : deserialize<HistoryOut, HistoryOut>(rawData, 'HistoryOut', growable: true);
|
||||
|
||||
} catch (error, stackTrace) {
|
||||
throw DioException(
|
||||
requestOptions: _response.requestOptions,
|
||||
response: _response,
|
||||
type: DioExceptionType.unknown,
|
||||
error: error,
|
||||
stackTrace: stackTrace,
|
||||
);
|
||||
}
|
||||
|
||||
return Response<HistoryOut>(
|
||||
data: _responseData,
|
||||
headers: _response.headers,
|
||||
isRedirect: _response.isRedirect,
|
||||
requestOptions: _response.requestOptions,
|
||||
redirects: _response.redirects,
|
||||
statusCode: _response.statusCode,
|
||||
statusMessage: _response.statusMessage,
|
||||
extra: _response.extra,
|
||||
);
|
||||
}
|
||||
|
||||
}
|
||||
@@ -11,6 +11,11 @@ import 'package:dio/dio.dart';
|
||||
|
||||
import 'package:fintracker_api/src/model/instrument_detail.dart';
|
||||
import 'package:fintracker_api/src/model/instrument_out.dart';
|
||||
import 'package:fintracker_api/src/model/pending_instrument_out.dart';
|
||||
import 'package:fintracker_api/src/model/pending_resolve_request.dart';
|
||||
import 'package:fintracker_api/src/model/pending_resolve_result.dart';
|
||||
import 'package:fintracker_api/src/model/price_manual_in.dart';
|
||||
import 'package:fintracker_api/src/model/price_manual_out.dart';
|
||||
import 'package:fintracker_api/src/model/problem.dart';
|
||||
|
||||
class InstrumentsApi {
|
||||
@@ -199,4 +204,291 @@ _responseData = rawData == null ? null : deserialize<List<InstrumentOut>, Instru
|
||||
);
|
||||
}
|
||||
|
||||
/// Pending
|
||||
/// Instruments a report named that nothing in the master resolves to.
|
||||
///
|
||||
/// Parameters:
|
||||
/// * [status] - pending | resolved | ignored | all
|
||||
/// * [limit]
|
||||
/// * [offset]
|
||||
/// * [cancelToken] - A [CancelToken] that can be used to cancel the operation
|
||||
/// * [headers] - Can be used to add additional headers to the request
|
||||
/// * [extras] - Can be used to add flags to the request
|
||||
/// * [validateStatus] - A [ValidateStatus] callback that can be used to determine request success based on the HTTP status of the response
|
||||
/// * [onSendProgress] - A [ProgressCallback] that can be used to get the send progress
|
||||
/// * [onReceiveProgress] - A [ProgressCallback] that can be used to get the receive progress
|
||||
///
|
||||
/// Returns a [Future] containing a [Response] with a [List<PendingInstrumentOut>] as data
|
||||
/// Throws [DioException] if API call or serialization fails
|
||||
Future<Response<List<PendingInstrumentOut>>> instrumentsPending({
|
||||
String? status = 'pending',
|
||||
int? limit = 100,
|
||||
int? offset = 0,
|
||||
CancelToken? cancelToken,
|
||||
Map<String, dynamic>? headers,
|
||||
Map<String, dynamic>? extra,
|
||||
ValidateStatus? validateStatus,
|
||||
ProgressCallback? onSendProgress,
|
||||
ProgressCallback? onReceiveProgress,
|
||||
}) async {
|
||||
final _path = r'/api/v1/instruments/pending';
|
||||
final _options = Options(
|
||||
method: r'GET',
|
||||
headers: <String, dynamic>{
|
||||
...?headers,
|
||||
},
|
||||
extra: <String, dynamic>{
|
||||
'secure': <Map<String, String>>[
|
||||
{
|
||||
'type': 'http',
|
||||
'scheme': 'bearer',
|
||||
'name': 'HTTPBearer',
|
||||
},
|
||||
],
|
||||
...?extra,
|
||||
},
|
||||
validateStatus: validateStatus,
|
||||
);
|
||||
|
||||
final _queryParameters = <String, dynamic>{
|
||||
if (status != null) r'status': status,
|
||||
if (limit != null) r'limit': limit,
|
||||
if (offset != null) r'offset': offset,
|
||||
};
|
||||
|
||||
final _response = await _dio.request<Object>(
|
||||
_path,
|
||||
options: _options,
|
||||
queryParameters: _queryParameters,
|
||||
cancelToken: cancelToken,
|
||||
onSendProgress: onSendProgress,
|
||||
onReceiveProgress: onReceiveProgress,
|
||||
);
|
||||
|
||||
List<PendingInstrumentOut>? _responseData;
|
||||
|
||||
try {
|
||||
final rawData = _response.data;
|
||||
_responseData = rawData == null ? null : deserialize<List<PendingInstrumentOut>, PendingInstrumentOut>(rawData, 'List<PendingInstrumentOut>', growable: true);
|
||||
|
||||
} catch (error, stackTrace) {
|
||||
throw DioException(
|
||||
requestOptions: _response.requestOptions,
|
||||
response: _response,
|
||||
type: DioExceptionType.unknown,
|
||||
error: error,
|
||||
stackTrace: stackTrace,
|
||||
);
|
||||
}
|
||||
|
||||
return Response<List<PendingInstrumentOut>>(
|
||||
data: _responseData,
|
||||
headers: _response.headers,
|
||||
isRedirect: _response.isRedirect,
|
||||
requestOptions: _response.requestOptions,
|
||||
redirects: _response.redirects,
|
||||
statusCode: _response.statusCode,
|
||||
statusMessage: _response.statusMessage,
|
||||
extra: _response.extra,
|
||||
);
|
||||
}
|
||||
|
||||
/// Pending Resolve
|
||||
/// Link, create or ignore — then bind the events that were waiting and rebuild the lots.
|
||||
///
|
||||
/// Parameters:
|
||||
/// * [pendingId]
|
||||
/// * [pendingResolveRequest]
|
||||
/// * [cancelToken] - A [CancelToken] that can be used to cancel the operation
|
||||
/// * [headers] - Can be used to add additional headers to the request
|
||||
/// * [extras] - Can be used to add flags to the request
|
||||
/// * [validateStatus] - A [ValidateStatus] callback that can be used to determine request success based on the HTTP status of the response
|
||||
/// * [onSendProgress] - A [ProgressCallback] that can be used to get the send progress
|
||||
/// * [onReceiveProgress] - A [ProgressCallback] that can be used to get the receive progress
|
||||
///
|
||||
/// Returns a [Future] containing a [Response] with a [PendingResolveResult] as data
|
||||
/// Throws [DioException] if API call or serialization fails
|
||||
Future<Response<PendingResolveResult>> instrumentsPendingResolve({
|
||||
required int pendingId,
|
||||
required PendingResolveRequest pendingResolveRequest,
|
||||
CancelToken? cancelToken,
|
||||
Map<String, dynamic>? headers,
|
||||
Map<String, dynamic>? extra,
|
||||
ValidateStatus? validateStatus,
|
||||
ProgressCallback? onSendProgress,
|
||||
ProgressCallback? onReceiveProgress,
|
||||
}) async {
|
||||
final _path = r'/api/v1/instruments/pending/{pending_id}/resolve'.replaceAll('{' r'pending_id' '}', pendingId.toString());
|
||||
final _options = Options(
|
||||
method: r'POST',
|
||||
headers: <String, dynamic>{
|
||||
...?headers,
|
||||
},
|
||||
extra: <String, dynamic>{
|
||||
'secure': <Map<String, String>>[
|
||||
{
|
||||
'type': 'http',
|
||||
'scheme': 'bearer',
|
||||
'name': 'HTTPBearer',
|
||||
},
|
||||
],
|
||||
...?extra,
|
||||
},
|
||||
contentType: 'application/json',
|
||||
validateStatus: validateStatus,
|
||||
);
|
||||
|
||||
dynamic _bodyData;
|
||||
|
||||
try {
|
||||
_bodyData = jsonEncode(pendingResolveRequest);
|
||||
|
||||
} catch(error, stackTrace) {
|
||||
throw DioException(
|
||||
requestOptions: _options.compose(
|
||||
_dio.options,
|
||||
_path,
|
||||
),
|
||||
type: DioExceptionType.unknown,
|
||||
error: error,
|
||||
stackTrace: stackTrace,
|
||||
);
|
||||
}
|
||||
|
||||
final _response = await _dio.request<Object>(
|
||||
_path,
|
||||
data: _bodyData,
|
||||
options: _options,
|
||||
cancelToken: cancelToken,
|
||||
onSendProgress: onSendProgress,
|
||||
onReceiveProgress: onReceiveProgress,
|
||||
);
|
||||
|
||||
PendingResolveResult? _responseData;
|
||||
|
||||
try {
|
||||
final rawData = _response.data;
|
||||
_responseData = rawData == null ? null : deserialize<PendingResolveResult, PendingResolveResult>(rawData, 'PendingResolveResult', growable: true);
|
||||
|
||||
} catch (error, stackTrace) {
|
||||
throw DioException(
|
||||
requestOptions: _response.requestOptions,
|
||||
response: _response,
|
||||
type: DioExceptionType.unknown,
|
||||
error: error,
|
||||
stackTrace: stackTrace,
|
||||
);
|
||||
}
|
||||
|
||||
return Response<PendingResolveResult>(
|
||||
data: _responseData,
|
||||
headers: _response.headers,
|
||||
isRedirect: _response.isRedirect,
|
||||
requestOptions: _response.requestOptions,
|
||||
redirects: _response.redirects,
|
||||
statusCode: _response.statusCode,
|
||||
statusMessage: _response.statusMessage,
|
||||
extra: _response.extra,
|
||||
);
|
||||
}
|
||||
|
||||
/// Set Manual Price
|
||||
/// Set (or replace) the manual price of `instrument_id` on `body.d`. For what no exchange quotes: real estate, crypto, a custom holding, an OTC bond nobody lists. One row per (instrument, day) — a second call for the same day replaces it rather than piling up duplicates the price series would then have to pick between. Does not itself refresh `metric_*`; call `POST /metrics/refresh` after, same as `/rules/apply`.
|
||||
///
|
||||
/// Parameters:
|
||||
/// * [instrumentId]
|
||||
/// * [priceManualIn]
|
||||
/// * [cancelToken] - A [CancelToken] that can be used to cancel the operation
|
||||
/// * [headers] - Can be used to add additional headers to the request
|
||||
/// * [extras] - Can be used to add flags to the request
|
||||
/// * [validateStatus] - A [ValidateStatus] callback that can be used to determine request success based on the HTTP status of the response
|
||||
/// * [onSendProgress] - A [ProgressCallback] that can be used to get the send progress
|
||||
/// * [onReceiveProgress] - A [ProgressCallback] that can be used to get the receive progress
|
||||
///
|
||||
/// Returns a [Future] containing a [Response] with a [PriceManualOut] as data
|
||||
/// Throws [DioException] if API call or serialization fails
|
||||
Future<Response<PriceManualOut>> instrumentsSetManualPrice({
|
||||
required int instrumentId,
|
||||
required PriceManualIn priceManualIn,
|
||||
CancelToken? cancelToken,
|
||||
Map<String, dynamic>? headers,
|
||||
Map<String, dynamic>? extra,
|
||||
ValidateStatus? validateStatus,
|
||||
ProgressCallback? onSendProgress,
|
||||
ProgressCallback? onReceiveProgress,
|
||||
}) async {
|
||||
final _path = r'/api/v1/instruments/{instrument_id}/prices'.replaceAll('{' r'instrument_id' '}', instrumentId.toString());
|
||||
final _options = Options(
|
||||
method: r'POST',
|
||||
headers: <String, dynamic>{
|
||||
...?headers,
|
||||
},
|
||||
extra: <String, dynamic>{
|
||||
'secure': <Map<String, String>>[
|
||||
{
|
||||
'type': 'http',
|
||||
'scheme': 'bearer',
|
||||
'name': 'HTTPBearer',
|
||||
},
|
||||
],
|
||||
...?extra,
|
||||
},
|
||||
contentType: 'application/json',
|
||||
validateStatus: validateStatus,
|
||||
);
|
||||
|
||||
dynamic _bodyData;
|
||||
|
||||
try {
|
||||
_bodyData = jsonEncode(priceManualIn);
|
||||
|
||||
} catch(error, stackTrace) {
|
||||
throw DioException(
|
||||
requestOptions: _options.compose(
|
||||
_dio.options,
|
||||
_path,
|
||||
),
|
||||
type: DioExceptionType.unknown,
|
||||
error: error,
|
||||
stackTrace: stackTrace,
|
||||
);
|
||||
}
|
||||
|
||||
final _response = await _dio.request<Object>(
|
||||
_path,
|
||||
data: _bodyData,
|
||||
options: _options,
|
||||
cancelToken: cancelToken,
|
||||
onSendProgress: onSendProgress,
|
||||
onReceiveProgress: onReceiveProgress,
|
||||
);
|
||||
|
||||
PriceManualOut? _responseData;
|
||||
|
||||
try {
|
||||
final rawData = _response.data;
|
||||
_responseData = rawData == null ? null : deserialize<PriceManualOut, PriceManualOut>(rawData, 'PriceManualOut', growable: true);
|
||||
|
||||
} catch (error, stackTrace) {
|
||||
throw DioException(
|
||||
requestOptions: _response.requestOptions,
|
||||
response: _response,
|
||||
type: DioExceptionType.unknown,
|
||||
error: error,
|
||||
stackTrace: stackTrace,
|
||||
);
|
||||
}
|
||||
|
||||
return Response<PriceManualOut>(
|
||||
data: _responseData,
|
||||
headers: _response.headers,
|
||||
isRedirect: _response.isRedirect,
|
||||
requestOptions: _response.requestOptions,
|
||||
redirects: _response.redirects,
|
||||
statusCode: _response.statusCode,
|
||||
statusMessage: _response.statusMessage,
|
||||
extra: _response.extra,
|
||||
);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -0,0 +1,249 @@
|
||||
//
|
||||
// AUTO-GENERATED FILE, DO NOT MODIFY!
|
||||
//
|
||||
|
||||
import 'dart:async';
|
||||
|
||||
// ignore: unused_import
|
||||
import 'dart:convert';
|
||||
import 'package:fintracker_api/src/deserialize.dart';
|
||||
import 'package:dio/dio.dart';
|
||||
|
||||
import 'package:fintracker_api/src/model/link_create.dart';
|
||||
import 'package:fintracker_api/src/model/link_out.dart';
|
||||
import 'package:fintracker_api/src/model/problem.dart';
|
||||
import 'package:fintracker_api/src/model/unmatched_out.dart';
|
||||
|
||||
class LinksApi {
|
||||
|
||||
final Dio _dio;
|
||||
|
||||
const LinksApi(this._dio);
|
||||
|
||||
/// Create
|
||||
/// Confirm a pairing the matcher missed. Never touched by the automatic rebuild afterwards.
|
||||
///
|
||||
/// Parameters:
|
||||
/// * [linkCreate]
|
||||
/// * [cancelToken] - A [CancelToken] that can be used to cancel the operation
|
||||
/// * [headers] - Can be used to add additional headers to the request
|
||||
/// * [extras] - Can be used to add flags to the request
|
||||
/// * [validateStatus] - A [ValidateStatus] callback that can be used to determine request success based on the HTTP status of the response
|
||||
/// * [onSendProgress] - A [ProgressCallback] that can be used to get the send progress
|
||||
/// * [onReceiveProgress] - A [ProgressCallback] that can be used to get the receive progress
|
||||
///
|
||||
/// Returns a [Future] containing a [Response] with a [LinkOut] as data
|
||||
/// Throws [DioException] if API call or serialization fails
|
||||
Future<Response<LinkOut>> linksCreate({
|
||||
required LinkCreate linkCreate,
|
||||
CancelToken? cancelToken,
|
||||
Map<String, dynamic>? headers,
|
||||
Map<String, dynamic>? extra,
|
||||
ValidateStatus? validateStatus,
|
||||
ProgressCallback? onSendProgress,
|
||||
ProgressCallback? onReceiveProgress,
|
||||
}) async {
|
||||
final _path = r'/api/v1/links';
|
||||
final _options = Options(
|
||||
method: r'POST',
|
||||
headers: <String, dynamic>{
|
||||
...?headers,
|
||||
},
|
||||
extra: <String, dynamic>{
|
||||
'secure': <Map<String, String>>[
|
||||
{
|
||||
'type': 'http',
|
||||
'scheme': 'bearer',
|
||||
'name': 'HTTPBearer',
|
||||
},
|
||||
],
|
||||
...?extra,
|
||||
},
|
||||
contentType: 'application/json',
|
||||
validateStatus: validateStatus,
|
||||
);
|
||||
|
||||
dynamic _bodyData;
|
||||
|
||||
try {
|
||||
_bodyData = jsonEncode(linkCreate);
|
||||
|
||||
} catch(error, stackTrace) {
|
||||
throw DioException(
|
||||
requestOptions: _options.compose(
|
||||
_dio.options,
|
||||
_path,
|
||||
),
|
||||
type: DioExceptionType.unknown,
|
||||
error: error,
|
||||
stackTrace: stackTrace,
|
||||
);
|
||||
}
|
||||
|
||||
final _response = await _dio.request<Object>(
|
||||
_path,
|
||||
data: _bodyData,
|
||||
options: _options,
|
||||
cancelToken: cancelToken,
|
||||
onSendProgress: onSendProgress,
|
||||
onReceiveProgress: onReceiveProgress,
|
||||
);
|
||||
|
||||
LinkOut? _responseData;
|
||||
|
||||
try {
|
||||
final rawData = _response.data;
|
||||
_responseData = rawData == null ? null : deserialize<LinkOut, LinkOut>(rawData, 'LinkOut', growable: true);
|
||||
|
||||
} catch (error, stackTrace) {
|
||||
throw DioException(
|
||||
requestOptions: _response.requestOptions,
|
||||
response: _response,
|
||||
type: DioExceptionType.unknown,
|
||||
error: error,
|
||||
stackTrace: stackTrace,
|
||||
);
|
||||
}
|
||||
|
||||
return Response<LinkOut>(
|
||||
data: _responseData,
|
||||
headers: _response.headers,
|
||||
isRedirect: _response.isRedirect,
|
||||
requestOptions: _response.requestOptions,
|
||||
redirects: _response.redirects,
|
||||
statusCode: _response.statusCode,
|
||||
statusMessage: _response.statusMessage,
|
||||
extra: _response.extra,
|
||||
);
|
||||
}
|
||||
|
||||
/// Delete
|
||||
/// Undo a link, manual or automatic. `flow_type` reverts on the next `POST /metrics/refresh`, when `classify` rebuilds it from the rules and `matching` no longer overwrites it.
|
||||
///
|
||||
/// Parameters:
|
||||
/// * [linkId]
|
||||
/// * [cancelToken] - A [CancelToken] that can be used to cancel the operation
|
||||
/// * [headers] - Can be used to add additional headers to the request
|
||||
/// * [extras] - Can be used to add flags to the request
|
||||
/// * [validateStatus] - A [ValidateStatus] callback that can be used to determine request success based on the HTTP status of the response
|
||||
/// * [onSendProgress] - A [ProgressCallback] that can be used to get the send progress
|
||||
/// * [onReceiveProgress] - A [ProgressCallback] that can be used to get the receive progress
|
||||
///
|
||||
/// Returns a [Future]
|
||||
/// Throws [DioException] if API call or serialization fails
|
||||
Future<Response<void>> linksDelete({
|
||||
required int linkId,
|
||||
CancelToken? cancelToken,
|
||||
Map<String, dynamic>? headers,
|
||||
Map<String, dynamic>? extra,
|
||||
ValidateStatus? validateStatus,
|
||||
ProgressCallback? onSendProgress,
|
||||
ProgressCallback? onReceiveProgress,
|
||||
}) async {
|
||||
final _path = r'/api/v1/links/{link_id}'.replaceAll('{' r'link_id' '}', linkId.toString());
|
||||
final _options = Options(
|
||||
method: r'DELETE',
|
||||
headers: <String, dynamic>{
|
||||
...?headers,
|
||||
},
|
||||
extra: <String, dynamic>{
|
||||
'secure': <Map<String, String>>[
|
||||
{
|
||||
'type': 'http',
|
||||
'scheme': 'bearer',
|
||||
'name': 'HTTPBearer',
|
||||
},
|
||||
],
|
||||
...?extra,
|
||||
},
|
||||
validateStatus: validateStatus,
|
||||
);
|
||||
|
||||
final _response = await _dio.request<Object>(
|
||||
_path,
|
||||
options: _options,
|
||||
cancelToken: cancelToken,
|
||||
onSendProgress: onSendProgress,
|
||||
onReceiveProgress: onReceiveProgress,
|
||||
);
|
||||
|
||||
return _response;
|
||||
}
|
||||
|
||||
/// Unmatched
|
||||
/// Every candidate that survives matching without a link, on either side.
|
||||
///
|
||||
/// Parameters:
|
||||
/// * [cancelToken] - A [CancelToken] that can be used to cancel the operation
|
||||
/// * [headers] - Can be used to add additional headers to the request
|
||||
/// * [extras] - Can be used to add flags to the request
|
||||
/// * [validateStatus] - A [ValidateStatus] callback that can be used to determine request success based on the HTTP status of the response
|
||||
/// * [onSendProgress] - A [ProgressCallback] that can be used to get the send progress
|
||||
/// * [onReceiveProgress] - A [ProgressCallback] that can be used to get the receive progress
|
||||
///
|
||||
/// Returns a [Future] containing a [Response] with a [UnmatchedOut] as data
|
||||
/// Throws [DioException] if API call or serialization fails
|
||||
Future<Response<UnmatchedOut>> linksUnmatched({
|
||||
CancelToken? cancelToken,
|
||||
Map<String, dynamic>? headers,
|
||||
Map<String, dynamic>? extra,
|
||||
ValidateStatus? validateStatus,
|
||||
ProgressCallback? onSendProgress,
|
||||
ProgressCallback? onReceiveProgress,
|
||||
}) async {
|
||||
final _path = r'/api/v1/links/unmatched';
|
||||
final _options = Options(
|
||||
method: r'GET',
|
||||
headers: <String, dynamic>{
|
||||
...?headers,
|
||||
},
|
||||
extra: <String, dynamic>{
|
||||
'secure': <Map<String, String>>[
|
||||
{
|
||||
'type': 'http',
|
||||
'scheme': 'bearer',
|
||||
'name': 'HTTPBearer',
|
||||
},
|
||||
],
|
||||
...?extra,
|
||||
},
|
||||
validateStatus: validateStatus,
|
||||
);
|
||||
|
||||
final _response = await _dio.request<Object>(
|
||||
_path,
|
||||
options: _options,
|
||||
cancelToken: cancelToken,
|
||||
onSendProgress: onSendProgress,
|
||||
onReceiveProgress: onReceiveProgress,
|
||||
);
|
||||
|
||||
UnmatchedOut? _responseData;
|
||||
|
||||
try {
|
||||
final rawData = _response.data;
|
||||
_responseData = rawData == null ? null : deserialize<UnmatchedOut, UnmatchedOut>(rawData, 'UnmatchedOut', growable: true);
|
||||
|
||||
} catch (error, stackTrace) {
|
||||
throw DioException(
|
||||
requestOptions: _response.requestOptions,
|
||||
response: _response,
|
||||
type: DioExceptionType.unknown,
|
||||
error: error,
|
||||
stackTrace: stackTrace,
|
||||
);
|
||||
}
|
||||
|
||||
return Response<UnmatchedOut>(
|
||||
data: _responseData,
|
||||
headers: _response.headers,
|
||||
isRedirect: _response.isRedirect,
|
||||
requestOptions: _response.requestOptions,
|
||||
redirects: _response.redirects,
|
||||
statusCode: _response.statusCode,
|
||||
statusMessage: _response.statusMessage,
|
||||
extra: _response.extra,
|
||||
);
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,296 @@
|
||||
//
|
||||
// AUTO-GENERATED FILE, DO NOT MODIFY!
|
||||
//
|
||||
|
||||
import 'dart:async';
|
||||
|
||||
// ignore: unused_import
|
||||
import 'dart:convert';
|
||||
import 'package:fintracker_api/src/deserialize.dart';
|
||||
import 'package:dio/dio.dart';
|
||||
|
||||
import 'package:fintracker_api/src/model/cash_available.dart';
|
||||
import 'package:fintracker_api/src/model/problem.dart';
|
||||
import 'package:fintracker_api/src/model/rebalance_out.dart';
|
||||
import 'package:fintracker_api/src/model/targets_in.dart';
|
||||
import 'package:fintracker_api/src/model/targets_out.dart';
|
||||
|
||||
class RebalanceApi {
|
||||
|
||||
final Dio _dio;
|
||||
|
||||
const RebalanceApi(this._dio);
|
||||
|
||||
/// Rebalance
|
||||
///
|
||||
///
|
||||
/// Parameters:
|
||||
/// * [portfolioId]
|
||||
/// * [dimension] - asset_class | sector | country | currency
|
||||
/// * [cashAvailable] - переопределяет остаток на счетах для what-if
|
||||
/// * [cancelToken] - A [CancelToken] that can be used to cancel the operation
|
||||
/// * [headers] - Can be used to add additional headers to the request
|
||||
/// * [extras] - Can be used to add flags to the request
|
||||
/// * [validateStatus] - A [ValidateStatus] callback that can be used to determine request success based on the HTTP status of the response
|
||||
/// * [onSendProgress] - A [ProgressCallback] that can be used to get the send progress
|
||||
/// * [onReceiveProgress] - A [ProgressCallback] that can be used to get the receive progress
|
||||
///
|
||||
/// Returns a [Future] containing a [Response] with a [RebalanceOut] as data
|
||||
/// Throws [DioException] if API call or serialization fails
|
||||
Future<Response<RebalanceOut>> rebalanceRebalance({
|
||||
required int portfolioId,
|
||||
String? dimension = 'asset_class',
|
||||
CashAvailable? cashAvailable,
|
||||
CancelToken? cancelToken,
|
||||
Map<String, dynamic>? headers,
|
||||
Map<String, dynamic>? extra,
|
||||
ValidateStatus? validateStatus,
|
||||
ProgressCallback? onSendProgress,
|
||||
ProgressCallback? onReceiveProgress,
|
||||
}) async {
|
||||
final _path = r'/api/v1/portfolios/{portfolio_id}/rebalance'.replaceAll('{' r'portfolio_id' '}', portfolioId.toString());
|
||||
final _options = Options(
|
||||
method: r'GET',
|
||||
headers: <String, dynamic>{
|
||||
...?headers,
|
||||
},
|
||||
extra: <String, dynamic>{
|
||||
'secure': <Map<String, String>>[
|
||||
{
|
||||
'type': 'http',
|
||||
'scheme': 'bearer',
|
||||
'name': 'HTTPBearer',
|
||||
},
|
||||
],
|
||||
...?extra,
|
||||
},
|
||||
validateStatus: validateStatus,
|
||||
);
|
||||
|
||||
final _queryParameters = <String, dynamic>{
|
||||
if (dimension != null) r'dimension': dimension,
|
||||
if (cashAvailable != null) r'cash_available': cashAvailable,
|
||||
};
|
||||
|
||||
final _response = await _dio.request<Object>(
|
||||
_path,
|
||||
options: _options,
|
||||
queryParameters: _queryParameters,
|
||||
cancelToken: cancelToken,
|
||||
onSendProgress: onSendProgress,
|
||||
onReceiveProgress: onReceiveProgress,
|
||||
);
|
||||
|
||||
RebalanceOut? _responseData;
|
||||
|
||||
try {
|
||||
final rawData = _response.data;
|
||||
_responseData = rawData == null ? null : deserialize<RebalanceOut, RebalanceOut>(rawData, 'RebalanceOut', growable: true);
|
||||
|
||||
} catch (error, stackTrace) {
|
||||
throw DioException(
|
||||
requestOptions: _response.requestOptions,
|
||||
response: _response,
|
||||
type: DioExceptionType.unknown,
|
||||
error: error,
|
||||
stackTrace: stackTrace,
|
||||
);
|
||||
}
|
||||
|
||||
return Response<RebalanceOut>(
|
||||
data: _responseData,
|
||||
headers: _response.headers,
|
||||
isRedirect: _response.isRedirect,
|
||||
requestOptions: _response.requestOptions,
|
||||
redirects: _response.redirects,
|
||||
statusCode: _response.statusCode,
|
||||
statusMessage: _response.statusMessage,
|
||||
extra: _response.extra,
|
||||
);
|
||||
}
|
||||
|
||||
/// Set Targets
|
||||
/// Replace the whole set for one dimension. The weights must add up to 1 within `WEIGHT_TOLERANCE`; otherwise the request is refused with the actual sum in the message, so the user can see by how much the plan misses rather than being handed a silently rescaled one.
|
||||
///
|
||||
/// Parameters:
|
||||
/// * [portfolioId]
|
||||
/// * [targetsIn]
|
||||
/// * [cancelToken] - A [CancelToken] that can be used to cancel the operation
|
||||
/// * [headers] - Can be used to add additional headers to the request
|
||||
/// * [extras] - Can be used to add flags to the request
|
||||
/// * [validateStatus] - A [ValidateStatus] callback that can be used to determine request success based on the HTTP status of the response
|
||||
/// * [onSendProgress] - A [ProgressCallback] that can be used to get the send progress
|
||||
/// * [onReceiveProgress] - A [ProgressCallback] that can be used to get the receive progress
|
||||
///
|
||||
/// Returns a [Future] containing a [Response] with a [TargetsOut] as data
|
||||
/// Throws [DioException] if API call or serialization fails
|
||||
Future<Response<TargetsOut>> rebalanceSetTargets({
|
||||
required int portfolioId,
|
||||
required TargetsIn targetsIn,
|
||||
CancelToken? cancelToken,
|
||||
Map<String, dynamic>? headers,
|
||||
Map<String, dynamic>? extra,
|
||||
ValidateStatus? validateStatus,
|
||||
ProgressCallback? onSendProgress,
|
||||
ProgressCallback? onReceiveProgress,
|
||||
}) async {
|
||||
final _path = r'/api/v1/portfolios/{portfolio_id}/targets'.replaceAll('{' r'portfolio_id' '}', portfolioId.toString());
|
||||
final _options = Options(
|
||||
method: r'PUT',
|
||||
headers: <String, dynamic>{
|
||||
...?headers,
|
||||
},
|
||||
extra: <String, dynamic>{
|
||||
'secure': <Map<String, String>>[
|
||||
{
|
||||
'type': 'http',
|
||||
'scheme': 'bearer',
|
||||
'name': 'HTTPBearer',
|
||||
},
|
||||
],
|
||||
...?extra,
|
||||
},
|
||||
contentType: 'application/json',
|
||||
validateStatus: validateStatus,
|
||||
);
|
||||
|
||||
dynamic _bodyData;
|
||||
|
||||
try {
|
||||
_bodyData = jsonEncode(targetsIn);
|
||||
|
||||
} catch(error, stackTrace) {
|
||||
throw DioException(
|
||||
requestOptions: _options.compose(
|
||||
_dio.options,
|
||||
_path,
|
||||
),
|
||||
type: DioExceptionType.unknown,
|
||||
error: error,
|
||||
stackTrace: stackTrace,
|
||||
);
|
||||
}
|
||||
|
||||
final _response = await _dio.request<Object>(
|
||||
_path,
|
||||
data: _bodyData,
|
||||
options: _options,
|
||||
cancelToken: cancelToken,
|
||||
onSendProgress: onSendProgress,
|
||||
onReceiveProgress: onReceiveProgress,
|
||||
);
|
||||
|
||||
TargetsOut? _responseData;
|
||||
|
||||
try {
|
||||
final rawData = _response.data;
|
||||
_responseData = rawData == null ? null : deserialize<TargetsOut, TargetsOut>(rawData, 'TargetsOut', growable: true);
|
||||
|
||||
} catch (error, stackTrace) {
|
||||
throw DioException(
|
||||
requestOptions: _response.requestOptions,
|
||||
response: _response,
|
||||
type: DioExceptionType.unknown,
|
||||
error: error,
|
||||
stackTrace: stackTrace,
|
||||
);
|
||||
}
|
||||
|
||||
return Response<TargetsOut>(
|
||||
data: _responseData,
|
||||
headers: _response.headers,
|
||||
isRedirect: _response.isRedirect,
|
||||
requestOptions: _response.requestOptions,
|
||||
redirects: _response.redirects,
|
||||
statusCode: _response.statusCode,
|
||||
statusMessage: _response.statusMessage,
|
||||
extra: _response.extra,
|
||||
);
|
||||
}
|
||||
|
||||
/// Targets
|
||||
///
|
||||
///
|
||||
/// Parameters:
|
||||
/// * [portfolioId]
|
||||
/// * [dimension] - asset_class | sector | country | currency
|
||||
/// * [cancelToken] - A [CancelToken] that can be used to cancel the operation
|
||||
/// * [headers] - Can be used to add additional headers to the request
|
||||
/// * [extras] - Can be used to add flags to the request
|
||||
/// * [validateStatus] - A [ValidateStatus] callback that can be used to determine request success based on the HTTP status of the response
|
||||
/// * [onSendProgress] - A [ProgressCallback] that can be used to get the send progress
|
||||
/// * [onReceiveProgress] - A [ProgressCallback] that can be used to get the receive progress
|
||||
///
|
||||
/// Returns a [Future] containing a [Response] with a [TargetsOut] as data
|
||||
/// Throws [DioException] if API call or serialization fails
|
||||
Future<Response<TargetsOut>> rebalanceTargets({
|
||||
required int portfolioId,
|
||||
String? dimension = 'asset_class',
|
||||
CancelToken? cancelToken,
|
||||
Map<String, dynamic>? headers,
|
||||
Map<String, dynamic>? extra,
|
||||
ValidateStatus? validateStatus,
|
||||
ProgressCallback? onSendProgress,
|
||||
ProgressCallback? onReceiveProgress,
|
||||
}) async {
|
||||
final _path = r'/api/v1/portfolios/{portfolio_id}/targets'.replaceAll('{' r'portfolio_id' '}', portfolioId.toString());
|
||||
final _options = Options(
|
||||
method: r'GET',
|
||||
headers: <String, dynamic>{
|
||||
...?headers,
|
||||
},
|
||||
extra: <String, dynamic>{
|
||||
'secure': <Map<String, String>>[
|
||||
{
|
||||
'type': 'http',
|
||||
'scheme': 'bearer',
|
||||
'name': 'HTTPBearer',
|
||||
},
|
||||
],
|
||||
...?extra,
|
||||
},
|
||||
validateStatus: validateStatus,
|
||||
);
|
||||
|
||||
final _queryParameters = <String, dynamic>{
|
||||
if (dimension != null) r'dimension': dimension,
|
||||
};
|
||||
|
||||
final _response = await _dio.request<Object>(
|
||||
_path,
|
||||
options: _options,
|
||||
queryParameters: _queryParameters,
|
||||
cancelToken: cancelToken,
|
||||
onSendProgress: onSendProgress,
|
||||
onReceiveProgress: onReceiveProgress,
|
||||
);
|
||||
|
||||
TargetsOut? _responseData;
|
||||
|
||||
try {
|
||||
final rawData = _response.data;
|
||||
_responseData = rawData == null ? null : deserialize<TargetsOut, TargetsOut>(rawData, 'TargetsOut', growable: true);
|
||||
|
||||
} catch (error, stackTrace) {
|
||||
throw DioException(
|
||||
requestOptions: _response.requestOptions,
|
||||
response: _response,
|
||||
type: DioExceptionType.unknown,
|
||||
error: error,
|
||||
stackTrace: stackTrace,
|
||||
);
|
||||
}
|
||||
|
||||
return Response<TargetsOut>(
|
||||
data: _responseData,
|
||||
headers: _response.headers,
|
||||
isRedirect: _response.isRedirect,
|
||||
requestOptions: _response.requestOptions,
|
||||
redirects: _response.redirects,
|
||||
statusCode: _response.statusCode,
|
||||
statusMessage: _response.statusMessage,
|
||||
extra: _response.extra,
|
||||
);
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,194 @@
|
||||
//
|
||||
// AUTO-GENERATED FILE, DO NOT MODIFY!
|
||||
//
|
||||
|
||||
import 'dart:async';
|
||||
|
||||
// ignore: unused_import
|
||||
import 'dart:convert';
|
||||
import 'package:fintracker_api/src/deserialize.dart';
|
||||
import 'package:dio/dio.dart';
|
||||
|
||||
import 'package:fintracker_api/src/model/problem.dart';
|
||||
import 'package:fintracker_api/src/model/tax_lots_out.dart';
|
||||
import 'package:fintracker_api/src/model/tax_year_out.dart';
|
||||
|
||||
class TaxApi {
|
||||
|
||||
final Dio _dio;
|
||||
|
||||
const TaxApi(this._dio);
|
||||
|
||||
/// Lots
|
||||
/// Open lots with the date after which a sale falls under the long-term exemption. `year` selects the rate the \"what if I sold today\" figure is computed at; the lots themselves are always the ones open right now. `lot` is rebuilt from the ledger on every refresh and holds today's state only, so there is no honest way to answer \"which lots were open on 31 December two years ago\" — and inventing one would be worse than the limitation.
|
||||
///
|
||||
/// Parameters:
|
||||
/// * [year]
|
||||
/// * [accountId]
|
||||
/// * [cancelToken] - A [CancelToken] that can be used to cancel the operation
|
||||
/// * [headers] - Can be used to add additional headers to the request
|
||||
/// * [extras] - Can be used to add flags to the request
|
||||
/// * [validateStatus] - A [ValidateStatus] callback that can be used to determine request success based on the HTTP status of the response
|
||||
/// * [onSendProgress] - A [ProgressCallback] that can be used to get the send progress
|
||||
/// * [onReceiveProgress] - A [ProgressCallback] that can be used to get the receive progress
|
||||
///
|
||||
/// Returns a [Future] containing a [Response] with a [TaxLotsOut] as data
|
||||
/// Throws [DioException] if API call or serialization fails
|
||||
Future<Response<TaxLotsOut>> taxLots({
|
||||
int? year,
|
||||
int? accountId,
|
||||
CancelToken? cancelToken,
|
||||
Map<String, dynamic>? headers,
|
||||
Map<String, dynamic>? extra,
|
||||
ValidateStatus? validateStatus,
|
||||
ProgressCallback? onSendProgress,
|
||||
ProgressCallback? onReceiveProgress,
|
||||
}) async {
|
||||
final _path = r'/api/v1/tax/lots';
|
||||
final _options = Options(
|
||||
method: r'GET',
|
||||
headers: <String, dynamic>{
|
||||
...?headers,
|
||||
},
|
||||
extra: <String, dynamic>{
|
||||
'secure': <Map<String, String>>[
|
||||
{
|
||||
'type': 'http',
|
||||
'scheme': 'bearer',
|
||||
'name': 'HTTPBearer',
|
||||
},
|
||||
],
|
||||
...?extra,
|
||||
},
|
||||
validateStatus: validateStatus,
|
||||
);
|
||||
|
||||
final _queryParameters = <String, dynamic>{
|
||||
if (year != null) r'year': year,
|
||||
if (accountId != null) r'account_id': accountId,
|
||||
};
|
||||
|
||||
final _response = await _dio.request<Object>(
|
||||
_path,
|
||||
options: _options,
|
||||
queryParameters: _queryParameters,
|
||||
cancelToken: cancelToken,
|
||||
onSendProgress: onSendProgress,
|
||||
onReceiveProgress: onReceiveProgress,
|
||||
);
|
||||
|
||||
TaxLotsOut? _responseData;
|
||||
|
||||
try {
|
||||
final rawData = _response.data;
|
||||
_responseData = rawData == null ? null : deserialize<TaxLotsOut, TaxLotsOut>(rawData, 'TaxLotsOut', growable: true);
|
||||
|
||||
} catch (error, stackTrace) {
|
||||
throw DioException(
|
||||
requestOptions: _response.requestOptions,
|
||||
response: _response,
|
||||
type: DioExceptionType.unknown,
|
||||
error: error,
|
||||
stackTrace: stackTrace,
|
||||
);
|
||||
}
|
||||
|
||||
return Response<TaxLotsOut>(
|
||||
data: _responseData,
|
||||
headers: _response.headers,
|
||||
isRedirect: _response.isRedirect,
|
||||
requestOptions: _response.requestOptions,
|
||||
redirects: _response.redirects,
|
||||
statusCode: _response.statusCode,
|
||||
statusMessage: _response.statusMessage,
|
||||
extra: _response.extra,
|
||||
);
|
||||
}
|
||||
|
||||
/// Summary
|
||||
/// The year's estimated tax position, per account and in total.
|
||||
///
|
||||
/// Parameters:
|
||||
/// * [year]
|
||||
/// * [accountId]
|
||||
/// * [cancelToken] - A [CancelToken] that can be used to cancel the operation
|
||||
/// * [headers] - Can be used to add additional headers to the request
|
||||
/// * [extras] - Can be used to add flags to the request
|
||||
/// * [validateStatus] - A [ValidateStatus] callback that can be used to determine request success based on the HTTP status of the response
|
||||
/// * [onSendProgress] - A [ProgressCallback] that can be used to get the send progress
|
||||
/// * [onReceiveProgress] - A [ProgressCallback] that can be used to get the receive progress
|
||||
///
|
||||
/// Returns a [Future] containing a [Response] with a [TaxYearOut] as data
|
||||
/// Throws [DioException] if API call or serialization fails
|
||||
Future<Response<TaxYearOut>> taxSummary({
|
||||
int? year,
|
||||
int? accountId,
|
||||
CancelToken? cancelToken,
|
||||
Map<String, dynamic>? headers,
|
||||
Map<String, dynamic>? extra,
|
||||
ValidateStatus? validateStatus,
|
||||
ProgressCallback? onSendProgress,
|
||||
ProgressCallback? onReceiveProgress,
|
||||
}) async {
|
||||
final _path = r'/api/v1/tax';
|
||||
final _options = Options(
|
||||
method: r'GET',
|
||||
headers: <String, dynamic>{
|
||||
...?headers,
|
||||
},
|
||||
extra: <String, dynamic>{
|
||||
'secure': <Map<String, String>>[
|
||||
{
|
||||
'type': 'http',
|
||||
'scheme': 'bearer',
|
||||
'name': 'HTTPBearer',
|
||||
},
|
||||
],
|
||||
...?extra,
|
||||
},
|
||||
validateStatus: validateStatus,
|
||||
);
|
||||
|
||||
final _queryParameters = <String, dynamic>{
|
||||
if (year != null) r'year': year,
|
||||
if (accountId != null) r'account_id': accountId,
|
||||
};
|
||||
|
||||
final _response = await _dio.request<Object>(
|
||||
_path,
|
||||
options: _options,
|
||||
queryParameters: _queryParameters,
|
||||
cancelToken: cancelToken,
|
||||
onSendProgress: onSendProgress,
|
||||
onReceiveProgress: onReceiveProgress,
|
||||
);
|
||||
|
||||
TaxYearOut? _responseData;
|
||||
|
||||
try {
|
||||
final rawData = _response.data;
|
||||
_responseData = rawData == null ? null : deserialize<TaxYearOut, TaxYearOut>(rawData, 'TaxYearOut', growable: true);
|
||||
|
||||
} catch (error, stackTrace) {
|
||||
throw DioException(
|
||||
requestOptions: _response.requestOptions,
|
||||
response: _response,
|
||||
type: DioExceptionType.unknown,
|
||||
error: error,
|
||||
stackTrace: stackTrace,
|
||||
);
|
||||
}
|
||||
|
||||
return Response<TaxYearOut>(
|
||||
data: _responseData,
|
||||
headers: _response.headers,
|
||||
isRedirect: _response.isRedirect,
|
||||
requestOptions: _response.requestOptions,
|
||||
redirects: _response.redirects,
|
||||
statusCode: _response.statusCode,
|
||||
statusMessage: _response.statusMessage,
|
||||
extra: _response.extra,
|
||||
);
|
||||
}
|
||||
|
||||
}
|
||||
@@ -1,22 +1,60 @@
|
||||
import 'package:fintracker_api/src/model/account_balance.dart';
|
||||
import 'package:fintracker_api/src/model/account_out.dart';
|
||||
import 'package:fintracker_api/src/model/account_patch.dart';
|
||||
import 'package:fintracker_api/src/model/account_suggestion.dart';
|
||||
import 'package:fintracker_api/src/model/allocation_bucket.dart';
|
||||
import 'package:fintracker_api/src/model/benchmark_comparison.dart';
|
||||
import 'package:fintracker_api/src/model/benchmark_comparison_out.dart';
|
||||
import 'package:fintracker_api/src/model/benchmark_create.dart';
|
||||
import 'package:fintracker_api/src/model/benchmark_out.dart';
|
||||
import 'package:fintracker_api/src/model/benchmark_patch.dart';
|
||||
import 'package:fintracker_api/src/model/benchmark_return_out.dart';
|
||||
import 'package:fintracker_api/src/model/calendar_entry.dart';
|
||||
import 'package:fintracker_api/src/model/calendar_out.dart';
|
||||
import 'package:fintracker_api/src/model/cash_available.dart';
|
||||
import 'package:fintracker_api/src/model/cash_flow_broker_month.dart';
|
||||
import 'package:fintracker_api/src/model/cash_flow_month.dart';
|
||||
import 'package:fintracker_api/src/model/category_out.dart';
|
||||
import 'package:fintracker_api/src/model/commit_request.dart';
|
||||
import 'package:fintracker_api/src/model/data_quality_row.dart';
|
||||
import 'package:fintracker_api/src/model/event_out.dart';
|
||||
import 'package:fintracker_api/src/model/event_page.dart';
|
||||
import 'package:fintracker_api/src/model/forecast_month.dart';
|
||||
import 'package:fintracker_api/src/model/forecast_out.dart';
|
||||
import 'package:fintracker_api/src/model/goal_create.dart';
|
||||
import 'package:fintracker_api/src/model/goal_out.dart';
|
||||
import 'package:fintracker_api/src/model/goal_patch.dart';
|
||||
import 'package:fintracker_api/src/model/goal_progress_out.dart';
|
||||
import 'package:fintracker_api/src/model/health.dart';
|
||||
import 'package:fintracker_api/src/model/history_out.dart';
|
||||
import 'package:fintracker_api/src/model/history_row.dart';
|
||||
import 'package:fintracker_api/src/model/history_totals.dart';
|
||||
import 'package:fintracker_api/src/model/holding_out.dart';
|
||||
import 'package:fintracker_api/src/model/import_counts.dart';
|
||||
import 'package:fintracker_api/src/model/import_preview.dart';
|
||||
import 'package:fintracker_api/src/model/import_result.dart';
|
||||
import 'package:fintracker_api/src/model/import_summary.dart';
|
||||
import 'package:fintracker_api/src/model/instrument_detail.dart';
|
||||
import 'package:fintracker_api/src/model/instrument_out.dart';
|
||||
import 'package:fintracker_api/src/model/link_create.dart';
|
||||
import 'package:fintracker_api/src/model/link_out.dart';
|
||||
import 'package:fintracker_api/src/model/login_request.dart';
|
||||
import 'package:fintracker_api/src/model/lot_out.dart';
|
||||
import 'package:fintracker_api/src/model/net_worth_breakdown.dart';
|
||||
import 'package:fintracker_api/src/model/net_worth_day.dart';
|
||||
import 'package:fintracker_api/src/model/new_instrument.dart';
|
||||
import 'package:fintracker_api/src/model/pending_instrument_out.dart';
|
||||
import 'package:fintracker_api/src/model/pending_resolve_request.dart';
|
||||
import 'package:fintracker_api/src/model/pending_resolve_result.dart';
|
||||
import 'package:fintracker_api/src/model/price_manual_in.dart';
|
||||
import 'package:fintracker_api/src/model/price_manual_out.dart';
|
||||
import 'package:fintracker_api/src/model/price_point.dart';
|
||||
import 'package:fintracker_api/src/model/problem.dart';
|
||||
import 'package:fintracker_api/src/model/rebalance_bucket_out.dart';
|
||||
import 'package:fintracker_api/src/model/rebalance_out.dart';
|
||||
import 'package:fintracker_api/src/model/reconciliation_cash.dart';
|
||||
import 'package:fintracker_api/src/model/reconciliation_out.dart';
|
||||
import 'package:fintracker_api/src/model/reconciliation_position.dart';
|
||||
import 'package:fintracker_api/src/model/refresh_log_out.dart';
|
||||
import 'package:fintracker_api/src/model/refresh_request.dart';
|
||||
import 'package:fintracker_api/src/model/returns_out.dart';
|
||||
@@ -24,15 +62,29 @@ import 'package:fintracker_api/src/model/rule_create.dart';
|
||||
import 'package:fintracker_api/src/model/rule_out.dart';
|
||||
import 'package:fintracker_api/src/model/rule_patch.dart';
|
||||
import 'package:fintracker_api/src/model/runway_out.dart';
|
||||
import 'package:fintracker_api/src/model/sample_event_out.dart';
|
||||
import 'package:fintracker_api/src/model/scope_out.dart';
|
||||
import 'package:fintracker_api/src/model/source_status.dart';
|
||||
import 'package:fintracker_api/src/model/spending_row.dart';
|
||||
import 'package:fintracker_api/src/model/summary_out.dart';
|
||||
import 'package:fintracker_api/src/model/sync_job_out.dart';
|
||||
import 'package:fintracker_api/src/model/sync_run_out.dart';
|
||||
import 'package:fintracker_api/src/model/target_in.dart';
|
||||
import 'package:fintracker_api/src/model/target_out.dart';
|
||||
import 'package:fintracker_api/src/model/targets_in.dart';
|
||||
import 'package:fintracker_api/src/model/targets_out.dart';
|
||||
import 'package:fintracker_api/src/model/tax_account_out.dart';
|
||||
import 'package:fintracker_api/src/model/tax_lot_out.dart';
|
||||
import 'package:fintracker_api/src/model/tax_lots_out.dart';
|
||||
import 'package:fintracker_api/src/model/tax_totals.dart';
|
||||
import 'package:fintracker_api/src/model/tax_year_out.dart';
|
||||
import 'package:fintracker_api/src/model/token_pair.dart';
|
||||
import 'package:fintracker_api/src/model/trade_out.dart';
|
||||
import 'package:fintracker_api/src/model/transaction_out.dart';
|
||||
import 'package:fintracker_api/src/model/transaction_page.dart';
|
||||
import 'package:fintracker_api/src/model/unmatched_broker_out.dart';
|
||||
import 'package:fintracker_api/src/model/unmatched_out.dart';
|
||||
import 'package:fintracker_api/src/model/unmatched_zm_out.dart';
|
||||
import 'package:fintracker_api/src/model/user_out.dart';
|
||||
import 'package:fintracker_api/src/model/value_day.dart';
|
||||
|
||||
@@ -66,18 +118,42 @@ final _regMap = RegExp(r'^Map<String,(.*)>$');
|
||||
case 'AccountRole':
|
||||
|
||||
|
||||
case 'AccountSuggestion':
|
||||
return AccountSuggestion.fromJson(value as Map<String, dynamic>) as ReturnType;
|
||||
case 'AllocationBucket':
|
||||
return AllocationBucket.fromJson(value as Map<String, dynamic>) as ReturnType;
|
||||
case 'AllocationDimension':
|
||||
|
||||
|
||||
case 'BenchmarkComparison':
|
||||
return BenchmarkComparison.fromJson(value as Map<String, dynamic>) as ReturnType;
|
||||
case 'BenchmarkComparisonOut':
|
||||
return BenchmarkComparisonOut.fromJson(value as Map<String, dynamic>) as ReturnType;
|
||||
case 'BenchmarkCreate':
|
||||
return BenchmarkCreate.fromJson(value as Map<String, dynamic>) as ReturnType;
|
||||
case 'BenchmarkOut':
|
||||
return BenchmarkOut.fromJson(value as Map<String, dynamic>) as ReturnType;
|
||||
case 'BenchmarkPatch':
|
||||
return BenchmarkPatch.fromJson(value as Map<String, dynamic>) as ReturnType;
|
||||
case 'BenchmarkReturnOut':
|
||||
return BenchmarkReturnOut.fromJson(value as Map<String, dynamic>) as ReturnType;
|
||||
case 'Broker':
|
||||
|
||||
|
||||
case 'CalendarEntry':
|
||||
return CalendarEntry.fromJson(value as Map<String, dynamic>) as ReturnType;
|
||||
case 'CalendarOut':
|
||||
return CalendarOut.fromJson(value as Map<String, dynamic>) as ReturnType;
|
||||
case 'CashAvailable':
|
||||
return CashAvailable.fromJson(value as Map<String, dynamic>) as ReturnType;
|
||||
case 'CashFlowBrokerMonth':
|
||||
return CashFlowBrokerMonth.fromJson(value as Map<String, dynamic>) as ReturnType;
|
||||
case 'CashFlowMonth':
|
||||
return CashFlowMonth.fromJson(value as Map<String, dynamic>) as ReturnType;
|
||||
case 'CategoryOut':
|
||||
return CategoryOut.fromJson(value as Map<String, dynamic>) as ReturnType;
|
||||
case 'CommitRequest':
|
||||
return CommitRequest.fromJson(value as Map<String, dynamic>) as ReturnType;
|
||||
case 'DataQualityRow':
|
||||
return DataQualityRow.fromJson(value as Map<String, dynamic>) as ReturnType;
|
||||
case 'EventKind':
|
||||
@@ -96,10 +172,36 @@ final _regMap = RegExp(r'^Map<String,(.*)>$');
|
||||
case 'FlowType':
|
||||
|
||||
|
||||
case 'ForecastMonth':
|
||||
return ForecastMonth.fromJson(value as Map<String, dynamic>) as ReturnType;
|
||||
case 'ForecastOut':
|
||||
return ForecastOut.fromJson(value as Map<String, dynamic>) as ReturnType;
|
||||
case 'GoalCreate':
|
||||
return GoalCreate.fromJson(value as Map<String, dynamic>) as ReturnType;
|
||||
case 'GoalOut':
|
||||
return GoalOut.fromJson(value as Map<String, dynamic>) as ReturnType;
|
||||
case 'GoalPatch':
|
||||
return GoalPatch.fromJson(value as Map<String, dynamic>) as ReturnType;
|
||||
case 'GoalProgressOut':
|
||||
return GoalProgressOut.fromJson(value as Map<String, dynamic>) as ReturnType;
|
||||
case 'Health':
|
||||
return Health.fromJson(value as Map<String, dynamic>) as ReturnType;
|
||||
case 'HistoryOut':
|
||||
return HistoryOut.fromJson(value as Map<String, dynamic>) as ReturnType;
|
||||
case 'HistoryRow':
|
||||
return HistoryRow.fromJson(value as Map<String, dynamic>) as ReturnType;
|
||||
case 'HistoryTotals':
|
||||
return HistoryTotals.fromJson(value as Map<String, dynamic>) as ReturnType;
|
||||
case 'HoldingOut':
|
||||
return HoldingOut.fromJson(value as Map<String, dynamic>) as ReturnType;
|
||||
case 'ImportCounts':
|
||||
return ImportCounts.fromJson(value as Map<String, dynamic>) as ReturnType;
|
||||
case 'ImportPreview':
|
||||
return ImportPreview.fromJson(value as Map<String, dynamic>) as ReturnType;
|
||||
case 'ImportResult':
|
||||
return ImportResult.fromJson(value as Map<String, dynamic>) as ReturnType;
|
||||
case 'ImportSummary':
|
||||
return ImportSummary.fromJson(value as Map<String, dynamic>) as ReturnType;
|
||||
case 'InstrumentDetail':
|
||||
return InstrumentDetail.fromJson(value as Map<String, dynamic>) as ReturnType;
|
||||
case 'InstrumentOut':
|
||||
@@ -107,6 +209,10 @@ final _regMap = RegExp(r'^Map<String,(.*)>$');
|
||||
case 'JobStatus':
|
||||
|
||||
|
||||
case 'LinkCreate':
|
||||
return LinkCreate.fromJson(value as Map<String, dynamic>) as ReturnType;
|
||||
case 'LinkOut':
|
||||
return LinkOut.fromJson(value as Map<String, dynamic>) as ReturnType;
|
||||
case 'LoginRequest':
|
||||
return LoginRequest.fromJson(value as Map<String, dynamic>) as ReturnType;
|
||||
case 'LotOut':
|
||||
@@ -115,10 +221,32 @@ final _regMap = RegExp(r'^Map<String,(.*)>$');
|
||||
return NetWorthBreakdown.fromJson(value as Map<String, dynamic>) as ReturnType;
|
||||
case 'NetWorthDay':
|
||||
return NetWorthDay.fromJson(value as Map<String, dynamic>) as ReturnType;
|
||||
case 'NewInstrument':
|
||||
return NewInstrument.fromJson(value as Map<String, dynamic>) as ReturnType;
|
||||
case 'PendingInstrumentOut':
|
||||
return PendingInstrumentOut.fromJson(value as Map<String, dynamic>) as ReturnType;
|
||||
case 'PendingResolveRequest':
|
||||
return PendingResolveRequest.fromJson(value as Map<String, dynamic>) as ReturnType;
|
||||
case 'PendingResolveResult':
|
||||
return PendingResolveResult.fromJson(value as Map<String, dynamic>) as ReturnType;
|
||||
case 'PriceManualIn':
|
||||
return PriceManualIn.fromJson(value as Map<String, dynamic>) as ReturnType;
|
||||
case 'PriceManualOut':
|
||||
return PriceManualOut.fromJson(value as Map<String, dynamic>) as ReturnType;
|
||||
case 'PricePoint':
|
||||
return PricePoint.fromJson(value as Map<String, dynamic>) as ReturnType;
|
||||
case 'Problem':
|
||||
return Problem.fromJson(value as Map<String, dynamic>) as ReturnType;
|
||||
case 'RebalanceBucketOut':
|
||||
return RebalanceBucketOut.fromJson(value as Map<String, dynamic>) as ReturnType;
|
||||
case 'RebalanceOut':
|
||||
return RebalanceOut.fromJson(value as Map<String, dynamic>) as ReturnType;
|
||||
case 'ReconciliationCash':
|
||||
return ReconciliationCash.fromJson(value as Map<String, dynamic>) as ReturnType;
|
||||
case 'ReconciliationOut':
|
||||
return ReconciliationOut.fromJson(value as Map<String, dynamic>) as ReturnType;
|
||||
case 'ReconciliationPosition':
|
||||
return ReconciliationPosition.fromJson(value as Map<String, dynamic>) as ReturnType;
|
||||
case 'RefreshLogOut':
|
||||
return RefreshLogOut.fromJson(value as Map<String, dynamic>) as ReturnType;
|
||||
case 'RefreshRequest':
|
||||
@@ -142,6 +270,8 @@ final _regMap = RegExp(r'^Map<String,(.*)>$');
|
||||
|
||||
case 'RunwayOut':
|
||||
return RunwayOut.fromJson(value as Map<String, dynamic>) as ReturnType;
|
||||
case 'SampleEventOut':
|
||||
return SampleEventOut.fromJson(value as Map<String, dynamic>) as ReturnType;
|
||||
case 'ScopeOut':
|
||||
return ScopeOut.fromJson(value as Map<String, dynamic>) as ReturnType;
|
||||
case 'SourceStatus':
|
||||
@@ -154,12 +284,38 @@ final _regMap = RegExp(r'^Map<String,(.*)>$');
|
||||
return SyncJobOut.fromJson(value as Map<String, dynamic>) as ReturnType;
|
||||
case 'SyncRunOut':
|
||||
return SyncRunOut.fromJson(value as Map<String, dynamic>) as ReturnType;
|
||||
case 'TargetIn':
|
||||
return TargetIn.fromJson(value as Map<String, dynamic>) as ReturnType;
|
||||
case 'TargetOut':
|
||||
return TargetOut.fromJson(value as Map<String, dynamic>) as ReturnType;
|
||||
case 'TargetsIn':
|
||||
return TargetsIn.fromJson(value as Map<String, dynamic>) as ReturnType;
|
||||
case 'TargetsOut':
|
||||
return TargetsOut.fromJson(value as Map<String, dynamic>) as ReturnType;
|
||||
case 'TaxAccountOut':
|
||||
return TaxAccountOut.fromJson(value as Map<String, dynamic>) as ReturnType;
|
||||
case 'TaxLotOut':
|
||||
return TaxLotOut.fromJson(value as Map<String, dynamic>) as ReturnType;
|
||||
case 'TaxLotsOut':
|
||||
return TaxLotsOut.fromJson(value as Map<String, dynamic>) as ReturnType;
|
||||
case 'TaxTotals':
|
||||
return TaxTotals.fromJson(value as Map<String, dynamic>) as ReturnType;
|
||||
case 'TaxYearOut':
|
||||
return TaxYearOut.fromJson(value as Map<String, dynamic>) as ReturnType;
|
||||
case 'TokenPair':
|
||||
return TokenPair.fromJson(value as Map<String, dynamic>) as ReturnType;
|
||||
case 'TradeOut':
|
||||
return TradeOut.fromJson(value as Map<String, dynamic>) as ReturnType;
|
||||
case 'TransactionOut':
|
||||
return TransactionOut.fromJson(value as Map<String, dynamic>) as ReturnType;
|
||||
case 'TransactionPage':
|
||||
return TransactionPage.fromJson(value as Map<String, dynamic>) as ReturnType;
|
||||
case 'UnmatchedBrokerOut':
|
||||
return UnmatchedBrokerOut.fromJson(value as Map<String, dynamic>) as ReturnType;
|
||||
case 'UnmatchedOut':
|
||||
return UnmatchedOut.fromJson(value as Map<String, dynamic>) as ReturnType;
|
||||
case 'UnmatchedZmOut':
|
||||
return UnmatchedZmOut.fromJson(value as Map<String, dynamic>) as ReturnType;
|
||||
case 'UserOut':
|
||||
return UserOut.fromJson(value as Map<String, dynamic>) as ReturnType;
|
||||
case 'ValueDay':
|
||||
|
||||
@@ -385,6 +385,7 @@ const _$EventSourceEnumMap = {
|
||||
EventSource.tinvestApi: 'tinvest_api',
|
||||
EventSource.reportSber: 'report_sber',
|
||||
EventSource.reportVtb: 'report_vtb',
|
||||
EventSource.csv: 'csv',
|
||||
EventSource.manual: 'manual',
|
||||
EventSource.unknownDefaultOpenApi: 'unknown_default_open_api',
|
||||
};
|
||||
|
||||
@@ -160,6 +160,7 @@ const _$EventSourceEnumMap = {
|
||||
EventSource.tinvestApi: 'tinvest_api',
|
||||
EventSource.reportSber: 'report_sber',
|
||||
EventSource.reportVtb: 'report_vtb',
|
||||
EventSource.csv: 'csv',
|
||||
EventSource.manual: 'manual',
|
||||
EventSource.unknownDefaultOpenApi: 'unknown_default_open_api',
|
||||
};
|
||||
|
||||
@@ -0,0 +1,106 @@
|
||||
//
|
||||
// AUTO-GENERATED FILE, DO NOT MODIFY!
|
||||
//
|
||||
|
||||
// ignore_for_file: unused_element
|
||||
import 'package:copy_with_extension/copy_with_extension.dart';
|
||||
import 'package:json_annotation/json_annotation.dart';
|
||||
|
||||
part 'account_suggestion.g.dart';
|
||||
|
||||
|
||||
@CopyWith()
|
||||
@JsonSerializable(
|
||||
checked: true,
|
||||
createToJson: true,
|
||||
disallowUnrecognizedKeys: false,
|
||||
explicitToJson: true,
|
||||
)
|
||||
class AccountSuggestion {
|
||||
/// Returns a new [AccountSuggestion] instance.
|
||||
AccountSuggestion({
|
||||
|
||||
required this.broker,
|
||||
|
||||
required this.id,
|
||||
|
||||
required this.name,
|
||||
|
||||
required this.sourceId,
|
||||
});
|
||||
|
||||
@JsonKey(
|
||||
|
||||
name: r'broker',
|
||||
required: true,
|
||||
includeIfNull: true,
|
||||
)
|
||||
|
||||
|
||||
final String? broker;
|
||||
|
||||
|
||||
|
||||
@JsonKey(
|
||||
|
||||
name: r'id',
|
||||
required: true,
|
||||
includeIfNull: false,
|
||||
)
|
||||
|
||||
|
||||
final int id;
|
||||
|
||||
|
||||
|
||||
@JsonKey(
|
||||
|
||||
name: r'name',
|
||||
required: true,
|
||||
includeIfNull: false,
|
||||
)
|
||||
|
||||
|
||||
final String name;
|
||||
|
||||
|
||||
|
||||
@JsonKey(
|
||||
|
||||
name: r'source_id',
|
||||
required: true,
|
||||
includeIfNull: false,
|
||||
)
|
||||
|
||||
|
||||
final String sourceId;
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
@override
|
||||
bool operator ==(Object other) => identical(this, other) || other is AccountSuggestion &&
|
||||
other.broker == broker &&
|
||||
other.id == id &&
|
||||
other.name == name &&
|
||||
other.sourceId == sourceId;
|
||||
|
||||
@override
|
||||
int get hashCode =>
|
||||
(broker == null ? 0 : broker.hashCode) +
|
||||
id.hashCode +
|
||||
name.hashCode +
|
||||
sourceId.hashCode;
|
||||
|
||||
factory AccountSuggestion.fromJson(Map<String, dynamic> json) => _$AccountSuggestionFromJson(json);
|
||||
|
||||
Map<String, dynamic> toJson() => _$AccountSuggestionToJson(this);
|
||||
|
||||
@override
|
||||
String toString() {
|
||||
return toJson().toString();
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -0,0 +1,116 @@
|
||||
// GENERATED CODE - DO NOT MODIFY BY HAND
|
||||
|
||||
part of 'account_suggestion.dart';
|
||||
|
||||
// **************************************************************************
|
||||
// CopyWithGenerator
|
||||
// **************************************************************************
|
||||
|
||||
abstract class _$AccountSuggestionCWProxy {
|
||||
AccountSuggestion broker(String? broker);
|
||||
|
||||
AccountSuggestion id(int id);
|
||||
|
||||
AccountSuggestion name(String name);
|
||||
|
||||
AccountSuggestion sourceId(String sourceId);
|
||||
|
||||
/// This function **does support** nullification of nullable fields. All `null` values passed to `non-nullable` fields will be ignored. You can also use `AccountSuggestion(...).copyWith.fieldName(...)` to override fields one at a time with nullification support.
|
||||
///
|
||||
/// Usage
|
||||
/// ```dart
|
||||
/// AccountSuggestion(...).copyWith(id: 12, name: "My name")
|
||||
/// ````
|
||||
AccountSuggestion call({
|
||||
String? broker,
|
||||
int id,
|
||||
String name,
|
||||
String sourceId,
|
||||
});
|
||||
}
|
||||
|
||||
/// Proxy class for `copyWith` functionality. This is a callable class and can be used as follows: `instanceOfAccountSuggestion.copyWith(...)`. Additionally contains functions for specific fields e.g. `instanceOfAccountSuggestion.copyWith.fieldName(...)`
|
||||
class _$AccountSuggestionCWProxyImpl implements _$AccountSuggestionCWProxy {
|
||||
const _$AccountSuggestionCWProxyImpl(this._value);
|
||||
|
||||
final AccountSuggestion _value;
|
||||
|
||||
@override
|
||||
AccountSuggestion broker(String? broker) => this(broker: broker);
|
||||
|
||||
@override
|
||||
AccountSuggestion id(int id) => this(id: id);
|
||||
|
||||
@override
|
||||
AccountSuggestion name(String name) => this(name: name);
|
||||
|
||||
@override
|
||||
AccountSuggestion sourceId(String sourceId) => this(sourceId: sourceId);
|
||||
|
||||
@override
|
||||
/// This function **does support** nullification of nullable fields. All `null` values passed to `non-nullable` fields will be ignored. You can also use `AccountSuggestion(...).copyWith.fieldName(...)` to override fields one at a time with nullification support.
|
||||
///
|
||||
/// Usage
|
||||
/// ```dart
|
||||
/// AccountSuggestion(...).copyWith(id: 12, name: "My name")
|
||||
/// ````
|
||||
AccountSuggestion call({
|
||||
Object? broker = const $CopyWithPlaceholder(),
|
||||
Object? id = const $CopyWithPlaceholder(),
|
||||
Object? name = const $CopyWithPlaceholder(),
|
||||
Object? sourceId = const $CopyWithPlaceholder(),
|
||||
}) {
|
||||
return AccountSuggestion(
|
||||
broker: broker == const $CopyWithPlaceholder()
|
||||
? _value.broker
|
||||
// ignore: cast_nullable_to_non_nullable
|
||||
: broker as String?,
|
||||
id: id == const $CopyWithPlaceholder()
|
||||
? _value.id
|
||||
// ignore: cast_nullable_to_non_nullable
|
||||
: id as int,
|
||||
name: name == const $CopyWithPlaceholder()
|
||||
? _value.name
|
||||
// ignore: cast_nullable_to_non_nullable
|
||||
: name as String,
|
||||
sourceId: sourceId == const $CopyWithPlaceholder()
|
||||
? _value.sourceId
|
||||
// ignore: cast_nullable_to_non_nullable
|
||||
: sourceId as String,
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
extension $AccountSuggestionCopyWith on AccountSuggestion {
|
||||
/// Returns a callable class that can be used as follows: `instanceOfAccountSuggestion.copyWith(...)` or like so:`instanceOfAccountSuggestion.copyWith.fieldName(...)`.
|
||||
// ignore: library_private_types_in_public_api
|
||||
_$AccountSuggestionCWProxy get copyWith =>
|
||||
_$AccountSuggestionCWProxyImpl(this);
|
||||
}
|
||||
|
||||
// **************************************************************************
|
||||
// JsonSerializableGenerator
|
||||
// **************************************************************************
|
||||
|
||||
AccountSuggestion _$AccountSuggestionFromJson(Map<String, dynamic> json) =>
|
||||
$checkedCreate('AccountSuggestion', json, ($checkedConvert) {
|
||||
$checkKeys(
|
||||
json,
|
||||
requiredKeys: const ['broker', 'id', 'name', 'source_id'],
|
||||
);
|
||||
final val = AccountSuggestion(
|
||||
broker: $checkedConvert('broker', (v) => v as String?),
|
||||
id: $checkedConvert('id', (v) => (v as num).toInt()),
|
||||
name: $checkedConvert('name', (v) => v as String),
|
||||
sourceId: $checkedConvert('source_id', (v) => v as String),
|
||||
);
|
||||
return val;
|
||||
}, fieldKeyMap: const {'sourceId': 'source_id'});
|
||||
|
||||
Map<String, dynamic> _$AccountSuggestionToJson(AccountSuggestion instance) =>
|
||||
<String, dynamic>{
|
||||
'broker': instance.broker,
|
||||
'id': instance.id,
|
||||
'name': instance.name,
|
||||
'source_id': instance.sourceId,
|
||||
};
|
||||
@@ -0,0 +1,59 @@
|
||||
//
|
||||
// AUTO-GENERATED FILE, DO NOT MODIFY!
|
||||
//
|
||||
|
||||
// ignore_for_file: unused_element
|
||||
import 'package:fintracker_api/src/model/benchmark_comparison_out.dart';
|
||||
import 'package:copy_with_extension/copy_with_extension.dart';
|
||||
import 'package:json_annotation/json_annotation.dart';
|
||||
|
||||
part 'benchmark_comparison.g.dart';
|
||||
|
||||
|
||||
@CopyWith()
|
||||
@JsonSerializable(
|
||||
checked: true,
|
||||
createToJson: true,
|
||||
disallowUnrecognizedKeys: false,
|
||||
explicitToJson: true,
|
||||
)
|
||||
class BenchmarkComparison {
|
||||
/// Returns a new [BenchmarkComparison] instance.
|
||||
BenchmarkComparison({
|
||||
|
||||
required this.rows,
|
||||
});
|
||||
|
||||
@JsonKey(
|
||||
|
||||
name: r'rows',
|
||||
required: true,
|
||||
includeIfNull: false,
|
||||
)
|
||||
|
||||
|
||||
final List<BenchmarkComparisonOut> rows;
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
@override
|
||||
bool operator ==(Object other) => identical(this, other) || other is BenchmarkComparison &&
|
||||
other.rows == rows;
|
||||
|
||||
@override
|
||||
int get hashCode =>
|
||||
rows.hashCode;
|
||||
|
||||
factory BenchmarkComparison.fromJson(Map<String, dynamic> json) => _$BenchmarkComparisonFromJson(json);
|
||||
|
||||
Map<String, dynamic> toJson() => _$BenchmarkComparisonToJson(this);
|
||||
|
||||
@override
|
||||
String toString() {
|
||||
return toJson().toString();
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -0,0 +1,78 @@
|
||||
// GENERATED CODE - DO NOT MODIFY BY HAND
|
||||
|
||||
part of 'benchmark_comparison.dart';
|
||||
|
||||
// **************************************************************************
|
||||
// CopyWithGenerator
|
||||
// **************************************************************************
|
||||
|
||||
abstract class _$BenchmarkComparisonCWProxy {
|
||||
BenchmarkComparison rows(List<BenchmarkComparisonOut> rows);
|
||||
|
||||
/// This function **does support** nullification of nullable fields. All `null` values passed to `non-nullable` fields will be ignored. You can also use `BenchmarkComparison(...).copyWith.fieldName(...)` to override fields one at a time with nullification support.
|
||||
///
|
||||
/// Usage
|
||||
/// ```dart
|
||||
/// BenchmarkComparison(...).copyWith(id: 12, name: "My name")
|
||||
/// ````
|
||||
BenchmarkComparison call({List<BenchmarkComparisonOut> rows});
|
||||
}
|
||||
|
||||
/// Proxy class for `copyWith` functionality. This is a callable class and can be used as follows: `instanceOfBenchmarkComparison.copyWith(...)`. Additionally contains functions for specific fields e.g. `instanceOfBenchmarkComparison.copyWith.fieldName(...)`
|
||||
class _$BenchmarkComparisonCWProxyImpl implements _$BenchmarkComparisonCWProxy {
|
||||
const _$BenchmarkComparisonCWProxyImpl(this._value);
|
||||
|
||||
final BenchmarkComparison _value;
|
||||
|
||||
@override
|
||||
BenchmarkComparison rows(List<BenchmarkComparisonOut> rows) =>
|
||||
this(rows: rows);
|
||||
|
||||
@override
|
||||
/// This function **does support** nullification of nullable fields. All `null` values passed to `non-nullable` fields will be ignored. You can also use `BenchmarkComparison(...).copyWith.fieldName(...)` to override fields one at a time with nullification support.
|
||||
///
|
||||
/// Usage
|
||||
/// ```dart
|
||||
/// BenchmarkComparison(...).copyWith(id: 12, name: "My name")
|
||||
/// ````
|
||||
BenchmarkComparison call({Object? rows = const $CopyWithPlaceholder()}) {
|
||||
return BenchmarkComparison(
|
||||
rows: rows == const $CopyWithPlaceholder()
|
||||
? _value.rows
|
||||
// ignore: cast_nullable_to_non_nullable
|
||||
: rows as List<BenchmarkComparisonOut>,
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
extension $BenchmarkComparisonCopyWith on BenchmarkComparison {
|
||||
/// Returns a callable class that can be used as follows: `instanceOfBenchmarkComparison.copyWith(...)` or like so:`instanceOfBenchmarkComparison.copyWith.fieldName(...)`.
|
||||
// ignore: library_private_types_in_public_api
|
||||
_$BenchmarkComparisonCWProxy get copyWith =>
|
||||
_$BenchmarkComparisonCWProxyImpl(this);
|
||||
}
|
||||
|
||||
// **************************************************************************
|
||||
// JsonSerializableGenerator
|
||||
// **************************************************************************
|
||||
|
||||
BenchmarkComparison _$BenchmarkComparisonFromJson(Map<String, dynamic> json) =>
|
||||
$checkedCreate('BenchmarkComparison', json, ($checkedConvert) {
|
||||
$checkKeys(json, requiredKeys: const ['rows']);
|
||||
final val = BenchmarkComparison(
|
||||
rows: $checkedConvert(
|
||||
'rows',
|
||||
(v) => (v as List<dynamic>)
|
||||
.map(
|
||||
(e) =>
|
||||
BenchmarkComparisonOut.fromJson(e as Map<String, dynamic>),
|
||||
)
|
||||
.toList(),
|
||||
),
|
||||
);
|
||||
return val;
|
||||
});
|
||||
|
||||
Map<String, dynamic> _$BenchmarkComparisonToJson(
|
||||
BenchmarkComparison instance,
|
||||
) => <String, dynamic>{'rows': instance.rows.map((e) => e.toJson()).toList()};
|
||||
@@ -0,0 +1,157 @@
|
||||
//
|
||||
// AUTO-GENERATED FILE, DO NOT MODIFY!
|
||||
//
|
||||
|
||||
// ignore_for_file: unused_element
|
||||
import 'package:fintracker_api/src/model/benchmark_return_out.dart';
|
||||
import 'package:copy_with_extension/copy_with_extension.dart';
|
||||
import 'package:json_annotation/json_annotation.dart';
|
||||
|
||||
part 'benchmark_comparison_out.g.dart';
|
||||
|
||||
|
||||
@CopyWith()
|
||||
@JsonSerializable(
|
||||
checked: true,
|
||||
createToJson: true,
|
||||
disallowUnrecognizedKeys: false,
|
||||
explicitToJson: true,
|
||||
)
|
||||
class BenchmarkComparisonOut {
|
||||
/// Returns a new [BenchmarkComparisonOut] instance.
|
||||
BenchmarkComparisonOut({
|
||||
|
||||
required this.benchmarks,
|
||||
|
||||
required this.dateFrom,
|
||||
|
||||
required this.dateTo,
|
||||
|
||||
required this.period,
|
||||
|
||||
required this.portfolioDaysSkipped,
|
||||
|
||||
required this.portfolioTwr,
|
||||
|
||||
required this.portfolioTwrAnnualized,
|
||||
});
|
||||
|
||||
@JsonKey(
|
||||
|
||||
name: r'benchmarks',
|
||||
required: true,
|
||||
includeIfNull: false,
|
||||
)
|
||||
|
||||
|
||||
final List<BenchmarkReturnOut> benchmarks;
|
||||
|
||||
|
||||
|
||||
@JsonKey(
|
||||
|
||||
name: r'date_from',
|
||||
required: true,
|
||||
includeIfNull: false,
|
||||
)
|
||||
|
||||
|
||||
final DateTime dateFrom;
|
||||
|
||||
|
||||
|
||||
@JsonKey(
|
||||
|
||||
name: r'date_to',
|
||||
required: true,
|
||||
includeIfNull: false,
|
||||
)
|
||||
|
||||
|
||||
final DateTime dateTo;
|
||||
|
||||
|
||||
|
||||
@JsonKey(
|
||||
|
||||
name: r'period',
|
||||
required: true,
|
||||
includeIfNull: false,
|
||||
)
|
||||
|
||||
|
||||
final String period;
|
||||
|
||||
|
||||
|
||||
@JsonKey(
|
||||
|
||||
name: r'portfolio_days_skipped',
|
||||
required: true,
|
||||
includeIfNull: false,
|
||||
)
|
||||
|
||||
|
||||
final int portfolioDaysSkipped;
|
||||
|
||||
|
||||
|
||||
/// decimal as string
|
||||
@JsonKey(
|
||||
|
||||
name: r'portfolio_twr',
|
||||
required: true,
|
||||
includeIfNull: true,
|
||||
)
|
||||
|
||||
|
||||
final String? portfolioTwr;
|
||||
|
||||
|
||||
|
||||
/// decimal as string
|
||||
@JsonKey(
|
||||
|
||||
name: r'portfolio_twr_annualized',
|
||||
required: true,
|
||||
includeIfNull: true,
|
||||
)
|
||||
|
||||
|
||||
final String? portfolioTwrAnnualized;
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
@override
|
||||
bool operator ==(Object other) => identical(this, other) || other is BenchmarkComparisonOut &&
|
||||
other.benchmarks == benchmarks &&
|
||||
other.dateFrom == dateFrom &&
|
||||
other.dateTo == dateTo &&
|
||||
other.period == period &&
|
||||
other.portfolioDaysSkipped == portfolioDaysSkipped &&
|
||||
other.portfolioTwr == portfolioTwr &&
|
||||
other.portfolioTwrAnnualized == portfolioTwrAnnualized;
|
||||
|
||||
@override
|
||||
int get hashCode =>
|
||||
benchmarks.hashCode +
|
||||
dateFrom.hashCode +
|
||||
dateTo.hashCode +
|
||||
period.hashCode +
|
||||
portfolioDaysSkipped.hashCode +
|
||||
(portfolioTwr == null ? 0 : portfolioTwr.hashCode) +
|
||||
(portfolioTwrAnnualized == null ? 0 : portfolioTwrAnnualized.hashCode);
|
||||
|
||||
factory BenchmarkComparisonOut.fromJson(Map<String, dynamic> json) => _$BenchmarkComparisonOutFromJson(json);
|
||||
|
||||
Map<String, dynamic> toJson() => _$BenchmarkComparisonOutToJson(this);
|
||||
|
||||
@override
|
||||
String toString() {
|
||||
return toJson().toString();
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -0,0 +1,198 @@
|
||||
// GENERATED CODE - DO NOT MODIFY BY HAND
|
||||
|
||||
part of 'benchmark_comparison_out.dart';
|
||||
|
||||
// **************************************************************************
|
||||
// CopyWithGenerator
|
||||
// **************************************************************************
|
||||
|
||||
abstract class _$BenchmarkComparisonOutCWProxy {
|
||||
BenchmarkComparisonOut benchmarks(List<BenchmarkReturnOut> benchmarks);
|
||||
|
||||
BenchmarkComparisonOut dateFrom(DateTime dateFrom);
|
||||
|
||||
BenchmarkComparisonOut dateTo(DateTime dateTo);
|
||||
|
||||
BenchmarkComparisonOut period(String period);
|
||||
|
||||
BenchmarkComparisonOut portfolioDaysSkipped(int portfolioDaysSkipped);
|
||||
|
||||
BenchmarkComparisonOut portfolioTwr(String? portfolioTwr);
|
||||
|
||||
BenchmarkComparisonOut portfolioTwrAnnualized(String? portfolioTwrAnnualized);
|
||||
|
||||
/// This function **does support** nullification of nullable fields. All `null` values passed to `non-nullable` fields will be ignored. You can also use `BenchmarkComparisonOut(...).copyWith.fieldName(...)` to override fields one at a time with nullification support.
|
||||
///
|
||||
/// Usage
|
||||
/// ```dart
|
||||
/// BenchmarkComparisonOut(...).copyWith(id: 12, name: "My name")
|
||||
/// ````
|
||||
BenchmarkComparisonOut call({
|
||||
List<BenchmarkReturnOut> benchmarks,
|
||||
DateTime dateFrom,
|
||||
DateTime dateTo,
|
||||
String period,
|
||||
int portfolioDaysSkipped,
|
||||
String? portfolioTwr,
|
||||
String? portfolioTwrAnnualized,
|
||||
});
|
||||
}
|
||||
|
||||
/// Proxy class for `copyWith` functionality. This is a callable class and can be used as follows: `instanceOfBenchmarkComparisonOut.copyWith(...)`. Additionally contains functions for specific fields e.g. `instanceOfBenchmarkComparisonOut.copyWith.fieldName(...)`
|
||||
class _$BenchmarkComparisonOutCWProxyImpl
|
||||
implements _$BenchmarkComparisonOutCWProxy {
|
||||
const _$BenchmarkComparisonOutCWProxyImpl(this._value);
|
||||
|
||||
final BenchmarkComparisonOut _value;
|
||||
|
||||
@override
|
||||
BenchmarkComparisonOut benchmarks(List<BenchmarkReturnOut> benchmarks) =>
|
||||
this(benchmarks: benchmarks);
|
||||
|
||||
@override
|
||||
BenchmarkComparisonOut dateFrom(DateTime dateFrom) =>
|
||||
this(dateFrom: dateFrom);
|
||||
|
||||
@override
|
||||
BenchmarkComparisonOut dateTo(DateTime dateTo) => this(dateTo: dateTo);
|
||||
|
||||
@override
|
||||
BenchmarkComparisonOut period(String period) => this(period: period);
|
||||
|
||||
@override
|
||||
BenchmarkComparisonOut portfolioDaysSkipped(int portfolioDaysSkipped) =>
|
||||
this(portfolioDaysSkipped: portfolioDaysSkipped);
|
||||
|
||||
@override
|
||||
BenchmarkComparisonOut portfolioTwr(String? portfolioTwr) =>
|
||||
this(portfolioTwr: portfolioTwr);
|
||||
|
||||
@override
|
||||
BenchmarkComparisonOut portfolioTwrAnnualized(
|
||||
String? portfolioTwrAnnualized,
|
||||
) => this(portfolioTwrAnnualized: portfolioTwrAnnualized);
|
||||
|
||||
@override
|
||||
/// This function **does support** nullification of nullable fields. All `null` values passed to `non-nullable` fields will be ignored. You can also use `BenchmarkComparisonOut(...).copyWith.fieldName(...)` to override fields one at a time with nullification support.
|
||||
///
|
||||
/// Usage
|
||||
/// ```dart
|
||||
/// BenchmarkComparisonOut(...).copyWith(id: 12, name: "My name")
|
||||
/// ````
|
||||
BenchmarkComparisonOut call({
|
||||
Object? benchmarks = const $CopyWithPlaceholder(),
|
||||
Object? dateFrom = const $CopyWithPlaceholder(),
|
||||
Object? dateTo = const $CopyWithPlaceholder(),
|
||||
Object? period = const $CopyWithPlaceholder(),
|
||||
Object? portfolioDaysSkipped = const $CopyWithPlaceholder(),
|
||||
Object? portfolioTwr = const $CopyWithPlaceholder(),
|
||||
Object? portfolioTwrAnnualized = const $CopyWithPlaceholder(),
|
||||
}) {
|
||||
return BenchmarkComparisonOut(
|
||||
benchmarks: benchmarks == const $CopyWithPlaceholder()
|
||||
? _value.benchmarks
|
||||
// ignore: cast_nullable_to_non_nullable
|
||||
: benchmarks as List<BenchmarkReturnOut>,
|
||||
dateFrom: dateFrom == const $CopyWithPlaceholder()
|
||||
? _value.dateFrom
|
||||
// ignore: cast_nullable_to_non_nullable
|
||||
: dateFrom as DateTime,
|
||||
dateTo: dateTo == const $CopyWithPlaceholder()
|
||||
? _value.dateTo
|
||||
// ignore: cast_nullable_to_non_nullable
|
||||
: dateTo as DateTime,
|
||||
period: period == const $CopyWithPlaceholder()
|
||||
? _value.period
|
||||
// ignore: cast_nullable_to_non_nullable
|
||||
: period as String,
|
||||
portfolioDaysSkipped: portfolioDaysSkipped == const $CopyWithPlaceholder()
|
||||
? _value.portfolioDaysSkipped
|
||||
// ignore: cast_nullable_to_non_nullable
|
||||
: portfolioDaysSkipped as int,
|
||||
portfolioTwr: portfolioTwr == const $CopyWithPlaceholder()
|
||||
? _value.portfolioTwr
|
||||
// ignore: cast_nullable_to_non_nullable
|
||||
: portfolioTwr as String?,
|
||||
portfolioTwrAnnualized:
|
||||
portfolioTwrAnnualized == const $CopyWithPlaceholder()
|
||||
? _value.portfolioTwrAnnualized
|
||||
// ignore: cast_nullable_to_non_nullable
|
||||
: portfolioTwrAnnualized as String?,
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
extension $BenchmarkComparisonOutCopyWith on BenchmarkComparisonOut {
|
||||
/// Returns a callable class that can be used as follows: `instanceOfBenchmarkComparisonOut.copyWith(...)` or like so:`instanceOfBenchmarkComparisonOut.copyWith.fieldName(...)`.
|
||||
// ignore: library_private_types_in_public_api
|
||||
_$BenchmarkComparisonOutCWProxy get copyWith =>
|
||||
_$BenchmarkComparisonOutCWProxyImpl(this);
|
||||
}
|
||||
|
||||
// **************************************************************************
|
||||
// JsonSerializableGenerator
|
||||
// **************************************************************************
|
||||
|
||||
BenchmarkComparisonOut _$BenchmarkComparisonOutFromJson(
|
||||
Map<String, dynamic> json,
|
||||
) => $checkedCreate(
|
||||
'BenchmarkComparisonOut',
|
||||
json,
|
||||
($checkedConvert) {
|
||||
$checkKeys(
|
||||
json,
|
||||
requiredKeys: const [
|
||||
'benchmarks',
|
||||
'date_from',
|
||||
'date_to',
|
||||
'period',
|
||||
'portfolio_days_skipped',
|
||||
'portfolio_twr',
|
||||
'portfolio_twr_annualized',
|
||||
],
|
||||
);
|
||||
final val = BenchmarkComparisonOut(
|
||||
benchmarks: $checkedConvert(
|
||||
'benchmarks',
|
||||
(v) => (v as List<dynamic>)
|
||||
.map((e) => BenchmarkReturnOut.fromJson(e as Map<String, dynamic>))
|
||||
.toList(),
|
||||
),
|
||||
dateFrom: $checkedConvert(
|
||||
'date_from',
|
||||
(v) => DateTime.parse(v as String),
|
||||
),
|
||||
dateTo: $checkedConvert('date_to', (v) => DateTime.parse(v as String)),
|
||||
period: $checkedConvert('period', (v) => v as String),
|
||||
portfolioDaysSkipped: $checkedConvert(
|
||||
'portfolio_days_skipped',
|
||||
(v) => (v as num).toInt(),
|
||||
),
|
||||
portfolioTwr: $checkedConvert('portfolio_twr', (v) => v as String?),
|
||||
portfolioTwrAnnualized: $checkedConvert(
|
||||
'portfolio_twr_annualized',
|
||||
(v) => v as String?,
|
||||
),
|
||||
);
|
||||
return val;
|
||||
},
|
||||
fieldKeyMap: const {
|
||||
'dateFrom': 'date_from',
|
||||
'dateTo': 'date_to',
|
||||
'portfolioDaysSkipped': 'portfolio_days_skipped',
|
||||
'portfolioTwr': 'portfolio_twr',
|
||||
'portfolioTwrAnnualized': 'portfolio_twr_annualized',
|
||||
},
|
||||
);
|
||||
|
||||
Map<String, dynamic> _$BenchmarkComparisonOutToJson(
|
||||
BenchmarkComparisonOut instance,
|
||||
) => <String, dynamic>{
|
||||
'benchmarks': instance.benchmarks.map((e) => e.toJson()).toList(),
|
||||
'date_from': instance.dateFrom.toIso8601String(),
|
||||
'date_to': instance.dateTo.toIso8601String(),
|
||||
'period': instance.period,
|
||||
'portfolio_days_skipped': instance.portfolioDaysSkipped,
|
||||
'portfolio_twr': instance.portfolioTwr,
|
||||
'portfolio_twr_annualized': instance.portfolioTwrAnnualized,
|
||||
};
|
||||
@@ -0,0 +1,170 @@
|
||||
//
|
||||
// AUTO-GENERATED FILE, DO NOT MODIFY!
|
||||
//
|
||||
|
||||
// ignore_for_file: unused_element
|
||||
import 'package:copy_with_extension/copy_with_extension.dart';
|
||||
import 'package:json_annotation/json_annotation.dart';
|
||||
|
||||
part 'benchmark_create.g.dart';
|
||||
|
||||
|
||||
@CopyWith()
|
||||
@JsonSerializable(
|
||||
checked: true,
|
||||
createToJson: true,
|
||||
disallowUnrecognizedKeys: false,
|
||||
explicitToJson: true,
|
||||
)
|
||||
class BenchmarkCreate {
|
||||
/// Returns a new [BenchmarkCreate] instance.
|
||||
BenchmarkCreate({
|
||||
|
||||
required this.code,
|
||||
|
||||
this.currency = 'RUB',
|
||||
|
||||
this.instrumentId,
|
||||
|
||||
this.isActive = true,
|
||||
|
||||
this.isDefault = false,
|
||||
|
||||
required this.kind,
|
||||
|
||||
required this.name,
|
||||
|
||||
this.source_ = 'moex',
|
||||
});
|
||||
|
||||
@JsonKey(
|
||||
|
||||
name: r'code',
|
||||
required: true,
|
||||
includeIfNull: false,
|
||||
)
|
||||
|
||||
|
||||
final String code;
|
||||
|
||||
|
||||
|
||||
@JsonKey(
|
||||
defaultValue: 'RUB',
|
||||
name: r'currency',
|
||||
required: false,
|
||||
includeIfNull: false,
|
||||
)
|
||||
|
||||
|
||||
final String? currency;
|
||||
|
||||
|
||||
|
||||
@JsonKey(
|
||||
|
||||
name: r'instrument_id',
|
||||
required: false,
|
||||
includeIfNull: false,
|
||||
)
|
||||
|
||||
|
||||
final int? instrumentId;
|
||||
|
||||
|
||||
|
||||
@JsonKey(
|
||||
defaultValue: true,
|
||||
name: r'is_active',
|
||||
required: false,
|
||||
includeIfNull: false,
|
||||
)
|
||||
|
||||
|
||||
final bool? isActive;
|
||||
|
||||
|
||||
|
||||
@JsonKey(
|
||||
defaultValue: false,
|
||||
name: r'is_default',
|
||||
required: false,
|
||||
includeIfNull: false,
|
||||
)
|
||||
|
||||
|
||||
final bool? isDefault;
|
||||
|
||||
|
||||
|
||||
@JsonKey(
|
||||
|
||||
name: r'kind',
|
||||
required: true,
|
||||
includeIfNull: false,
|
||||
)
|
||||
|
||||
|
||||
final String kind;
|
||||
|
||||
|
||||
|
||||
@JsonKey(
|
||||
|
||||
name: r'name',
|
||||
required: true,
|
||||
includeIfNull: false,
|
||||
)
|
||||
|
||||
|
||||
final String name;
|
||||
|
||||
|
||||
|
||||
@JsonKey(
|
||||
defaultValue: 'moex',
|
||||
name: r'source',
|
||||
required: false,
|
||||
includeIfNull: false,
|
||||
)
|
||||
|
||||
|
||||
final String? source_;
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
@override
|
||||
bool operator ==(Object other) => identical(this, other) || other is BenchmarkCreate &&
|
||||
other.code == code &&
|
||||
other.currency == currency &&
|
||||
other.instrumentId == instrumentId &&
|
||||
other.isActive == isActive &&
|
||||
other.isDefault == isDefault &&
|
||||
other.kind == kind &&
|
||||
other.name == name &&
|
||||
other.source_ == source_;
|
||||
|
||||
@override
|
||||
int get hashCode =>
|
||||
code.hashCode +
|
||||
currency.hashCode +
|
||||
(instrumentId == null ? 0 : instrumentId.hashCode) +
|
||||
isActive.hashCode +
|
||||
isDefault.hashCode +
|
||||
kind.hashCode +
|
||||
name.hashCode +
|
||||
source_.hashCode;
|
||||
|
||||
factory BenchmarkCreate.fromJson(Map<String, dynamic> json) => _$BenchmarkCreateFromJson(json);
|
||||
|
||||
Map<String, dynamic> toJson() => _$BenchmarkCreateToJson(this);
|
||||
|
||||
@override
|
||||
String toString() {
|
||||
return toJson().toString();
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -0,0 +1,178 @@
|
||||
// GENERATED CODE - DO NOT MODIFY BY HAND
|
||||
|
||||
part of 'benchmark_create.dart';
|
||||
|
||||
// **************************************************************************
|
||||
// CopyWithGenerator
|
||||
// **************************************************************************
|
||||
|
||||
abstract class _$BenchmarkCreateCWProxy {
|
||||
BenchmarkCreate code(String code);
|
||||
|
||||
BenchmarkCreate currency(String? currency);
|
||||
|
||||
BenchmarkCreate instrumentId(int? instrumentId);
|
||||
|
||||
BenchmarkCreate isActive(bool? isActive);
|
||||
|
||||
BenchmarkCreate isDefault(bool? isDefault);
|
||||
|
||||
BenchmarkCreate kind(String kind);
|
||||
|
||||
BenchmarkCreate name(String name);
|
||||
|
||||
BenchmarkCreate source_(String? source_);
|
||||
|
||||
/// This function **does support** nullification of nullable fields. All `null` values passed to `non-nullable` fields will be ignored. You can also use `BenchmarkCreate(...).copyWith.fieldName(...)` to override fields one at a time with nullification support.
|
||||
///
|
||||
/// Usage
|
||||
/// ```dart
|
||||
/// BenchmarkCreate(...).copyWith(id: 12, name: "My name")
|
||||
/// ````
|
||||
BenchmarkCreate call({
|
||||
String code,
|
||||
String? currency,
|
||||
int? instrumentId,
|
||||
bool? isActive,
|
||||
bool? isDefault,
|
||||
String kind,
|
||||
String name,
|
||||
String? source_,
|
||||
});
|
||||
}
|
||||
|
||||
/// Proxy class for `copyWith` functionality. This is a callable class and can be used as follows: `instanceOfBenchmarkCreate.copyWith(...)`. Additionally contains functions for specific fields e.g. `instanceOfBenchmarkCreate.copyWith.fieldName(...)`
|
||||
class _$BenchmarkCreateCWProxyImpl implements _$BenchmarkCreateCWProxy {
|
||||
const _$BenchmarkCreateCWProxyImpl(this._value);
|
||||
|
||||
final BenchmarkCreate _value;
|
||||
|
||||
@override
|
||||
BenchmarkCreate code(String code) => this(code: code);
|
||||
|
||||
@override
|
||||
BenchmarkCreate currency(String? currency) => this(currency: currency);
|
||||
|
||||
@override
|
||||
BenchmarkCreate instrumentId(int? instrumentId) =>
|
||||
this(instrumentId: instrumentId);
|
||||
|
||||
@override
|
||||
BenchmarkCreate isActive(bool? isActive) => this(isActive: isActive);
|
||||
|
||||
@override
|
||||
BenchmarkCreate isDefault(bool? isDefault) => this(isDefault: isDefault);
|
||||
|
||||
@override
|
||||
BenchmarkCreate kind(String kind) => this(kind: kind);
|
||||
|
||||
@override
|
||||
BenchmarkCreate name(String name) => this(name: name);
|
||||
|
||||
@override
|
||||
BenchmarkCreate source_(String? source_) => this(source_: source_);
|
||||
|
||||
@override
|
||||
/// This function **does support** nullification of nullable fields. All `null` values passed to `non-nullable` fields will be ignored. You can also use `BenchmarkCreate(...).copyWith.fieldName(...)` to override fields one at a time with nullification support.
|
||||
///
|
||||
/// Usage
|
||||
/// ```dart
|
||||
/// BenchmarkCreate(...).copyWith(id: 12, name: "My name")
|
||||
/// ````
|
||||
BenchmarkCreate call({
|
||||
Object? code = const $CopyWithPlaceholder(),
|
||||
Object? currency = const $CopyWithPlaceholder(),
|
||||
Object? instrumentId = const $CopyWithPlaceholder(),
|
||||
Object? isActive = const $CopyWithPlaceholder(),
|
||||
Object? isDefault = const $CopyWithPlaceholder(),
|
||||
Object? kind = const $CopyWithPlaceholder(),
|
||||
Object? name = const $CopyWithPlaceholder(),
|
||||
Object? source_ = const $CopyWithPlaceholder(),
|
||||
}) {
|
||||
return BenchmarkCreate(
|
||||
code: code == const $CopyWithPlaceholder()
|
||||
? _value.code
|
||||
// ignore: cast_nullable_to_non_nullable
|
||||
: code as String,
|
||||
currency: currency == const $CopyWithPlaceholder()
|
||||
? _value.currency
|
||||
// ignore: cast_nullable_to_non_nullable
|
||||
: currency as String?,
|
||||
instrumentId: instrumentId == const $CopyWithPlaceholder()
|
||||
? _value.instrumentId
|
||||
// ignore: cast_nullable_to_non_nullable
|
||||
: instrumentId as int?,
|
||||
isActive: isActive == const $CopyWithPlaceholder()
|
||||
? _value.isActive
|
||||
// ignore: cast_nullable_to_non_nullable
|
||||
: isActive as bool?,
|
||||
isDefault: isDefault == const $CopyWithPlaceholder()
|
||||
? _value.isDefault
|
||||
// ignore: cast_nullable_to_non_nullable
|
||||
: isDefault as bool?,
|
||||
kind: kind == const $CopyWithPlaceholder()
|
||||
? _value.kind
|
||||
// ignore: cast_nullable_to_non_nullable
|
||||
: kind as String,
|
||||
name: name == const $CopyWithPlaceholder()
|
||||
? _value.name
|
||||
// ignore: cast_nullable_to_non_nullable
|
||||
: name as String,
|
||||
source_: source_ == const $CopyWithPlaceholder()
|
||||
? _value.source_
|
||||
// ignore: cast_nullable_to_non_nullable
|
||||
: source_ as String?,
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
extension $BenchmarkCreateCopyWith on BenchmarkCreate {
|
||||
/// Returns a callable class that can be used as follows: `instanceOfBenchmarkCreate.copyWith(...)` or like so:`instanceOfBenchmarkCreate.copyWith.fieldName(...)`.
|
||||
// ignore: library_private_types_in_public_api
|
||||
_$BenchmarkCreateCWProxy get copyWith => _$BenchmarkCreateCWProxyImpl(this);
|
||||
}
|
||||
|
||||
// **************************************************************************
|
||||
// JsonSerializableGenerator
|
||||
// **************************************************************************
|
||||
|
||||
BenchmarkCreate _$BenchmarkCreateFromJson(Map<String, dynamic> json) =>
|
||||
$checkedCreate(
|
||||
'BenchmarkCreate',
|
||||
json,
|
||||
($checkedConvert) {
|
||||
$checkKeys(json, requiredKeys: const ['code', 'kind', 'name']);
|
||||
final val = BenchmarkCreate(
|
||||
code: $checkedConvert('code', (v) => v as String),
|
||||
currency: $checkedConvert('currency', (v) => v as String? ?? 'RUB'),
|
||||
instrumentId: $checkedConvert(
|
||||
'instrument_id',
|
||||
(v) => (v as num?)?.toInt(),
|
||||
),
|
||||
isActive: $checkedConvert('is_active', (v) => v as bool? ?? true),
|
||||
isDefault: $checkedConvert('is_default', (v) => v as bool? ?? false),
|
||||
kind: $checkedConvert('kind', (v) => v as String),
|
||||
name: $checkedConvert('name', (v) => v as String),
|
||||
source_: $checkedConvert('source', (v) => v as String? ?? 'moex'),
|
||||
);
|
||||
return val;
|
||||
},
|
||||
fieldKeyMap: const {
|
||||
'instrumentId': 'instrument_id',
|
||||
'isActive': 'is_active',
|
||||
'isDefault': 'is_default',
|
||||
'source_': 'source',
|
||||
},
|
||||
);
|
||||
|
||||
Map<String, dynamic> _$BenchmarkCreateToJson(BenchmarkCreate instance) =>
|
||||
<String, dynamic>{
|
||||
'code': instance.code,
|
||||
'currency': ?instance.currency,
|
||||
'instrument_id': ?instance.instrumentId,
|
||||
'is_active': ?instance.isActive,
|
||||
'is_default': ?instance.isDefault,
|
||||
'kind': instance.kind,
|
||||
'name': instance.name,
|
||||
'source': ?instance.source_,
|
||||
};
|
||||
@@ -0,0 +1,218 @@
|
||||
//
|
||||
// AUTO-GENERATED FILE, DO NOT MODIFY!
|
||||
//
|
||||
|
||||
// ignore_for_file: unused_element
|
||||
import 'package:copy_with_extension/copy_with_extension.dart';
|
||||
import 'package:json_annotation/json_annotation.dart';
|
||||
|
||||
part 'benchmark_out.g.dart';
|
||||
|
||||
|
||||
@CopyWith()
|
||||
@JsonSerializable(
|
||||
checked: true,
|
||||
createToJson: true,
|
||||
disallowUnrecognizedKeys: false,
|
||||
explicitToJson: true,
|
||||
)
|
||||
class BenchmarkOut {
|
||||
/// Returns a new [BenchmarkOut] instance.
|
||||
BenchmarkOut({
|
||||
|
||||
required this.code,
|
||||
|
||||
required this.currency,
|
||||
|
||||
required this.historyFrom,
|
||||
|
||||
required this.historyTo,
|
||||
|
||||
required this.id,
|
||||
|
||||
required this.instrumentId,
|
||||
|
||||
required this.isActive,
|
||||
|
||||
required this.isDefault,
|
||||
|
||||
required this.kind,
|
||||
|
||||
required this.name,
|
||||
|
||||
required this.source_,
|
||||
});
|
||||
|
||||
@JsonKey(
|
||||
|
||||
name: r'code',
|
||||
required: true,
|
||||
includeIfNull: false,
|
||||
)
|
||||
|
||||
|
||||
final String code;
|
||||
|
||||
|
||||
|
||||
@JsonKey(
|
||||
|
||||
name: r'currency',
|
||||
required: true,
|
||||
includeIfNull: false,
|
||||
)
|
||||
|
||||
|
||||
final String currency;
|
||||
|
||||
|
||||
|
||||
@JsonKey(
|
||||
|
||||
name: r'history_from',
|
||||
required: true,
|
||||
includeIfNull: true,
|
||||
)
|
||||
|
||||
|
||||
final DateTime? historyFrom;
|
||||
|
||||
|
||||
|
||||
@JsonKey(
|
||||
|
||||
name: r'history_to',
|
||||
required: true,
|
||||
includeIfNull: true,
|
||||
)
|
||||
|
||||
|
||||
final DateTime? historyTo;
|
||||
|
||||
|
||||
|
||||
@JsonKey(
|
||||
|
||||
name: r'id',
|
||||
required: true,
|
||||
includeIfNull: false,
|
||||
)
|
||||
|
||||
|
||||
final int id;
|
||||
|
||||
|
||||
|
||||
@JsonKey(
|
||||
|
||||
name: r'instrument_id',
|
||||
required: true,
|
||||
includeIfNull: true,
|
||||
)
|
||||
|
||||
|
||||
final int? instrumentId;
|
||||
|
||||
|
||||
|
||||
@JsonKey(
|
||||
|
||||
name: r'is_active',
|
||||
required: true,
|
||||
includeIfNull: false,
|
||||
)
|
||||
|
||||
|
||||
final bool isActive;
|
||||
|
||||
|
||||
|
||||
@JsonKey(
|
||||
|
||||
name: r'is_default',
|
||||
required: true,
|
||||
includeIfNull: false,
|
||||
)
|
||||
|
||||
|
||||
final bool isDefault;
|
||||
|
||||
|
||||
|
||||
@JsonKey(
|
||||
|
||||
name: r'kind',
|
||||
required: true,
|
||||
includeIfNull: false,
|
||||
)
|
||||
|
||||
|
||||
final String kind;
|
||||
|
||||
|
||||
|
||||
@JsonKey(
|
||||
|
||||
name: r'name',
|
||||
required: true,
|
||||
includeIfNull: false,
|
||||
)
|
||||
|
||||
|
||||
final String name;
|
||||
|
||||
|
||||
|
||||
@JsonKey(
|
||||
|
||||
name: r'source',
|
||||
required: true,
|
||||
includeIfNull: false,
|
||||
)
|
||||
|
||||
|
||||
final String source_;
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
@override
|
||||
bool operator ==(Object other) => identical(this, other) || other is BenchmarkOut &&
|
||||
other.code == code &&
|
||||
other.currency == currency &&
|
||||
other.historyFrom == historyFrom &&
|
||||
other.historyTo == historyTo &&
|
||||
other.id == id &&
|
||||
other.instrumentId == instrumentId &&
|
||||
other.isActive == isActive &&
|
||||
other.isDefault == isDefault &&
|
||||
other.kind == kind &&
|
||||
other.name == name &&
|
||||
other.source_ == source_;
|
||||
|
||||
@override
|
||||
int get hashCode =>
|
||||
code.hashCode +
|
||||
currency.hashCode +
|
||||
(historyFrom == null ? 0 : historyFrom.hashCode) +
|
||||
(historyTo == null ? 0 : historyTo.hashCode) +
|
||||
id.hashCode +
|
||||
(instrumentId == null ? 0 : instrumentId.hashCode) +
|
||||
isActive.hashCode +
|
||||
isDefault.hashCode +
|
||||
kind.hashCode +
|
||||
name.hashCode +
|
||||
source_.hashCode;
|
||||
|
||||
factory BenchmarkOut.fromJson(Map<String, dynamic> json) => _$BenchmarkOutFromJson(json);
|
||||
|
||||
Map<String, dynamic> toJson() => _$BenchmarkOutToJson(this);
|
||||
|
||||
@override
|
||||
String toString() {
|
||||
return toJson().toString();
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -0,0 +1,241 @@
|
||||
// GENERATED CODE - DO NOT MODIFY BY HAND
|
||||
|
||||
part of 'benchmark_out.dart';
|
||||
|
||||
// **************************************************************************
|
||||
// CopyWithGenerator
|
||||
// **************************************************************************
|
||||
|
||||
abstract class _$BenchmarkOutCWProxy {
|
||||
BenchmarkOut code(String code);
|
||||
|
||||
BenchmarkOut currency(String currency);
|
||||
|
||||
BenchmarkOut historyFrom(DateTime? historyFrom);
|
||||
|
||||
BenchmarkOut historyTo(DateTime? historyTo);
|
||||
|
||||
BenchmarkOut id(int id);
|
||||
|
||||
BenchmarkOut instrumentId(int? instrumentId);
|
||||
|
||||
BenchmarkOut isActive(bool isActive);
|
||||
|
||||
BenchmarkOut isDefault(bool isDefault);
|
||||
|
||||
BenchmarkOut kind(String kind);
|
||||
|
||||
BenchmarkOut name(String name);
|
||||
|
||||
BenchmarkOut source_(String source_);
|
||||
|
||||
/// This function **does support** nullification of nullable fields. All `null` values passed to `non-nullable` fields will be ignored. You can also use `BenchmarkOut(...).copyWith.fieldName(...)` to override fields one at a time with nullification support.
|
||||
///
|
||||
/// Usage
|
||||
/// ```dart
|
||||
/// BenchmarkOut(...).copyWith(id: 12, name: "My name")
|
||||
/// ````
|
||||
BenchmarkOut call({
|
||||
String code,
|
||||
String currency,
|
||||
DateTime? historyFrom,
|
||||
DateTime? historyTo,
|
||||
int id,
|
||||
int? instrumentId,
|
||||
bool isActive,
|
||||
bool isDefault,
|
||||
String kind,
|
||||
String name,
|
||||
String source_,
|
||||
});
|
||||
}
|
||||
|
||||
/// Proxy class for `copyWith` functionality. This is a callable class and can be used as follows: `instanceOfBenchmarkOut.copyWith(...)`. Additionally contains functions for specific fields e.g. `instanceOfBenchmarkOut.copyWith.fieldName(...)`
|
||||
class _$BenchmarkOutCWProxyImpl implements _$BenchmarkOutCWProxy {
|
||||
const _$BenchmarkOutCWProxyImpl(this._value);
|
||||
|
||||
final BenchmarkOut _value;
|
||||
|
||||
@override
|
||||
BenchmarkOut code(String code) => this(code: code);
|
||||
|
||||
@override
|
||||
BenchmarkOut currency(String currency) => this(currency: currency);
|
||||
|
||||
@override
|
||||
BenchmarkOut historyFrom(DateTime? historyFrom) =>
|
||||
this(historyFrom: historyFrom);
|
||||
|
||||
@override
|
||||
BenchmarkOut historyTo(DateTime? historyTo) => this(historyTo: historyTo);
|
||||
|
||||
@override
|
||||
BenchmarkOut id(int id) => this(id: id);
|
||||
|
||||
@override
|
||||
BenchmarkOut instrumentId(int? instrumentId) =>
|
||||
this(instrumentId: instrumentId);
|
||||
|
||||
@override
|
||||
BenchmarkOut isActive(bool isActive) => this(isActive: isActive);
|
||||
|
||||
@override
|
||||
BenchmarkOut isDefault(bool isDefault) => this(isDefault: isDefault);
|
||||
|
||||
@override
|
||||
BenchmarkOut kind(String kind) => this(kind: kind);
|
||||
|
||||
@override
|
||||
BenchmarkOut name(String name) => this(name: name);
|
||||
|
||||
@override
|
||||
BenchmarkOut source_(String source_) => this(source_: source_);
|
||||
|
||||
@override
|
||||
/// This function **does support** nullification of nullable fields. All `null` values passed to `non-nullable` fields will be ignored. You can also use `BenchmarkOut(...).copyWith.fieldName(...)` to override fields one at a time with nullification support.
|
||||
///
|
||||
/// Usage
|
||||
/// ```dart
|
||||
/// BenchmarkOut(...).copyWith(id: 12, name: "My name")
|
||||
/// ````
|
||||
BenchmarkOut call({
|
||||
Object? code = const $CopyWithPlaceholder(),
|
||||
Object? currency = const $CopyWithPlaceholder(),
|
||||
Object? historyFrom = const $CopyWithPlaceholder(),
|
||||
Object? historyTo = const $CopyWithPlaceholder(),
|
||||
Object? id = const $CopyWithPlaceholder(),
|
||||
Object? instrumentId = const $CopyWithPlaceholder(),
|
||||
Object? isActive = const $CopyWithPlaceholder(),
|
||||
Object? isDefault = const $CopyWithPlaceholder(),
|
||||
Object? kind = const $CopyWithPlaceholder(),
|
||||
Object? name = const $CopyWithPlaceholder(),
|
||||
Object? source_ = const $CopyWithPlaceholder(),
|
||||
}) {
|
||||
return BenchmarkOut(
|
||||
code: code == const $CopyWithPlaceholder()
|
||||
? _value.code
|
||||
// ignore: cast_nullable_to_non_nullable
|
||||
: code as String,
|
||||
currency: currency == const $CopyWithPlaceholder()
|
||||
? _value.currency
|
||||
// ignore: cast_nullable_to_non_nullable
|
||||
: currency as String,
|
||||
historyFrom: historyFrom == const $CopyWithPlaceholder()
|
||||
? _value.historyFrom
|
||||
// ignore: cast_nullable_to_non_nullable
|
||||
: historyFrom as DateTime?,
|
||||
historyTo: historyTo == const $CopyWithPlaceholder()
|
||||
? _value.historyTo
|
||||
// ignore: cast_nullable_to_non_nullable
|
||||
: historyTo as DateTime?,
|
||||
id: id == const $CopyWithPlaceholder()
|
||||
? _value.id
|
||||
// ignore: cast_nullable_to_non_nullable
|
||||
: id as int,
|
||||
instrumentId: instrumentId == const $CopyWithPlaceholder()
|
||||
? _value.instrumentId
|
||||
// ignore: cast_nullable_to_non_nullable
|
||||
: instrumentId as int?,
|
||||
isActive: isActive == const $CopyWithPlaceholder()
|
||||
? _value.isActive
|
||||
// ignore: cast_nullable_to_non_nullable
|
||||
: isActive as bool,
|
||||
isDefault: isDefault == const $CopyWithPlaceholder()
|
||||
? _value.isDefault
|
||||
// ignore: cast_nullable_to_non_nullable
|
||||
: isDefault as bool,
|
||||
kind: kind == const $CopyWithPlaceholder()
|
||||
? _value.kind
|
||||
// ignore: cast_nullable_to_non_nullable
|
||||
: kind as String,
|
||||
name: name == const $CopyWithPlaceholder()
|
||||
? _value.name
|
||||
// ignore: cast_nullable_to_non_nullable
|
||||
: name as String,
|
||||
source_: source_ == const $CopyWithPlaceholder()
|
||||
? _value.source_
|
||||
// ignore: cast_nullable_to_non_nullable
|
||||
: source_ as String,
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
extension $BenchmarkOutCopyWith on BenchmarkOut {
|
||||
/// Returns a callable class that can be used as follows: `instanceOfBenchmarkOut.copyWith(...)` or like so:`instanceOfBenchmarkOut.copyWith.fieldName(...)`.
|
||||
// ignore: library_private_types_in_public_api
|
||||
_$BenchmarkOutCWProxy get copyWith => _$BenchmarkOutCWProxyImpl(this);
|
||||
}
|
||||
|
||||
// **************************************************************************
|
||||
// JsonSerializableGenerator
|
||||
// **************************************************************************
|
||||
|
||||
BenchmarkOut _$BenchmarkOutFromJson(Map<String, dynamic> json) =>
|
||||
$checkedCreate(
|
||||
'BenchmarkOut',
|
||||
json,
|
||||
($checkedConvert) {
|
||||
$checkKeys(
|
||||
json,
|
||||
requiredKeys: const [
|
||||
'code',
|
||||
'currency',
|
||||
'history_from',
|
||||
'history_to',
|
||||
'id',
|
||||
'instrument_id',
|
||||
'is_active',
|
||||
'is_default',
|
||||
'kind',
|
||||
'name',
|
||||
'source',
|
||||
],
|
||||
);
|
||||
final val = BenchmarkOut(
|
||||
code: $checkedConvert('code', (v) => v as String),
|
||||
currency: $checkedConvert('currency', (v) => v as String),
|
||||
historyFrom: $checkedConvert(
|
||||
'history_from',
|
||||
(v) => v == null ? null : DateTime.parse(v as String),
|
||||
),
|
||||
historyTo: $checkedConvert(
|
||||
'history_to',
|
||||
(v) => v == null ? null : DateTime.parse(v as String),
|
||||
),
|
||||
id: $checkedConvert('id', (v) => (v as num).toInt()),
|
||||
instrumentId: $checkedConvert(
|
||||
'instrument_id',
|
||||
(v) => (v as num?)?.toInt(),
|
||||
),
|
||||
isActive: $checkedConvert('is_active', (v) => v as bool),
|
||||
isDefault: $checkedConvert('is_default', (v) => v as bool),
|
||||
kind: $checkedConvert('kind', (v) => v as String),
|
||||
name: $checkedConvert('name', (v) => v as String),
|
||||
source_: $checkedConvert('source', (v) => v as String),
|
||||
);
|
||||
return val;
|
||||
},
|
||||
fieldKeyMap: const {
|
||||
'historyFrom': 'history_from',
|
||||
'historyTo': 'history_to',
|
||||
'instrumentId': 'instrument_id',
|
||||
'isActive': 'is_active',
|
||||
'isDefault': 'is_default',
|
||||
'source_': 'source',
|
||||
},
|
||||
);
|
||||
|
||||
Map<String, dynamic> _$BenchmarkOutToJson(BenchmarkOut instance) =>
|
||||
<String, dynamic>{
|
||||
'code': instance.code,
|
||||
'currency': instance.currency,
|
||||
'history_from': instance.historyFrom?.toIso8601String(),
|
||||
'history_to': instance.historyTo?.toIso8601String(),
|
||||
'id': instance.id,
|
||||
'instrument_id': instance.instrumentId,
|
||||
'is_active': instance.isActive,
|
||||
'is_default': instance.isDefault,
|
||||
'kind': instance.kind,
|
||||
'name': instance.name,
|
||||
'source': instance.source_,
|
||||
};
|
||||
@@ -0,0 +1,170 @@
|
||||
//
|
||||
// AUTO-GENERATED FILE, DO NOT MODIFY!
|
||||
//
|
||||
|
||||
// ignore_for_file: unused_element
|
||||
import 'package:copy_with_extension/copy_with_extension.dart';
|
||||
import 'package:json_annotation/json_annotation.dart';
|
||||
|
||||
part 'benchmark_patch.g.dart';
|
||||
|
||||
|
||||
@CopyWith()
|
||||
@JsonSerializable(
|
||||
checked: true,
|
||||
createToJson: true,
|
||||
disallowUnrecognizedKeys: false,
|
||||
explicitToJson: true,
|
||||
)
|
||||
class BenchmarkPatch {
|
||||
/// Returns a new [BenchmarkPatch] instance.
|
||||
BenchmarkPatch({
|
||||
|
||||
this.code,
|
||||
|
||||
this.currency,
|
||||
|
||||
this.instrumentId,
|
||||
|
||||
this.isActive,
|
||||
|
||||
this.isDefault,
|
||||
|
||||
this.kind,
|
||||
|
||||
this.name,
|
||||
|
||||
this.source_,
|
||||
});
|
||||
|
||||
@JsonKey(
|
||||
|
||||
name: r'code',
|
||||
required: false,
|
||||
includeIfNull: false,
|
||||
)
|
||||
|
||||
|
||||
final String? code;
|
||||
|
||||
|
||||
|
||||
@JsonKey(
|
||||
|
||||
name: r'currency',
|
||||
required: false,
|
||||
includeIfNull: false,
|
||||
)
|
||||
|
||||
|
||||
final String? currency;
|
||||
|
||||
|
||||
|
||||
@JsonKey(
|
||||
|
||||
name: r'instrument_id',
|
||||
required: false,
|
||||
includeIfNull: false,
|
||||
)
|
||||
|
||||
|
||||
final int? instrumentId;
|
||||
|
||||
|
||||
|
||||
@JsonKey(
|
||||
|
||||
name: r'is_active',
|
||||
required: false,
|
||||
includeIfNull: false,
|
||||
)
|
||||
|
||||
|
||||
final bool? isActive;
|
||||
|
||||
|
||||
|
||||
@JsonKey(
|
||||
|
||||
name: r'is_default',
|
||||
required: false,
|
||||
includeIfNull: false,
|
||||
)
|
||||
|
||||
|
||||
final bool? isDefault;
|
||||
|
||||
|
||||
|
||||
@JsonKey(
|
||||
|
||||
name: r'kind',
|
||||
required: false,
|
||||
includeIfNull: false,
|
||||
)
|
||||
|
||||
|
||||
final String? kind;
|
||||
|
||||
|
||||
|
||||
@JsonKey(
|
||||
|
||||
name: r'name',
|
||||
required: false,
|
||||
includeIfNull: false,
|
||||
)
|
||||
|
||||
|
||||
final String? name;
|
||||
|
||||
|
||||
|
||||
@JsonKey(
|
||||
|
||||
name: r'source',
|
||||
required: false,
|
||||
includeIfNull: false,
|
||||
)
|
||||
|
||||
|
||||
final String? source_;
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
@override
|
||||
bool operator ==(Object other) => identical(this, other) || other is BenchmarkPatch &&
|
||||
other.code == code &&
|
||||
other.currency == currency &&
|
||||
other.instrumentId == instrumentId &&
|
||||
other.isActive == isActive &&
|
||||
other.isDefault == isDefault &&
|
||||
other.kind == kind &&
|
||||
other.name == name &&
|
||||
other.source_ == source_;
|
||||
|
||||
@override
|
||||
int get hashCode =>
|
||||
(code == null ? 0 : code.hashCode) +
|
||||
(currency == null ? 0 : currency.hashCode) +
|
||||
(instrumentId == null ? 0 : instrumentId.hashCode) +
|
||||
(isActive == null ? 0 : isActive.hashCode) +
|
||||
(isDefault == null ? 0 : isDefault.hashCode) +
|
||||
(kind == null ? 0 : kind.hashCode) +
|
||||
(name == null ? 0 : name.hashCode) +
|
||||
(source_ == null ? 0 : source_.hashCode);
|
||||
|
||||
factory BenchmarkPatch.fromJson(Map<String, dynamic> json) => _$BenchmarkPatchFromJson(json);
|
||||
|
||||
Map<String, dynamic> toJson() => _$BenchmarkPatchToJson(this);
|
||||
|
||||
@override
|
||||
String toString() {
|
||||
return toJson().toString();
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -0,0 +1,177 @@
|
||||
// GENERATED CODE - DO NOT MODIFY BY HAND
|
||||
|
||||
part of 'benchmark_patch.dart';
|
||||
|
||||
// **************************************************************************
|
||||
// CopyWithGenerator
|
||||
// **************************************************************************
|
||||
|
||||
abstract class _$BenchmarkPatchCWProxy {
|
||||
BenchmarkPatch code(String? code);
|
||||
|
||||
BenchmarkPatch currency(String? currency);
|
||||
|
||||
BenchmarkPatch instrumentId(int? instrumentId);
|
||||
|
||||
BenchmarkPatch isActive(bool? isActive);
|
||||
|
||||
BenchmarkPatch isDefault(bool? isDefault);
|
||||
|
||||
BenchmarkPatch kind(String? kind);
|
||||
|
||||
BenchmarkPatch name(String? name);
|
||||
|
||||
BenchmarkPatch source_(String? source_);
|
||||
|
||||
/// This function **does support** nullification of nullable fields. All `null` values passed to `non-nullable` fields will be ignored. You can also use `BenchmarkPatch(...).copyWith.fieldName(...)` to override fields one at a time with nullification support.
|
||||
///
|
||||
/// Usage
|
||||
/// ```dart
|
||||
/// BenchmarkPatch(...).copyWith(id: 12, name: "My name")
|
||||
/// ````
|
||||
BenchmarkPatch call({
|
||||
String? code,
|
||||
String? currency,
|
||||
int? instrumentId,
|
||||
bool? isActive,
|
||||
bool? isDefault,
|
||||
String? kind,
|
||||
String? name,
|
||||
String? source_,
|
||||
});
|
||||
}
|
||||
|
||||
/// Proxy class for `copyWith` functionality. This is a callable class and can be used as follows: `instanceOfBenchmarkPatch.copyWith(...)`. Additionally contains functions for specific fields e.g. `instanceOfBenchmarkPatch.copyWith.fieldName(...)`
|
||||
class _$BenchmarkPatchCWProxyImpl implements _$BenchmarkPatchCWProxy {
|
||||
const _$BenchmarkPatchCWProxyImpl(this._value);
|
||||
|
||||
final BenchmarkPatch _value;
|
||||
|
||||
@override
|
||||
BenchmarkPatch code(String? code) => this(code: code);
|
||||
|
||||
@override
|
||||
BenchmarkPatch currency(String? currency) => this(currency: currency);
|
||||
|
||||
@override
|
||||
BenchmarkPatch instrumentId(int? instrumentId) =>
|
||||
this(instrumentId: instrumentId);
|
||||
|
||||
@override
|
||||
BenchmarkPatch isActive(bool? isActive) => this(isActive: isActive);
|
||||
|
||||
@override
|
||||
BenchmarkPatch isDefault(bool? isDefault) => this(isDefault: isDefault);
|
||||
|
||||
@override
|
||||
BenchmarkPatch kind(String? kind) => this(kind: kind);
|
||||
|
||||
@override
|
||||
BenchmarkPatch name(String? name) => this(name: name);
|
||||
|
||||
@override
|
||||
BenchmarkPatch source_(String? source_) => this(source_: source_);
|
||||
|
||||
@override
|
||||
/// This function **does support** nullification of nullable fields. All `null` values passed to `non-nullable` fields will be ignored. You can also use `BenchmarkPatch(...).copyWith.fieldName(...)` to override fields one at a time with nullification support.
|
||||
///
|
||||
/// Usage
|
||||
/// ```dart
|
||||
/// BenchmarkPatch(...).copyWith(id: 12, name: "My name")
|
||||
/// ````
|
||||
BenchmarkPatch call({
|
||||
Object? code = const $CopyWithPlaceholder(),
|
||||
Object? currency = const $CopyWithPlaceholder(),
|
||||
Object? instrumentId = const $CopyWithPlaceholder(),
|
||||
Object? isActive = const $CopyWithPlaceholder(),
|
||||
Object? isDefault = const $CopyWithPlaceholder(),
|
||||
Object? kind = const $CopyWithPlaceholder(),
|
||||
Object? name = const $CopyWithPlaceholder(),
|
||||
Object? source_ = const $CopyWithPlaceholder(),
|
||||
}) {
|
||||
return BenchmarkPatch(
|
||||
code: code == const $CopyWithPlaceholder()
|
||||
? _value.code
|
||||
// ignore: cast_nullable_to_non_nullable
|
||||
: code as String?,
|
||||
currency: currency == const $CopyWithPlaceholder()
|
||||
? _value.currency
|
||||
// ignore: cast_nullable_to_non_nullable
|
||||
: currency as String?,
|
||||
instrumentId: instrumentId == const $CopyWithPlaceholder()
|
||||
? _value.instrumentId
|
||||
// ignore: cast_nullable_to_non_nullable
|
||||
: instrumentId as int?,
|
||||
isActive: isActive == const $CopyWithPlaceholder()
|
||||
? _value.isActive
|
||||
// ignore: cast_nullable_to_non_nullable
|
||||
: isActive as bool?,
|
||||
isDefault: isDefault == const $CopyWithPlaceholder()
|
||||
? _value.isDefault
|
||||
// ignore: cast_nullable_to_non_nullable
|
||||
: isDefault as bool?,
|
||||
kind: kind == const $CopyWithPlaceholder()
|
||||
? _value.kind
|
||||
// ignore: cast_nullable_to_non_nullable
|
||||
: kind as String?,
|
||||
name: name == const $CopyWithPlaceholder()
|
||||
? _value.name
|
||||
// ignore: cast_nullable_to_non_nullable
|
||||
: name as String?,
|
||||
source_: source_ == const $CopyWithPlaceholder()
|
||||
? _value.source_
|
||||
// ignore: cast_nullable_to_non_nullable
|
||||
: source_ as String?,
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
extension $BenchmarkPatchCopyWith on BenchmarkPatch {
|
||||
/// Returns a callable class that can be used as follows: `instanceOfBenchmarkPatch.copyWith(...)` or like so:`instanceOfBenchmarkPatch.copyWith.fieldName(...)`.
|
||||
// ignore: library_private_types_in_public_api
|
||||
_$BenchmarkPatchCWProxy get copyWith => _$BenchmarkPatchCWProxyImpl(this);
|
||||
}
|
||||
|
||||
// **************************************************************************
|
||||
// JsonSerializableGenerator
|
||||
// **************************************************************************
|
||||
|
||||
BenchmarkPatch _$BenchmarkPatchFromJson(Map<String, dynamic> json) =>
|
||||
$checkedCreate(
|
||||
'BenchmarkPatch',
|
||||
json,
|
||||
($checkedConvert) {
|
||||
final val = BenchmarkPatch(
|
||||
code: $checkedConvert('code', (v) => v as String?),
|
||||
currency: $checkedConvert('currency', (v) => v as String?),
|
||||
instrumentId: $checkedConvert(
|
||||
'instrument_id',
|
||||
(v) => (v as num?)?.toInt(),
|
||||
),
|
||||
isActive: $checkedConvert('is_active', (v) => v as bool?),
|
||||
isDefault: $checkedConvert('is_default', (v) => v as bool?),
|
||||
kind: $checkedConvert('kind', (v) => v as String?),
|
||||
name: $checkedConvert('name', (v) => v as String?),
|
||||
source_: $checkedConvert('source', (v) => v as String?),
|
||||
);
|
||||
return val;
|
||||
},
|
||||
fieldKeyMap: const {
|
||||
'instrumentId': 'instrument_id',
|
||||
'isActive': 'is_active',
|
||||
'isDefault': 'is_default',
|
||||
'source_': 'source',
|
||||
},
|
||||
);
|
||||
|
||||
Map<String, dynamic> _$BenchmarkPatchToJson(BenchmarkPatch instance) =>
|
||||
<String, dynamic>{
|
||||
'code': ?instance.code,
|
||||
'currency': ?instance.currency,
|
||||
'instrument_id': ?instance.instrumentId,
|
||||
'is_active': ?instance.isActive,
|
||||
'is_default': ?instance.isDefault,
|
||||
'kind': ?instance.kind,
|
||||
'name': ?instance.name,
|
||||
'source': ?instance.source_,
|
||||
};
|
||||
@@ -0,0 +1,173 @@
|
||||
//
|
||||
// AUTO-GENERATED FILE, DO NOT MODIFY!
|
||||
//
|
||||
|
||||
// ignore_for_file: unused_element
|
||||
import 'package:copy_with_extension/copy_with_extension.dart';
|
||||
import 'package:json_annotation/json_annotation.dart';
|
||||
|
||||
part 'benchmark_return_out.g.dart';
|
||||
|
||||
|
||||
@CopyWith()
|
||||
@JsonSerializable(
|
||||
checked: true,
|
||||
createToJson: true,
|
||||
disallowUnrecognizedKeys: false,
|
||||
explicitToJson: true,
|
||||
)
|
||||
class BenchmarkReturnOut {
|
||||
/// Returns a new [BenchmarkReturnOut] instance.
|
||||
BenchmarkReturnOut({
|
||||
|
||||
required this.benchmarkId,
|
||||
|
||||
required this.code,
|
||||
|
||||
required this.daysSkipped,
|
||||
|
||||
required this.excess,
|
||||
|
||||
required this.kind,
|
||||
|
||||
required this.name,
|
||||
|
||||
required this.twr,
|
||||
|
||||
required this.twrAnnualized,
|
||||
});
|
||||
|
||||
@JsonKey(
|
||||
|
||||
name: r'benchmark_id',
|
||||
required: true,
|
||||
includeIfNull: false,
|
||||
)
|
||||
|
||||
|
||||
final int benchmarkId;
|
||||
|
||||
|
||||
|
||||
@JsonKey(
|
||||
|
||||
name: r'code',
|
||||
required: true,
|
||||
includeIfNull: false,
|
||||
)
|
||||
|
||||
|
||||
final String code;
|
||||
|
||||
|
||||
|
||||
@JsonKey(
|
||||
|
||||
name: r'days_skipped',
|
||||
required: true,
|
||||
includeIfNull: false,
|
||||
)
|
||||
|
||||
|
||||
final int daysSkipped;
|
||||
|
||||
|
||||
|
||||
/// decimal as string
|
||||
@JsonKey(
|
||||
|
||||
name: r'excess',
|
||||
required: true,
|
||||
includeIfNull: true,
|
||||
)
|
||||
|
||||
|
||||
final String? excess;
|
||||
|
||||
|
||||
|
||||
@JsonKey(
|
||||
|
||||
name: r'kind',
|
||||
required: true,
|
||||
includeIfNull: false,
|
||||
)
|
||||
|
||||
|
||||
final String kind;
|
||||
|
||||
|
||||
|
||||
@JsonKey(
|
||||
|
||||
name: r'name',
|
||||
required: true,
|
||||
includeIfNull: false,
|
||||
)
|
||||
|
||||
|
||||
final String name;
|
||||
|
||||
|
||||
|
||||
/// decimal as string
|
||||
@JsonKey(
|
||||
|
||||
name: r'twr',
|
||||
required: true,
|
||||
includeIfNull: true,
|
||||
)
|
||||
|
||||
|
||||
final String? twr;
|
||||
|
||||
|
||||
|
||||
/// decimal as string
|
||||
@JsonKey(
|
||||
|
||||
name: r'twr_annualized',
|
||||
required: true,
|
||||
includeIfNull: true,
|
||||
)
|
||||
|
||||
|
||||
final String? twrAnnualized;
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
@override
|
||||
bool operator ==(Object other) => identical(this, other) || other is BenchmarkReturnOut &&
|
||||
other.benchmarkId == benchmarkId &&
|
||||
other.code == code &&
|
||||
other.daysSkipped == daysSkipped &&
|
||||
other.excess == excess &&
|
||||
other.kind == kind &&
|
||||
other.name == name &&
|
||||
other.twr == twr &&
|
||||
other.twrAnnualized == twrAnnualized;
|
||||
|
||||
@override
|
||||
int get hashCode =>
|
||||
benchmarkId.hashCode +
|
||||
code.hashCode +
|
||||
daysSkipped.hashCode +
|
||||
(excess == null ? 0 : excess.hashCode) +
|
||||
kind.hashCode +
|
||||
name.hashCode +
|
||||
(twr == null ? 0 : twr.hashCode) +
|
||||
(twrAnnualized == null ? 0 : twrAnnualized.hashCode);
|
||||
|
||||
factory BenchmarkReturnOut.fromJson(Map<String, dynamic> json) => _$BenchmarkReturnOutFromJson(json);
|
||||
|
||||
Map<String, dynamic> toJson() => _$BenchmarkReturnOutToJson(this);
|
||||
|
||||
@override
|
||||
String toString() {
|
||||
return toJson().toString();
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -0,0 +1,190 @@
|
||||
// GENERATED CODE - DO NOT MODIFY BY HAND
|
||||
|
||||
part of 'benchmark_return_out.dart';
|
||||
|
||||
// **************************************************************************
|
||||
// CopyWithGenerator
|
||||
// **************************************************************************
|
||||
|
||||
abstract class _$BenchmarkReturnOutCWProxy {
|
||||
BenchmarkReturnOut benchmarkId(int benchmarkId);
|
||||
|
||||
BenchmarkReturnOut code(String code);
|
||||
|
||||
BenchmarkReturnOut daysSkipped(int daysSkipped);
|
||||
|
||||
BenchmarkReturnOut excess(String? excess);
|
||||
|
||||
BenchmarkReturnOut kind(String kind);
|
||||
|
||||
BenchmarkReturnOut name(String name);
|
||||
|
||||
BenchmarkReturnOut twr(String? twr);
|
||||
|
||||
BenchmarkReturnOut twrAnnualized(String? twrAnnualized);
|
||||
|
||||
/// This function **does support** nullification of nullable fields. All `null` values passed to `non-nullable` fields will be ignored. You can also use `BenchmarkReturnOut(...).copyWith.fieldName(...)` to override fields one at a time with nullification support.
|
||||
///
|
||||
/// Usage
|
||||
/// ```dart
|
||||
/// BenchmarkReturnOut(...).copyWith(id: 12, name: "My name")
|
||||
/// ````
|
||||
BenchmarkReturnOut call({
|
||||
int benchmarkId,
|
||||
String code,
|
||||
int daysSkipped,
|
||||
String? excess,
|
||||
String kind,
|
||||
String name,
|
||||
String? twr,
|
||||
String? twrAnnualized,
|
||||
});
|
||||
}
|
||||
|
||||
/// Proxy class for `copyWith` functionality. This is a callable class and can be used as follows: `instanceOfBenchmarkReturnOut.copyWith(...)`. Additionally contains functions for specific fields e.g. `instanceOfBenchmarkReturnOut.copyWith.fieldName(...)`
|
||||
class _$BenchmarkReturnOutCWProxyImpl implements _$BenchmarkReturnOutCWProxy {
|
||||
const _$BenchmarkReturnOutCWProxyImpl(this._value);
|
||||
|
||||
final BenchmarkReturnOut _value;
|
||||
|
||||
@override
|
||||
BenchmarkReturnOut benchmarkId(int benchmarkId) =>
|
||||
this(benchmarkId: benchmarkId);
|
||||
|
||||
@override
|
||||
BenchmarkReturnOut code(String code) => this(code: code);
|
||||
|
||||
@override
|
||||
BenchmarkReturnOut daysSkipped(int daysSkipped) =>
|
||||
this(daysSkipped: daysSkipped);
|
||||
|
||||
@override
|
||||
BenchmarkReturnOut excess(String? excess) => this(excess: excess);
|
||||
|
||||
@override
|
||||
BenchmarkReturnOut kind(String kind) => this(kind: kind);
|
||||
|
||||
@override
|
||||
BenchmarkReturnOut name(String name) => this(name: name);
|
||||
|
||||
@override
|
||||
BenchmarkReturnOut twr(String? twr) => this(twr: twr);
|
||||
|
||||
@override
|
||||
BenchmarkReturnOut twrAnnualized(String? twrAnnualized) =>
|
||||
this(twrAnnualized: twrAnnualized);
|
||||
|
||||
@override
|
||||
/// This function **does support** nullification of nullable fields. All `null` values passed to `non-nullable` fields will be ignored. You can also use `BenchmarkReturnOut(...).copyWith.fieldName(...)` to override fields one at a time with nullification support.
|
||||
///
|
||||
/// Usage
|
||||
/// ```dart
|
||||
/// BenchmarkReturnOut(...).copyWith(id: 12, name: "My name")
|
||||
/// ````
|
||||
BenchmarkReturnOut call({
|
||||
Object? benchmarkId = const $CopyWithPlaceholder(),
|
||||
Object? code = const $CopyWithPlaceholder(),
|
||||
Object? daysSkipped = const $CopyWithPlaceholder(),
|
||||
Object? excess = const $CopyWithPlaceholder(),
|
||||
Object? kind = const $CopyWithPlaceholder(),
|
||||
Object? name = const $CopyWithPlaceholder(),
|
||||
Object? twr = const $CopyWithPlaceholder(),
|
||||
Object? twrAnnualized = const $CopyWithPlaceholder(),
|
||||
}) {
|
||||
return BenchmarkReturnOut(
|
||||
benchmarkId: benchmarkId == const $CopyWithPlaceholder()
|
||||
? _value.benchmarkId
|
||||
// ignore: cast_nullable_to_non_nullable
|
||||
: benchmarkId as int,
|
||||
code: code == const $CopyWithPlaceholder()
|
||||
? _value.code
|
||||
// ignore: cast_nullable_to_non_nullable
|
||||
: code as String,
|
||||
daysSkipped: daysSkipped == const $CopyWithPlaceholder()
|
||||
? _value.daysSkipped
|
||||
// ignore: cast_nullable_to_non_nullable
|
||||
: daysSkipped as int,
|
||||
excess: excess == const $CopyWithPlaceholder()
|
||||
? _value.excess
|
||||
// ignore: cast_nullable_to_non_nullable
|
||||
: excess as String?,
|
||||
kind: kind == const $CopyWithPlaceholder()
|
||||
? _value.kind
|
||||
// ignore: cast_nullable_to_non_nullable
|
||||
: kind as String,
|
||||
name: name == const $CopyWithPlaceholder()
|
||||
? _value.name
|
||||
// ignore: cast_nullable_to_non_nullable
|
||||
: name as String,
|
||||
twr: twr == const $CopyWithPlaceholder()
|
||||
? _value.twr
|
||||
// ignore: cast_nullable_to_non_nullable
|
||||
: twr as String?,
|
||||
twrAnnualized: twrAnnualized == const $CopyWithPlaceholder()
|
||||
? _value.twrAnnualized
|
||||
// ignore: cast_nullable_to_non_nullable
|
||||
: twrAnnualized as String?,
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
extension $BenchmarkReturnOutCopyWith on BenchmarkReturnOut {
|
||||
/// Returns a callable class that can be used as follows: `instanceOfBenchmarkReturnOut.copyWith(...)` or like so:`instanceOfBenchmarkReturnOut.copyWith.fieldName(...)`.
|
||||
// ignore: library_private_types_in_public_api
|
||||
_$BenchmarkReturnOutCWProxy get copyWith =>
|
||||
_$BenchmarkReturnOutCWProxyImpl(this);
|
||||
}
|
||||
|
||||
// **************************************************************************
|
||||
// JsonSerializableGenerator
|
||||
// **************************************************************************
|
||||
|
||||
BenchmarkReturnOut _$BenchmarkReturnOutFromJson(
|
||||
Map<String, dynamic> json,
|
||||
) => $checkedCreate(
|
||||
'BenchmarkReturnOut',
|
||||
json,
|
||||
($checkedConvert) {
|
||||
$checkKeys(
|
||||
json,
|
||||
requiredKeys: const [
|
||||
'benchmark_id',
|
||||
'code',
|
||||
'days_skipped',
|
||||
'excess',
|
||||
'kind',
|
||||
'name',
|
||||
'twr',
|
||||
'twr_annualized',
|
||||
],
|
||||
);
|
||||
final val = BenchmarkReturnOut(
|
||||
benchmarkId: $checkedConvert('benchmark_id', (v) => (v as num).toInt()),
|
||||
code: $checkedConvert('code', (v) => v as String),
|
||||
daysSkipped: $checkedConvert('days_skipped', (v) => (v as num).toInt()),
|
||||
excess: $checkedConvert('excess', (v) => v as String?),
|
||||
kind: $checkedConvert('kind', (v) => v as String),
|
||||
name: $checkedConvert('name', (v) => v as String),
|
||||
twr: $checkedConvert('twr', (v) => v as String?),
|
||||
twrAnnualized: $checkedConvert('twr_annualized', (v) => v as String?),
|
||||
);
|
||||
return val;
|
||||
},
|
||||
fieldKeyMap: const {
|
||||
'benchmarkId': 'benchmark_id',
|
||||
'daysSkipped': 'days_skipped',
|
||||
'twrAnnualized': 'twr_annualized',
|
||||
},
|
||||
);
|
||||
|
||||
Map<String, dynamic> _$BenchmarkReturnOutToJson(BenchmarkReturnOut instance) =>
|
||||
<String, dynamic>{
|
||||
'benchmark_id': instance.benchmarkId,
|
||||
'code': instance.code,
|
||||
'days_skipped': instance.daysSkipped,
|
||||
'excess': instance.excess,
|
||||
'kind': instance.kind,
|
||||
'name': instance.name,
|
||||
'twr': instance.twr,
|
||||
'twr_annualized': instance.twrAnnualized,
|
||||
};
|
||||
@@ -0,0 +1,255 @@
|
||||
//
|
||||
// AUTO-GENERATED FILE, DO NOT MODIFY!
|
||||
//
|
||||
|
||||
// ignore_for_file: unused_element
|
||||
import 'package:copy_with_extension/copy_with_extension.dart';
|
||||
import 'package:json_annotation/json_annotation.dart';
|
||||
|
||||
part 'calendar_entry.g.dart';
|
||||
|
||||
|
||||
@CopyWith()
|
||||
@JsonSerializable(
|
||||
checked: true,
|
||||
createToJson: true,
|
||||
disallowUnrecognizedKeys: false,
|
||||
explicitToJson: true,
|
||||
)
|
||||
class CalendarEntry {
|
||||
/// Returns a new [CalendarEntry] instance.
|
||||
CalendarEntry({
|
||||
|
||||
required this.amount,
|
||||
|
||||
required this.amountRub,
|
||||
|
||||
required this.basis,
|
||||
|
||||
required this.currency,
|
||||
|
||||
required this.expectedDate,
|
||||
|
||||
required this.instrumentId,
|
||||
|
||||
required this.kind,
|
||||
|
||||
required this.name,
|
||||
|
||||
required this.perUnit,
|
||||
|
||||
required this.qty,
|
||||
|
||||
required this.recordDate,
|
||||
|
||||
required this.taxWithheld,
|
||||
|
||||
required this.ticker,
|
||||
});
|
||||
|
||||
/// decimal as string
|
||||
@JsonKey(
|
||||
|
||||
name: r'amount',
|
||||
required: true,
|
||||
includeIfNull: false,
|
||||
)
|
||||
|
||||
|
||||
final String amount;
|
||||
|
||||
|
||||
|
||||
/// decimal as string
|
||||
@JsonKey(
|
||||
|
||||
name: r'amount_rub',
|
||||
required: true,
|
||||
includeIfNull: true,
|
||||
)
|
||||
|
||||
|
||||
final String? amountRub;
|
||||
|
||||
|
||||
|
||||
@JsonKey(
|
||||
|
||||
name: r'basis',
|
||||
required: true,
|
||||
includeIfNull: false,
|
||||
)
|
||||
|
||||
|
||||
final String basis;
|
||||
|
||||
|
||||
|
||||
@JsonKey(
|
||||
|
||||
name: r'currency',
|
||||
required: true,
|
||||
includeIfNull: false,
|
||||
)
|
||||
|
||||
|
||||
final String currency;
|
||||
|
||||
|
||||
|
||||
@JsonKey(
|
||||
|
||||
name: r'expected_date',
|
||||
required: true,
|
||||
includeIfNull: false,
|
||||
)
|
||||
|
||||
|
||||
final DateTime expectedDate;
|
||||
|
||||
|
||||
|
||||
@JsonKey(
|
||||
|
||||
name: r'instrument_id',
|
||||
required: true,
|
||||
includeIfNull: false,
|
||||
)
|
||||
|
||||
|
||||
final int instrumentId;
|
||||
|
||||
|
||||
|
||||
@JsonKey(
|
||||
|
||||
name: r'kind',
|
||||
required: true,
|
||||
includeIfNull: false,
|
||||
)
|
||||
|
||||
|
||||
final String kind;
|
||||
|
||||
|
||||
|
||||
@JsonKey(
|
||||
|
||||
name: r'name',
|
||||
required: true,
|
||||
includeIfNull: false,
|
||||
)
|
||||
|
||||
|
||||
final String name;
|
||||
|
||||
|
||||
|
||||
/// decimal as string
|
||||
@JsonKey(
|
||||
|
||||
name: r'per_unit',
|
||||
required: true,
|
||||
includeIfNull: true,
|
||||
)
|
||||
|
||||
|
||||
final String? perUnit;
|
||||
|
||||
|
||||
|
||||
/// decimal as string
|
||||
@JsonKey(
|
||||
|
||||
name: r'qty',
|
||||
required: true,
|
||||
includeIfNull: false,
|
||||
)
|
||||
|
||||
|
||||
final String qty;
|
||||
|
||||
|
||||
|
||||
@JsonKey(
|
||||
|
||||
name: r'record_date',
|
||||
required: true,
|
||||
includeIfNull: true,
|
||||
)
|
||||
|
||||
|
||||
final DateTime? recordDate;
|
||||
|
||||
|
||||
|
||||
/// decimal as string
|
||||
@JsonKey(
|
||||
|
||||
name: r'tax_withheld',
|
||||
required: true,
|
||||
includeIfNull: true,
|
||||
)
|
||||
|
||||
|
||||
final String? taxWithheld;
|
||||
|
||||
|
||||
|
||||
@JsonKey(
|
||||
|
||||
name: r'ticker',
|
||||
required: true,
|
||||
includeIfNull: true,
|
||||
)
|
||||
|
||||
|
||||
final String? ticker;
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
@override
|
||||
bool operator ==(Object other) => identical(this, other) || other is CalendarEntry &&
|
||||
other.amount == amount &&
|
||||
other.amountRub == amountRub &&
|
||||
other.basis == basis &&
|
||||
other.currency == currency &&
|
||||
other.expectedDate == expectedDate &&
|
||||
other.instrumentId == instrumentId &&
|
||||
other.kind == kind &&
|
||||
other.name == name &&
|
||||
other.perUnit == perUnit &&
|
||||
other.qty == qty &&
|
||||
other.recordDate == recordDate &&
|
||||
other.taxWithheld == taxWithheld &&
|
||||
other.ticker == ticker;
|
||||
|
||||
@override
|
||||
int get hashCode =>
|
||||
amount.hashCode +
|
||||
(amountRub == null ? 0 : amountRub.hashCode) +
|
||||
basis.hashCode +
|
||||
currency.hashCode +
|
||||
expectedDate.hashCode +
|
||||
instrumentId.hashCode +
|
||||
kind.hashCode +
|
||||
name.hashCode +
|
||||
(perUnit == null ? 0 : perUnit.hashCode) +
|
||||
qty.hashCode +
|
||||
(recordDate == null ? 0 : recordDate.hashCode) +
|
||||
(taxWithheld == null ? 0 : taxWithheld.hashCode) +
|
||||
(ticker == null ? 0 : ticker.hashCode);
|
||||
|
||||
factory CalendarEntry.fromJson(Map<String, dynamic> json) => _$CalendarEntryFromJson(json);
|
||||
|
||||
Map<String, dynamic> toJson() => _$CalendarEntryToJson(this);
|
||||
|
||||
@override
|
||||
String toString() {
|
||||
return toJson().toString();
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -0,0 +1,271 @@
|
||||
// GENERATED CODE - DO NOT MODIFY BY HAND
|
||||
|
||||
part of 'calendar_entry.dart';
|
||||
|
||||
// **************************************************************************
|
||||
// CopyWithGenerator
|
||||
// **************************************************************************
|
||||
|
||||
abstract class _$CalendarEntryCWProxy {
|
||||
CalendarEntry amount(String amount);
|
||||
|
||||
CalendarEntry amountRub(String? amountRub);
|
||||
|
||||
CalendarEntry basis(String basis);
|
||||
|
||||
CalendarEntry currency(String currency);
|
||||
|
||||
CalendarEntry expectedDate(DateTime expectedDate);
|
||||
|
||||
CalendarEntry instrumentId(int instrumentId);
|
||||
|
||||
CalendarEntry kind(String kind);
|
||||
|
||||
CalendarEntry name(String name);
|
||||
|
||||
CalendarEntry perUnit(String? perUnit);
|
||||
|
||||
CalendarEntry qty(String qty);
|
||||
|
||||
CalendarEntry recordDate(DateTime? recordDate);
|
||||
|
||||
CalendarEntry taxWithheld(String? taxWithheld);
|
||||
|
||||
CalendarEntry ticker(String? ticker);
|
||||
|
||||
/// This function **does support** nullification of nullable fields. All `null` values passed to `non-nullable` fields will be ignored. You can also use `CalendarEntry(...).copyWith.fieldName(...)` to override fields one at a time with nullification support.
|
||||
///
|
||||
/// Usage
|
||||
/// ```dart
|
||||
/// CalendarEntry(...).copyWith(id: 12, name: "My name")
|
||||
/// ````
|
||||
CalendarEntry call({
|
||||
String amount,
|
||||
String? amountRub,
|
||||
String basis,
|
||||
String currency,
|
||||
DateTime expectedDate,
|
||||
int instrumentId,
|
||||
String kind,
|
||||
String name,
|
||||
String? perUnit,
|
||||
String qty,
|
||||
DateTime? recordDate,
|
||||
String? taxWithheld,
|
||||
String? ticker,
|
||||
});
|
||||
}
|
||||
|
||||
/// Proxy class for `copyWith` functionality. This is a callable class and can be used as follows: `instanceOfCalendarEntry.copyWith(...)`. Additionally contains functions for specific fields e.g. `instanceOfCalendarEntry.copyWith.fieldName(...)`
|
||||
class _$CalendarEntryCWProxyImpl implements _$CalendarEntryCWProxy {
|
||||
const _$CalendarEntryCWProxyImpl(this._value);
|
||||
|
||||
final CalendarEntry _value;
|
||||
|
||||
@override
|
||||
CalendarEntry amount(String amount) => this(amount: amount);
|
||||
|
||||
@override
|
||||
CalendarEntry amountRub(String? amountRub) => this(amountRub: amountRub);
|
||||
|
||||
@override
|
||||
CalendarEntry basis(String basis) => this(basis: basis);
|
||||
|
||||
@override
|
||||
CalendarEntry currency(String currency) => this(currency: currency);
|
||||
|
||||
@override
|
||||
CalendarEntry expectedDate(DateTime expectedDate) =>
|
||||
this(expectedDate: expectedDate);
|
||||
|
||||
@override
|
||||
CalendarEntry instrumentId(int instrumentId) =>
|
||||
this(instrumentId: instrumentId);
|
||||
|
||||
@override
|
||||
CalendarEntry kind(String kind) => this(kind: kind);
|
||||
|
||||
@override
|
||||
CalendarEntry name(String name) => this(name: name);
|
||||
|
||||
@override
|
||||
CalendarEntry perUnit(String? perUnit) => this(perUnit: perUnit);
|
||||
|
||||
@override
|
||||
CalendarEntry qty(String qty) => this(qty: qty);
|
||||
|
||||
@override
|
||||
CalendarEntry recordDate(DateTime? recordDate) =>
|
||||
this(recordDate: recordDate);
|
||||
|
||||
@override
|
||||
CalendarEntry taxWithheld(String? taxWithheld) =>
|
||||
this(taxWithheld: taxWithheld);
|
||||
|
||||
@override
|
||||
CalendarEntry ticker(String? ticker) => this(ticker: ticker);
|
||||
|
||||
@override
|
||||
/// This function **does support** nullification of nullable fields. All `null` values passed to `non-nullable` fields will be ignored. You can also use `CalendarEntry(...).copyWith.fieldName(...)` to override fields one at a time with nullification support.
|
||||
///
|
||||
/// Usage
|
||||
/// ```dart
|
||||
/// CalendarEntry(...).copyWith(id: 12, name: "My name")
|
||||
/// ````
|
||||
CalendarEntry call({
|
||||
Object? amount = const $CopyWithPlaceholder(),
|
||||
Object? amountRub = const $CopyWithPlaceholder(),
|
||||
Object? basis = const $CopyWithPlaceholder(),
|
||||
Object? currency = const $CopyWithPlaceholder(),
|
||||
Object? expectedDate = const $CopyWithPlaceholder(),
|
||||
Object? instrumentId = const $CopyWithPlaceholder(),
|
||||
Object? kind = const $CopyWithPlaceholder(),
|
||||
Object? name = const $CopyWithPlaceholder(),
|
||||
Object? perUnit = const $CopyWithPlaceholder(),
|
||||
Object? qty = const $CopyWithPlaceholder(),
|
||||
Object? recordDate = const $CopyWithPlaceholder(),
|
||||
Object? taxWithheld = const $CopyWithPlaceholder(),
|
||||
Object? ticker = const $CopyWithPlaceholder(),
|
||||
}) {
|
||||
return CalendarEntry(
|
||||
amount: amount == const $CopyWithPlaceholder()
|
||||
? _value.amount
|
||||
// ignore: cast_nullable_to_non_nullable
|
||||
: amount as String,
|
||||
amountRub: amountRub == const $CopyWithPlaceholder()
|
||||
? _value.amountRub
|
||||
// ignore: cast_nullable_to_non_nullable
|
||||
: amountRub as String?,
|
||||
basis: basis == const $CopyWithPlaceholder()
|
||||
? _value.basis
|
||||
// ignore: cast_nullable_to_non_nullable
|
||||
: basis as String,
|
||||
currency: currency == const $CopyWithPlaceholder()
|
||||
? _value.currency
|
||||
// ignore: cast_nullable_to_non_nullable
|
||||
: currency as String,
|
||||
expectedDate: expectedDate == const $CopyWithPlaceholder()
|
||||
? _value.expectedDate
|
||||
// ignore: cast_nullable_to_non_nullable
|
||||
: expectedDate as DateTime,
|
||||
instrumentId: instrumentId == const $CopyWithPlaceholder()
|
||||
? _value.instrumentId
|
||||
// ignore: cast_nullable_to_non_nullable
|
||||
: instrumentId as int,
|
||||
kind: kind == const $CopyWithPlaceholder()
|
||||
? _value.kind
|
||||
// ignore: cast_nullable_to_non_nullable
|
||||
: kind as String,
|
||||
name: name == const $CopyWithPlaceholder()
|
||||
? _value.name
|
||||
// ignore: cast_nullable_to_non_nullable
|
||||
: name as String,
|
||||
perUnit: perUnit == const $CopyWithPlaceholder()
|
||||
? _value.perUnit
|
||||
// ignore: cast_nullable_to_non_nullable
|
||||
: perUnit as String?,
|
||||
qty: qty == const $CopyWithPlaceholder()
|
||||
? _value.qty
|
||||
// ignore: cast_nullable_to_non_nullable
|
||||
: qty as String,
|
||||
recordDate: recordDate == const $CopyWithPlaceholder()
|
||||
? _value.recordDate
|
||||
// ignore: cast_nullable_to_non_nullable
|
||||
: recordDate as DateTime?,
|
||||
taxWithheld: taxWithheld == const $CopyWithPlaceholder()
|
||||
? _value.taxWithheld
|
||||
// ignore: cast_nullable_to_non_nullable
|
||||
: taxWithheld as String?,
|
||||
ticker: ticker == const $CopyWithPlaceholder()
|
||||
? _value.ticker
|
||||
// ignore: cast_nullable_to_non_nullable
|
||||
: ticker as String?,
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
extension $CalendarEntryCopyWith on CalendarEntry {
|
||||
/// Returns a callable class that can be used as follows: `instanceOfCalendarEntry.copyWith(...)` or like so:`instanceOfCalendarEntry.copyWith.fieldName(...)`.
|
||||
// ignore: library_private_types_in_public_api
|
||||
_$CalendarEntryCWProxy get copyWith => _$CalendarEntryCWProxyImpl(this);
|
||||
}
|
||||
|
||||
// **************************************************************************
|
||||
// JsonSerializableGenerator
|
||||
// **************************************************************************
|
||||
|
||||
CalendarEntry _$CalendarEntryFromJson(Map<String, dynamic> json) =>
|
||||
$checkedCreate(
|
||||
'CalendarEntry',
|
||||
json,
|
||||
($checkedConvert) {
|
||||
$checkKeys(
|
||||
json,
|
||||
requiredKeys: const [
|
||||
'amount',
|
||||
'amount_rub',
|
||||
'basis',
|
||||
'currency',
|
||||
'expected_date',
|
||||
'instrument_id',
|
||||
'kind',
|
||||
'name',
|
||||
'per_unit',
|
||||
'qty',
|
||||
'record_date',
|
||||
'tax_withheld',
|
||||
'ticker',
|
||||
],
|
||||
);
|
||||
final val = CalendarEntry(
|
||||
amount: $checkedConvert('amount', (v) => v as String),
|
||||
amountRub: $checkedConvert('amount_rub', (v) => v as String?),
|
||||
basis: $checkedConvert('basis', (v) => v as String),
|
||||
currency: $checkedConvert('currency', (v) => v as String),
|
||||
expectedDate: $checkedConvert(
|
||||
'expected_date',
|
||||
(v) => DateTime.parse(v as String),
|
||||
),
|
||||
instrumentId: $checkedConvert(
|
||||
'instrument_id',
|
||||
(v) => (v as num).toInt(),
|
||||
),
|
||||
kind: $checkedConvert('kind', (v) => v as String),
|
||||
name: $checkedConvert('name', (v) => v as String),
|
||||
perUnit: $checkedConvert('per_unit', (v) => v as String?),
|
||||
qty: $checkedConvert('qty', (v) => v as String),
|
||||
recordDate: $checkedConvert(
|
||||
'record_date',
|
||||
(v) => v == null ? null : DateTime.parse(v as String),
|
||||
),
|
||||
taxWithheld: $checkedConvert('tax_withheld', (v) => v as String?),
|
||||
ticker: $checkedConvert('ticker', (v) => v as String?),
|
||||
);
|
||||
return val;
|
||||
},
|
||||
fieldKeyMap: const {
|
||||
'amountRub': 'amount_rub',
|
||||
'expectedDate': 'expected_date',
|
||||
'instrumentId': 'instrument_id',
|
||||
'perUnit': 'per_unit',
|
||||
'recordDate': 'record_date',
|
||||
'taxWithheld': 'tax_withheld',
|
||||
},
|
||||
);
|
||||
|
||||
Map<String, dynamic> _$CalendarEntryToJson(CalendarEntry instance) =>
|
||||
<String, dynamic>{
|
||||
'amount': instance.amount,
|
||||
'amount_rub': instance.amountRub,
|
||||
'basis': instance.basis,
|
||||
'currency': instance.currency,
|
||||
'expected_date': instance.expectedDate.toIso8601String(),
|
||||
'instrument_id': instance.instrumentId,
|
||||
'kind': instance.kind,
|
||||
'name': instance.name,
|
||||
'per_unit': instance.perUnit,
|
||||
'qty': instance.qty,
|
||||
'record_date': instance.recordDate?.toIso8601String(),
|
||||
'tax_withheld': instance.taxWithheld,
|
||||
'ticker': instance.ticker,
|
||||
};
|
||||
@@ -0,0 +1,124 @@
|
||||
//
|
||||
// AUTO-GENERATED FILE, DO NOT MODIFY!
|
||||
//
|
||||
|
||||
// ignore_for_file: unused_element
|
||||
import 'package:fintracker_api/src/model/calendar_entry.dart';
|
||||
import 'package:copy_with_extension/copy_with_extension.dart';
|
||||
import 'package:json_annotation/json_annotation.dart';
|
||||
|
||||
part 'calendar_out.g.dart';
|
||||
|
||||
|
||||
@CopyWith()
|
||||
@JsonSerializable(
|
||||
checked: true,
|
||||
createToJson: true,
|
||||
disallowUnrecognizedKeys: false,
|
||||
explicitToJson: true,
|
||||
)
|
||||
class CalendarOut {
|
||||
/// Returns a new [CalendarOut] instance.
|
||||
CalendarOut({
|
||||
|
||||
required this.asOf,
|
||||
|
||||
required this.byBasis,
|
||||
|
||||
required this.currency,
|
||||
|
||||
required this.entries,
|
||||
|
||||
required this.totalExpectedRub,
|
||||
});
|
||||
|
||||
@JsonKey(
|
||||
|
||||
name: r'as_of',
|
||||
required: true,
|
||||
includeIfNull: false,
|
||||
)
|
||||
|
||||
|
||||
final DateTime asOf;
|
||||
|
||||
|
||||
|
||||
@JsonKey(
|
||||
|
||||
name: r'by_basis',
|
||||
required: true,
|
||||
includeIfNull: false,
|
||||
)
|
||||
|
||||
|
||||
final Map<String, String> byBasis;
|
||||
|
||||
|
||||
|
||||
@JsonKey(
|
||||
|
||||
name: r'currency',
|
||||
required: true,
|
||||
includeIfNull: false,
|
||||
)
|
||||
|
||||
|
||||
final String currency;
|
||||
|
||||
|
||||
|
||||
@JsonKey(
|
||||
|
||||
name: r'entries',
|
||||
required: true,
|
||||
includeIfNull: false,
|
||||
)
|
||||
|
||||
|
||||
final List<CalendarEntry> entries;
|
||||
|
||||
|
||||
|
||||
/// decimal as string
|
||||
@JsonKey(
|
||||
|
||||
name: r'total_expected_rub',
|
||||
required: true,
|
||||
includeIfNull: false,
|
||||
)
|
||||
|
||||
|
||||
final String totalExpectedRub;
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
@override
|
||||
bool operator ==(Object other) => identical(this, other) || other is CalendarOut &&
|
||||
other.asOf == asOf &&
|
||||
other.byBasis == byBasis &&
|
||||
other.currency == currency &&
|
||||
other.entries == entries &&
|
||||
other.totalExpectedRub == totalExpectedRub;
|
||||
|
||||
@override
|
||||
int get hashCode =>
|
||||
asOf.hashCode +
|
||||
byBasis.hashCode +
|
||||
currency.hashCode +
|
||||
entries.hashCode +
|
||||
totalExpectedRub.hashCode;
|
||||
|
||||
factory CalendarOut.fromJson(Map<String, dynamic> json) => _$CalendarOutFromJson(json);
|
||||
|
||||
Map<String, dynamic> toJson() => _$CalendarOutToJson(this);
|
||||
|
||||
@override
|
||||
String toString() {
|
||||
return toJson().toString();
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -0,0 +1,154 @@
|
||||
// GENERATED CODE - DO NOT MODIFY BY HAND
|
||||
|
||||
part of 'calendar_out.dart';
|
||||
|
||||
// **************************************************************************
|
||||
// CopyWithGenerator
|
||||
// **************************************************************************
|
||||
|
||||
abstract class _$CalendarOutCWProxy {
|
||||
CalendarOut asOf(DateTime asOf);
|
||||
|
||||
CalendarOut byBasis(Map<String, String> byBasis);
|
||||
|
||||
CalendarOut currency(String currency);
|
||||
|
||||
CalendarOut entries(List<CalendarEntry> entries);
|
||||
|
||||
CalendarOut totalExpectedRub(String totalExpectedRub);
|
||||
|
||||
/// This function **does support** nullification of nullable fields. All `null` values passed to `non-nullable` fields will be ignored. You can also use `CalendarOut(...).copyWith.fieldName(...)` to override fields one at a time with nullification support.
|
||||
///
|
||||
/// Usage
|
||||
/// ```dart
|
||||
/// CalendarOut(...).copyWith(id: 12, name: "My name")
|
||||
/// ````
|
||||
CalendarOut call({
|
||||
DateTime asOf,
|
||||
Map<String, String> byBasis,
|
||||
String currency,
|
||||
List<CalendarEntry> entries,
|
||||
String totalExpectedRub,
|
||||
});
|
||||
}
|
||||
|
||||
/// Proxy class for `copyWith` functionality. This is a callable class and can be used as follows: `instanceOfCalendarOut.copyWith(...)`. Additionally contains functions for specific fields e.g. `instanceOfCalendarOut.copyWith.fieldName(...)`
|
||||
class _$CalendarOutCWProxyImpl implements _$CalendarOutCWProxy {
|
||||
const _$CalendarOutCWProxyImpl(this._value);
|
||||
|
||||
final CalendarOut _value;
|
||||
|
||||
@override
|
||||
CalendarOut asOf(DateTime asOf) => this(asOf: asOf);
|
||||
|
||||
@override
|
||||
CalendarOut byBasis(Map<String, String> byBasis) => this(byBasis: byBasis);
|
||||
|
||||
@override
|
||||
CalendarOut currency(String currency) => this(currency: currency);
|
||||
|
||||
@override
|
||||
CalendarOut entries(List<CalendarEntry> entries) => this(entries: entries);
|
||||
|
||||
@override
|
||||
CalendarOut totalExpectedRub(String totalExpectedRub) =>
|
||||
this(totalExpectedRub: totalExpectedRub);
|
||||
|
||||
@override
|
||||
/// This function **does support** nullification of nullable fields. All `null` values passed to `non-nullable` fields will be ignored. You can also use `CalendarOut(...).copyWith.fieldName(...)` to override fields one at a time with nullification support.
|
||||
///
|
||||
/// Usage
|
||||
/// ```dart
|
||||
/// CalendarOut(...).copyWith(id: 12, name: "My name")
|
||||
/// ````
|
||||
CalendarOut call({
|
||||
Object? asOf = const $CopyWithPlaceholder(),
|
||||
Object? byBasis = const $CopyWithPlaceholder(),
|
||||
Object? currency = const $CopyWithPlaceholder(),
|
||||
Object? entries = const $CopyWithPlaceholder(),
|
||||
Object? totalExpectedRub = const $CopyWithPlaceholder(),
|
||||
}) {
|
||||
return CalendarOut(
|
||||
asOf: asOf == const $CopyWithPlaceholder()
|
||||
? _value.asOf
|
||||
// ignore: cast_nullable_to_non_nullable
|
||||
: asOf as DateTime,
|
||||
byBasis: byBasis == const $CopyWithPlaceholder()
|
||||
? _value.byBasis
|
||||
// ignore: cast_nullable_to_non_nullable
|
||||
: byBasis as Map<String, String>,
|
||||
currency: currency == const $CopyWithPlaceholder()
|
||||
? _value.currency
|
||||
// ignore: cast_nullable_to_non_nullable
|
||||
: currency as String,
|
||||
entries: entries == const $CopyWithPlaceholder()
|
||||
? _value.entries
|
||||
// ignore: cast_nullable_to_non_nullable
|
||||
: entries as List<CalendarEntry>,
|
||||
totalExpectedRub: totalExpectedRub == const $CopyWithPlaceholder()
|
||||
? _value.totalExpectedRub
|
||||
// ignore: cast_nullable_to_non_nullable
|
||||
: totalExpectedRub as String,
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
extension $CalendarOutCopyWith on CalendarOut {
|
||||
/// Returns a callable class that can be used as follows: `instanceOfCalendarOut.copyWith(...)` or like so:`instanceOfCalendarOut.copyWith.fieldName(...)`.
|
||||
// ignore: library_private_types_in_public_api
|
||||
_$CalendarOutCWProxy get copyWith => _$CalendarOutCWProxyImpl(this);
|
||||
}
|
||||
|
||||
// **************************************************************************
|
||||
// JsonSerializableGenerator
|
||||
// **************************************************************************
|
||||
|
||||
CalendarOut _$CalendarOutFromJson(Map<String, dynamic> json) => $checkedCreate(
|
||||
'CalendarOut',
|
||||
json,
|
||||
($checkedConvert) {
|
||||
$checkKeys(
|
||||
json,
|
||||
requiredKeys: const [
|
||||
'as_of',
|
||||
'by_basis',
|
||||
'currency',
|
||||
'entries',
|
||||
'total_expected_rub',
|
||||
],
|
||||
);
|
||||
final val = CalendarOut(
|
||||
asOf: $checkedConvert('as_of', (v) => DateTime.parse(v as String)),
|
||||
byBasis: $checkedConvert(
|
||||
'by_basis',
|
||||
(v) => Map<String, String>.from(v as Map),
|
||||
),
|
||||
currency: $checkedConvert('currency', (v) => v as String),
|
||||
entries: $checkedConvert(
|
||||
'entries',
|
||||
(v) => (v as List<dynamic>)
|
||||
.map((e) => CalendarEntry.fromJson(e as Map<String, dynamic>))
|
||||
.toList(),
|
||||
),
|
||||
totalExpectedRub: $checkedConvert(
|
||||
'total_expected_rub',
|
||||
(v) => v as String,
|
||||
),
|
||||
);
|
||||
return val;
|
||||
},
|
||||
fieldKeyMap: const {
|
||||
'asOf': 'as_of',
|
||||
'byBasis': 'by_basis',
|
||||
'totalExpectedRub': 'total_expected_rub',
|
||||
},
|
||||
);
|
||||
|
||||
Map<String, dynamic> _$CalendarOutToJson(CalendarOut instance) =>
|
||||
<String, dynamic>{
|
||||
'as_of': instance.asOf.toIso8601String(),
|
||||
'by_basis': instance.byBasis,
|
||||
'currency': instance.currency,
|
||||
'entries': instance.entries.map((e) => e.toJson()).toList(),
|
||||
'total_expected_rub': instance.totalExpectedRub,
|
||||
};
|
||||
@@ -0,0 +1,42 @@
|
||||
//
|
||||
// AUTO-GENERATED FILE, DO NOT MODIFY!
|
||||
//
|
||||
|
||||
// ignore_for_file: unused_element
|
||||
import 'package:copy_with_extension/copy_with_extension.dart';
|
||||
import 'package:json_annotation/json_annotation.dart';
|
||||
|
||||
part 'cash_available.g.dart';
|
||||
|
||||
|
||||
@CopyWith()
|
||||
@JsonSerializable(
|
||||
checked: true,
|
||||
createToJson: true,
|
||||
disallowUnrecognizedKeys: false,
|
||||
explicitToJson: true,
|
||||
)
|
||||
class CashAvailable {
|
||||
/// Returns a new [CashAvailable] instance.
|
||||
CashAvailable({
|
||||
});
|
||||
|
||||
|
||||
|
||||
@override
|
||||
bool operator ==(Object other) => identical(this, other) || other is CashAvailable &&
|
||||
|
||||
@override
|
||||
int get hashCode =>
|
||||
|
||||
factory CashAvailable.fromJson(Map<String, dynamic> json) => _$CashAvailableFromJson(json);
|
||||
|
||||
Map<String, dynamic> toJson() => _$CashAvailableToJson(this);
|
||||
|
||||
@override
|
||||
String toString() {
|
||||
return toJson().toString();
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -0,0 +1,125 @@
|
||||
//
|
||||
// AUTO-GENERATED FILE, DO NOT MODIFY!
|
||||
//
|
||||
|
||||
// ignore_for_file: unused_element
|
||||
import 'package:copy_with_extension/copy_with_extension.dart';
|
||||
import 'package:json_annotation/json_annotation.dart';
|
||||
|
||||
part 'cash_flow_broker_month.g.dart';
|
||||
|
||||
|
||||
@CopyWith()
|
||||
@JsonSerializable(
|
||||
checked: true,
|
||||
createToJson: true,
|
||||
disallowUnrecognizedKeys: false,
|
||||
explicitToJson: true,
|
||||
)
|
||||
class CashFlowBrokerMonth {
|
||||
/// Returns a new [CashFlowBrokerMonth] instance.
|
||||
CashFlowBrokerMonth({
|
||||
|
||||
required this.depositsRub,
|
||||
|
||||
required this.eventCount,
|
||||
|
||||
required this.month,
|
||||
|
||||
required this.netRub,
|
||||
|
||||
required this.withdrawalsRub,
|
||||
});
|
||||
|
||||
/// decimal as string
|
||||
@JsonKey(
|
||||
|
||||
name: r'deposits_rub',
|
||||
required: true,
|
||||
includeIfNull: false,
|
||||
)
|
||||
|
||||
|
||||
final String depositsRub;
|
||||
|
||||
|
||||
|
||||
@JsonKey(
|
||||
|
||||
name: r'event_count',
|
||||
required: true,
|
||||
includeIfNull: false,
|
||||
)
|
||||
|
||||
|
||||
final int eventCount;
|
||||
|
||||
|
||||
|
||||
@JsonKey(
|
||||
|
||||
name: r'month',
|
||||
required: true,
|
||||
includeIfNull: false,
|
||||
)
|
||||
|
||||
|
||||
final DateTime month;
|
||||
|
||||
|
||||
|
||||
/// decimal as string
|
||||
@JsonKey(
|
||||
|
||||
name: r'net_rub',
|
||||
required: true,
|
||||
includeIfNull: false,
|
||||
)
|
||||
|
||||
|
||||
final String netRub;
|
||||
|
||||
|
||||
|
||||
/// decimal as string
|
||||
@JsonKey(
|
||||
|
||||
name: r'withdrawals_rub',
|
||||
required: true,
|
||||
includeIfNull: false,
|
||||
)
|
||||
|
||||
|
||||
final String withdrawalsRub;
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
@override
|
||||
bool operator ==(Object other) => identical(this, other) || other is CashFlowBrokerMonth &&
|
||||
other.depositsRub == depositsRub &&
|
||||
other.eventCount == eventCount &&
|
||||
other.month == month &&
|
||||
other.netRub == netRub &&
|
||||
other.withdrawalsRub == withdrawalsRub;
|
||||
|
||||
@override
|
||||
int get hashCode =>
|
||||
depositsRub.hashCode +
|
||||
eventCount.hashCode +
|
||||
month.hashCode +
|
||||
netRub.hashCode +
|
||||
withdrawalsRub.hashCode;
|
||||
|
||||
factory CashFlowBrokerMonth.fromJson(Map<String, dynamic> json) => _$CashFlowBrokerMonthFromJson(json);
|
||||
|
||||
Map<String, dynamic> toJson() => _$CashFlowBrokerMonthToJson(this);
|
||||
|
||||
@override
|
||||
String toString() {
|
||||
return toJson().toString();
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -0,0 +1,152 @@
|
||||
// GENERATED CODE - DO NOT MODIFY BY HAND
|
||||
|
||||
part of 'cash_flow_broker_month.dart';
|
||||
|
||||
// **************************************************************************
|
||||
// CopyWithGenerator
|
||||
// **************************************************************************
|
||||
|
||||
abstract class _$CashFlowBrokerMonthCWProxy {
|
||||
CashFlowBrokerMonth depositsRub(String depositsRub);
|
||||
|
||||
CashFlowBrokerMonth eventCount(int eventCount);
|
||||
|
||||
CashFlowBrokerMonth month(DateTime month);
|
||||
|
||||
CashFlowBrokerMonth netRub(String netRub);
|
||||
|
||||
CashFlowBrokerMonth withdrawalsRub(String withdrawalsRub);
|
||||
|
||||
/// This function **does support** nullification of nullable fields. All `null` values passed to `non-nullable` fields will be ignored. You can also use `CashFlowBrokerMonth(...).copyWith.fieldName(...)` to override fields one at a time with nullification support.
|
||||
///
|
||||
/// Usage
|
||||
/// ```dart
|
||||
/// CashFlowBrokerMonth(...).copyWith(id: 12, name: "My name")
|
||||
/// ````
|
||||
CashFlowBrokerMonth call({
|
||||
String depositsRub,
|
||||
int eventCount,
|
||||
DateTime month,
|
||||
String netRub,
|
||||
String withdrawalsRub,
|
||||
});
|
||||
}
|
||||
|
||||
/// Proxy class for `copyWith` functionality. This is a callable class and can be used as follows: `instanceOfCashFlowBrokerMonth.copyWith(...)`. Additionally contains functions for specific fields e.g. `instanceOfCashFlowBrokerMonth.copyWith.fieldName(...)`
|
||||
class _$CashFlowBrokerMonthCWProxyImpl implements _$CashFlowBrokerMonthCWProxy {
|
||||
const _$CashFlowBrokerMonthCWProxyImpl(this._value);
|
||||
|
||||
final CashFlowBrokerMonth _value;
|
||||
|
||||
@override
|
||||
CashFlowBrokerMonth depositsRub(String depositsRub) =>
|
||||
this(depositsRub: depositsRub);
|
||||
|
||||
@override
|
||||
CashFlowBrokerMonth eventCount(int eventCount) =>
|
||||
this(eventCount: eventCount);
|
||||
|
||||
@override
|
||||
CashFlowBrokerMonth month(DateTime month) => this(month: month);
|
||||
|
||||
@override
|
||||
CashFlowBrokerMonth netRub(String netRub) => this(netRub: netRub);
|
||||
|
||||
@override
|
||||
CashFlowBrokerMonth withdrawalsRub(String withdrawalsRub) =>
|
||||
this(withdrawalsRub: withdrawalsRub);
|
||||
|
||||
@override
|
||||
/// This function **does support** nullification of nullable fields. All `null` values passed to `non-nullable` fields will be ignored. You can also use `CashFlowBrokerMonth(...).copyWith.fieldName(...)` to override fields one at a time with nullification support.
|
||||
///
|
||||
/// Usage
|
||||
/// ```dart
|
||||
/// CashFlowBrokerMonth(...).copyWith(id: 12, name: "My name")
|
||||
/// ````
|
||||
CashFlowBrokerMonth call({
|
||||
Object? depositsRub = const $CopyWithPlaceholder(),
|
||||
Object? eventCount = const $CopyWithPlaceholder(),
|
||||
Object? month = const $CopyWithPlaceholder(),
|
||||
Object? netRub = const $CopyWithPlaceholder(),
|
||||
Object? withdrawalsRub = const $CopyWithPlaceholder(),
|
||||
}) {
|
||||
return CashFlowBrokerMonth(
|
||||
depositsRub: depositsRub == const $CopyWithPlaceholder()
|
||||
? _value.depositsRub
|
||||
// ignore: cast_nullable_to_non_nullable
|
||||
: depositsRub as String,
|
||||
eventCount: eventCount == const $CopyWithPlaceholder()
|
||||
? _value.eventCount
|
||||
// ignore: cast_nullable_to_non_nullable
|
||||
: eventCount as int,
|
||||
month: month == const $CopyWithPlaceholder()
|
||||
? _value.month
|
||||
// ignore: cast_nullable_to_non_nullable
|
||||
: month as DateTime,
|
||||
netRub: netRub == const $CopyWithPlaceholder()
|
||||
? _value.netRub
|
||||
// ignore: cast_nullable_to_non_nullable
|
||||
: netRub as String,
|
||||
withdrawalsRub: withdrawalsRub == const $CopyWithPlaceholder()
|
||||
? _value.withdrawalsRub
|
||||
// ignore: cast_nullable_to_non_nullable
|
||||
: withdrawalsRub as String,
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
extension $CashFlowBrokerMonthCopyWith on CashFlowBrokerMonth {
|
||||
/// Returns a callable class that can be used as follows: `instanceOfCashFlowBrokerMonth.copyWith(...)` or like so:`instanceOfCashFlowBrokerMonth.copyWith.fieldName(...)`.
|
||||
// ignore: library_private_types_in_public_api
|
||||
_$CashFlowBrokerMonthCWProxy get copyWith =>
|
||||
_$CashFlowBrokerMonthCWProxyImpl(this);
|
||||
}
|
||||
|
||||
// **************************************************************************
|
||||
// JsonSerializableGenerator
|
||||
// **************************************************************************
|
||||
|
||||
CashFlowBrokerMonth _$CashFlowBrokerMonthFromJson(Map<String, dynamic> json) =>
|
||||
$checkedCreate(
|
||||
'CashFlowBrokerMonth',
|
||||
json,
|
||||
($checkedConvert) {
|
||||
$checkKeys(
|
||||
json,
|
||||
requiredKeys: const [
|
||||
'deposits_rub',
|
||||
'event_count',
|
||||
'month',
|
||||
'net_rub',
|
||||
'withdrawals_rub',
|
||||
],
|
||||
);
|
||||
final val = CashFlowBrokerMonth(
|
||||
depositsRub: $checkedConvert('deposits_rub', (v) => v as String),
|
||||
eventCount: $checkedConvert('event_count', (v) => (v as num).toInt()),
|
||||
month: $checkedConvert('month', (v) => DateTime.parse(v as String)),
|
||||
netRub: $checkedConvert('net_rub', (v) => v as String),
|
||||
withdrawalsRub: $checkedConvert(
|
||||
'withdrawals_rub',
|
||||
(v) => v as String,
|
||||
),
|
||||
);
|
||||
return val;
|
||||
},
|
||||
fieldKeyMap: const {
|
||||
'depositsRub': 'deposits_rub',
|
||||
'eventCount': 'event_count',
|
||||
'netRub': 'net_rub',
|
||||
'withdrawalsRub': 'withdrawals_rub',
|
||||
},
|
||||
);
|
||||
|
||||
Map<String, dynamic> _$CashFlowBrokerMonthToJson(
|
||||
CashFlowBrokerMonth instance,
|
||||
) => <String, dynamic>{
|
||||
'deposits_rub': instance.depositsRub,
|
||||
'event_count': instance.eventCount,
|
||||
'month': instance.month.toIso8601String(),
|
||||
'net_rub': instance.netRub,
|
||||
'withdrawals_rub': instance.withdrawalsRub,
|
||||
};
|
||||
@@ -0,0 +1,90 @@
|
||||
//
|
||||
// AUTO-GENERATED FILE, DO NOT MODIFY!
|
||||
//
|
||||
|
||||
// ignore_for_file: unused_element
|
||||
import 'package:copy_with_extension/copy_with_extension.dart';
|
||||
import 'package:json_annotation/json_annotation.dart';
|
||||
|
||||
part 'commit_request.g.dart';
|
||||
|
||||
|
||||
@CopyWith()
|
||||
@JsonSerializable(
|
||||
checked: true,
|
||||
createToJson: true,
|
||||
disallowUnrecognizedKeys: false,
|
||||
explicitToJson: true,
|
||||
)
|
||||
class CommitRequest {
|
||||
/// Returns a new [CommitRequest] instance.
|
||||
CommitRequest({
|
||||
|
||||
this.accountId,
|
||||
|
||||
this.confirmDuplicates = false,
|
||||
|
||||
this.dryRun = false,
|
||||
});
|
||||
|
||||
@JsonKey(
|
||||
|
||||
name: r'account_id',
|
||||
required: false,
|
||||
includeIfNull: false,
|
||||
)
|
||||
|
||||
|
||||
final int? accountId;
|
||||
|
||||
|
||||
|
||||
@JsonKey(
|
||||
defaultValue: false,
|
||||
name: r'confirm_duplicates',
|
||||
required: false,
|
||||
includeIfNull: false,
|
||||
)
|
||||
|
||||
|
||||
final bool? confirmDuplicates;
|
||||
|
||||
|
||||
|
||||
@JsonKey(
|
||||
defaultValue: false,
|
||||
name: r'dry_run',
|
||||
required: false,
|
||||
includeIfNull: false,
|
||||
)
|
||||
|
||||
|
||||
final bool? dryRun;
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
@override
|
||||
bool operator ==(Object other) => identical(this, other) || other is CommitRequest &&
|
||||
other.accountId == accountId &&
|
||||
other.confirmDuplicates == confirmDuplicates &&
|
||||
other.dryRun == dryRun;
|
||||
|
||||
@override
|
||||
int get hashCode =>
|
||||
(accountId == null ? 0 : accountId.hashCode) +
|
||||
confirmDuplicates.hashCode +
|
||||
dryRun.hashCode;
|
||||
|
||||
factory CommitRequest.fromJson(Map<String, dynamic> json) => _$CommitRequestFromJson(json);
|
||||
|
||||
Map<String, dynamic> toJson() => _$CommitRequestToJson(this);
|
||||
|
||||
@override
|
||||
String toString() {
|
||||
return toJson().toString();
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -0,0 +1,107 @@
|
||||
// GENERATED CODE - DO NOT MODIFY BY HAND
|
||||
|
||||
part of 'commit_request.dart';
|
||||
|
||||
// **************************************************************************
|
||||
// CopyWithGenerator
|
||||
// **************************************************************************
|
||||
|
||||
abstract class _$CommitRequestCWProxy {
|
||||
CommitRequest accountId(int? accountId);
|
||||
|
||||
CommitRequest confirmDuplicates(bool? confirmDuplicates);
|
||||
|
||||
CommitRequest dryRun(bool? dryRun);
|
||||
|
||||
/// This function **does support** nullification of nullable fields. All `null` values passed to `non-nullable` fields will be ignored. You can also use `CommitRequest(...).copyWith.fieldName(...)` to override fields one at a time with nullification support.
|
||||
///
|
||||
/// Usage
|
||||
/// ```dart
|
||||
/// CommitRequest(...).copyWith(id: 12, name: "My name")
|
||||
/// ````
|
||||
CommitRequest call({int? accountId, bool? confirmDuplicates, bool? dryRun});
|
||||
}
|
||||
|
||||
/// Proxy class for `copyWith` functionality. This is a callable class and can be used as follows: `instanceOfCommitRequest.copyWith(...)`. Additionally contains functions for specific fields e.g. `instanceOfCommitRequest.copyWith.fieldName(...)`
|
||||
class _$CommitRequestCWProxyImpl implements _$CommitRequestCWProxy {
|
||||
const _$CommitRequestCWProxyImpl(this._value);
|
||||
|
||||
final CommitRequest _value;
|
||||
|
||||
@override
|
||||
CommitRequest accountId(int? accountId) => this(accountId: accountId);
|
||||
|
||||
@override
|
||||
CommitRequest confirmDuplicates(bool? confirmDuplicates) =>
|
||||
this(confirmDuplicates: confirmDuplicates);
|
||||
|
||||
@override
|
||||
CommitRequest dryRun(bool? dryRun) => this(dryRun: dryRun);
|
||||
|
||||
@override
|
||||
/// This function **does support** nullification of nullable fields. All `null` values passed to `non-nullable` fields will be ignored. You can also use `CommitRequest(...).copyWith.fieldName(...)` to override fields one at a time with nullification support.
|
||||
///
|
||||
/// Usage
|
||||
/// ```dart
|
||||
/// CommitRequest(...).copyWith(id: 12, name: "My name")
|
||||
/// ````
|
||||
CommitRequest call({
|
||||
Object? accountId = const $CopyWithPlaceholder(),
|
||||
Object? confirmDuplicates = const $CopyWithPlaceholder(),
|
||||
Object? dryRun = const $CopyWithPlaceholder(),
|
||||
}) {
|
||||
return CommitRequest(
|
||||
accountId: accountId == const $CopyWithPlaceholder()
|
||||
? _value.accountId
|
||||
// ignore: cast_nullable_to_non_nullable
|
||||
: accountId as int?,
|
||||
confirmDuplicates: confirmDuplicates == const $CopyWithPlaceholder()
|
||||
? _value.confirmDuplicates
|
||||
// ignore: cast_nullable_to_non_nullable
|
||||
: confirmDuplicates as bool?,
|
||||
dryRun: dryRun == const $CopyWithPlaceholder()
|
||||
? _value.dryRun
|
||||
// ignore: cast_nullable_to_non_nullable
|
||||
: dryRun as bool?,
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
extension $CommitRequestCopyWith on CommitRequest {
|
||||
/// Returns a callable class that can be used as follows: `instanceOfCommitRequest.copyWith(...)` or like so:`instanceOfCommitRequest.copyWith.fieldName(...)`.
|
||||
// ignore: library_private_types_in_public_api
|
||||
_$CommitRequestCWProxy get copyWith => _$CommitRequestCWProxyImpl(this);
|
||||
}
|
||||
|
||||
// **************************************************************************
|
||||
// JsonSerializableGenerator
|
||||
// **************************************************************************
|
||||
|
||||
CommitRequest _$CommitRequestFromJson(Map<String, dynamic> json) =>
|
||||
$checkedCreate(
|
||||
'CommitRequest',
|
||||
json,
|
||||
($checkedConvert) {
|
||||
final val = CommitRequest(
|
||||
accountId: $checkedConvert('account_id', (v) => (v as num?)?.toInt()),
|
||||
confirmDuplicates: $checkedConvert(
|
||||
'confirm_duplicates',
|
||||
(v) => v as bool? ?? false,
|
||||
),
|
||||
dryRun: $checkedConvert('dry_run', (v) => v as bool? ?? false),
|
||||
);
|
||||
return val;
|
||||
},
|
||||
fieldKeyMap: const {
|
||||
'accountId': 'account_id',
|
||||
'confirmDuplicates': 'confirm_duplicates',
|
||||
'dryRun': 'dry_run',
|
||||
},
|
||||
);
|
||||
|
||||
Map<String, dynamic> _$CommitRequestToJson(CommitRequest instance) =>
|
||||
<String, dynamic>{
|
||||
'account_id': ?instance.accountId,
|
||||
'confirm_duplicates': ?instance.confirmDuplicates,
|
||||
'dry_run': ?instance.dryRun,
|
||||
};
|
||||
@@ -13,6 +13,8 @@ enum EventSource {
|
||||
reportSber(r'report_sber'),
|
||||
@JsonValue(r'report_vtb')
|
||||
reportVtb(r'report_vtb'),
|
||||
@JsonValue(r'csv')
|
||||
csv(r'csv'),
|
||||
@JsonValue(r'manual')
|
||||
manual(r'manual'),
|
||||
@JsonValue(r'unknown_default_open_api')
|
||||
|
||||
@@ -0,0 +1,91 @@
|
||||
//
|
||||
// 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 'forecast_month.g.dart';
|
||||
|
||||
|
||||
@CopyWith()
|
||||
@JsonSerializable(
|
||||
checked: true,
|
||||
createToJson: true,
|
||||
disallowUnrecognizedKeys: false,
|
||||
explicitToJson: true,
|
||||
)
|
||||
class ForecastMonth {
|
||||
/// Returns a new [ForecastMonth] instance.
|
||||
ForecastMonth({
|
||||
|
||||
required this.amountRub,
|
||||
|
||||
required this.byBasis,
|
||||
|
||||
required this.month,
|
||||
});
|
||||
|
||||
/// decimal as string
|
||||
@JsonKey(
|
||||
|
||||
name: r'amount_rub',
|
||||
required: true,
|
||||
includeIfNull: false,
|
||||
)
|
||||
|
||||
|
||||
final String amountRub;
|
||||
|
||||
|
||||
|
||||
@JsonKey(
|
||||
|
||||
name: r'by_basis',
|
||||
required: true,
|
||||
includeIfNull: false,
|
||||
)
|
||||
|
||||
|
||||
final Map<String, String> byBasis;
|
||||
|
||||
|
||||
|
||||
@JsonKey(
|
||||
|
||||
name: r'month',
|
||||
required: true,
|
||||
includeIfNull: false,
|
||||
)
|
||||
|
||||
|
||||
final DateTime month;
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
@override
|
||||
bool operator ==(Object other) => identical(this, other) || other is ForecastMonth &&
|
||||
other.amountRub == amountRub &&
|
||||
other.byBasis == byBasis &&
|
||||
other.month == month;
|
||||
|
||||
@override
|
||||
int get hashCode =>
|
||||
amountRub.hashCode +
|
||||
byBasis.hashCode +
|
||||
month.hashCode;
|
||||
|
||||
factory ForecastMonth.fromJson(Map<String, dynamic> json) => _$ForecastMonthFromJson(json);
|
||||
|
||||
Map<String, dynamic> toJson() => _$ForecastMonthToJson(this);
|
||||
|
||||
@override
|
||||
String toString() {
|
||||
return toJson().toString();
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -0,0 +1,110 @@
|
||||
// GENERATED CODE - DO NOT MODIFY BY HAND
|
||||
|
||||
part of 'forecast_month.dart';
|
||||
|
||||
// **************************************************************************
|
||||
// CopyWithGenerator
|
||||
// **************************************************************************
|
||||
|
||||
abstract class _$ForecastMonthCWProxy {
|
||||
ForecastMonth amountRub(String amountRub);
|
||||
|
||||
ForecastMonth byBasis(Map<String, String> byBasis);
|
||||
|
||||
ForecastMonth month(DateTime month);
|
||||
|
||||
/// This function **does support** nullification of nullable fields. All `null` values passed to `non-nullable` fields will be ignored. You can also use `ForecastMonth(...).copyWith.fieldName(...)` to override fields one at a time with nullification support.
|
||||
///
|
||||
/// Usage
|
||||
/// ```dart
|
||||
/// ForecastMonth(...).copyWith(id: 12, name: "My name")
|
||||
/// ````
|
||||
ForecastMonth call({
|
||||
String amountRub,
|
||||
Map<String, String> byBasis,
|
||||
DateTime month,
|
||||
});
|
||||
}
|
||||
|
||||
/// Proxy class for `copyWith` functionality. This is a callable class and can be used as follows: `instanceOfForecastMonth.copyWith(...)`. Additionally contains functions for specific fields e.g. `instanceOfForecastMonth.copyWith.fieldName(...)`
|
||||
class _$ForecastMonthCWProxyImpl implements _$ForecastMonthCWProxy {
|
||||
const _$ForecastMonthCWProxyImpl(this._value);
|
||||
|
||||
final ForecastMonth _value;
|
||||
|
||||
@override
|
||||
ForecastMonth amountRub(String amountRub) => this(amountRub: amountRub);
|
||||
|
||||
@override
|
||||
ForecastMonth byBasis(Map<String, String> byBasis) => this(byBasis: byBasis);
|
||||
|
||||
@override
|
||||
ForecastMonth month(DateTime month) => this(month: month);
|
||||
|
||||
@override
|
||||
/// This function **does support** nullification of nullable fields. All `null` values passed to `non-nullable` fields will be ignored. You can also use `ForecastMonth(...).copyWith.fieldName(...)` to override fields one at a time with nullification support.
|
||||
///
|
||||
/// Usage
|
||||
/// ```dart
|
||||
/// ForecastMonth(...).copyWith(id: 12, name: "My name")
|
||||
/// ````
|
||||
ForecastMonth call({
|
||||
Object? amountRub = const $CopyWithPlaceholder(),
|
||||
Object? byBasis = const $CopyWithPlaceholder(),
|
||||
Object? month = const $CopyWithPlaceholder(),
|
||||
}) {
|
||||
return ForecastMonth(
|
||||
amountRub: amountRub == const $CopyWithPlaceholder()
|
||||
? _value.amountRub
|
||||
// ignore: cast_nullable_to_non_nullable
|
||||
: amountRub as String,
|
||||
byBasis: byBasis == const $CopyWithPlaceholder()
|
||||
? _value.byBasis
|
||||
// ignore: cast_nullable_to_non_nullable
|
||||
: byBasis as Map<String, String>,
|
||||
month: month == const $CopyWithPlaceholder()
|
||||
? _value.month
|
||||
// ignore: cast_nullable_to_non_nullable
|
||||
: month as DateTime,
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
extension $ForecastMonthCopyWith on ForecastMonth {
|
||||
/// Returns a callable class that can be used as follows: `instanceOfForecastMonth.copyWith(...)` or like so:`instanceOfForecastMonth.copyWith.fieldName(...)`.
|
||||
// ignore: library_private_types_in_public_api
|
||||
_$ForecastMonthCWProxy get copyWith => _$ForecastMonthCWProxyImpl(this);
|
||||
}
|
||||
|
||||
// **************************************************************************
|
||||
// JsonSerializableGenerator
|
||||
// **************************************************************************
|
||||
|
||||
ForecastMonth _$ForecastMonthFromJson(Map<String, dynamic> json) =>
|
||||
$checkedCreate(
|
||||
'ForecastMonth',
|
||||
json,
|
||||
($checkedConvert) {
|
||||
$checkKeys(
|
||||
json,
|
||||
requiredKeys: const ['amount_rub', 'by_basis', 'month'],
|
||||
);
|
||||
final val = ForecastMonth(
|
||||
amountRub: $checkedConvert('amount_rub', (v) => v as String),
|
||||
byBasis: $checkedConvert(
|
||||
'by_basis',
|
||||
(v) => Map<String, String>.from(v as Map),
|
||||
),
|
||||
month: $checkedConvert('month', (v) => DateTime.parse(v as String)),
|
||||
);
|
||||
return val;
|
||||
},
|
||||
fieldKeyMap: const {'amountRub': 'amount_rub', 'byBasis': 'by_basis'},
|
||||
);
|
||||
|
||||
Map<String, dynamic> _$ForecastMonthToJson(ForecastMonth instance) =>
|
||||
<String, dynamic>{
|
||||
'amount_rub': instance.amountRub,
|
||||
'by_basis': instance.byBasis,
|
||||
'month': instance.month.toIso8601String(),
|
||||
};
|
||||
@@ -0,0 +1,109 @@
|
||||
//
|
||||
// AUTO-GENERATED FILE, DO NOT MODIFY!
|
||||
//
|
||||
|
||||
// ignore_for_file: unused_element
|
||||
import 'package:fintracker_api/src/model/forecast_month.dart';
|
||||
import 'package:copy_with_extension/copy_with_extension.dart';
|
||||
import 'package:json_annotation/json_annotation.dart';
|
||||
|
||||
part 'forecast_out.g.dart';
|
||||
|
||||
|
||||
@CopyWith()
|
||||
@JsonSerializable(
|
||||
checked: true,
|
||||
createToJson: true,
|
||||
disallowUnrecognizedKeys: false,
|
||||
explicitToJson: true,
|
||||
)
|
||||
class ForecastOut {
|
||||
/// Returns a new [ForecastOut] instance.
|
||||
ForecastOut({
|
||||
|
||||
required this.annualYieldOnValue,
|
||||
|
||||
required this.months,
|
||||
|
||||
required this.totalRub,
|
||||
|
||||
required this.warnings,
|
||||
});
|
||||
|
||||
/// decimal as string
|
||||
@JsonKey(
|
||||
|
||||
name: r'annual_yield_on_value',
|
||||
required: true,
|
||||
includeIfNull: true,
|
||||
)
|
||||
|
||||
|
||||
final String? annualYieldOnValue;
|
||||
|
||||
|
||||
|
||||
@JsonKey(
|
||||
|
||||
name: r'months',
|
||||
required: true,
|
||||
includeIfNull: false,
|
||||
)
|
||||
|
||||
|
||||
final List<ForecastMonth> months;
|
||||
|
||||
|
||||
|
||||
/// decimal as string
|
||||
@JsonKey(
|
||||
|
||||
name: r'total_rub',
|
||||
required: true,
|
||||
includeIfNull: false,
|
||||
)
|
||||
|
||||
|
||||
final String totalRub;
|
||||
|
||||
|
||||
|
||||
@JsonKey(
|
||||
|
||||
name: r'warnings',
|
||||
required: true,
|
||||
includeIfNull: false,
|
||||
)
|
||||
|
||||
|
||||
final List<String> warnings;
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
@override
|
||||
bool operator ==(Object other) => identical(this, other) || other is ForecastOut &&
|
||||
other.annualYieldOnValue == annualYieldOnValue &&
|
||||
other.months == months &&
|
||||
other.totalRub == totalRub &&
|
||||
other.warnings == warnings;
|
||||
|
||||
@override
|
||||
int get hashCode =>
|
||||
(annualYieldOnValue == null ? 0 : annualYieldOnValue.hashCode) +
|
||||
months.hashCode +
|
||||
totalRub.hashCode +
|
||||
warnings.hashCode;
|
||||
|
||||
factory ForecastOut.fromJson(Map<String, dynamic> json) => _$ForecastOutFromJson(json);
|
||||
|
||||
Map<String, dynamic> toJson() => _$ForecastOutToJson(this);
|
||||
|
||||
@override
|
||||
String toString() {
|
||||
return toJson().toString();
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -0,0 +1,139 @@
|
||||
// GENERATED CODE - DO NOT MODIFY BY HAND
|
||||
|
||||
part of 'forecast_out.dart';
|
||||
|
||||
// **************************************************************************
|
||||
// CopyWithGenerator
|
||||
// **************************************************************************
|
||||
|
||||
abstract class _$ForecastOutCWProxy {
|
||||
ForecastOut annualYieldOnValue(String? annualYieldOnValue);
|
||||
|
||||
ForecastOut months(List<ForecastMonth> months);
|
||||
|
||||
ForecastOut totalRub(String totalRub);
|
||||
|
||||
ForecastOut warnings(List<String> warnings);
|
||||
|
||||
/// This function **does support** nullification of nullable fields. All `null` values passed to `non-nullable` fields will be ignored. You can also use `ForecastOut(...).copyWith.fieldName(...)` to override fields one at a time with nullification support.
|
||||
///
|
||||
/// Usage
|
||||
/// ```dart
|
||||
/// ForecastOut(...).copyWith(id: 12, name: "My name")
|
||||
/// ````
|
||||
ForecastOut call({
|
||||
String? annualYieldOnValue,
|
||||
List<ForecastMonth> months,
|
||||
String totalRub,
|
||||
List<String> warnings,
|
||||
});
|
||||
}
|
||||
|
||||
/// Proxy class for `copyWith` functionality. This is a callable class and can be used as follows: `instanceOfForecastOut.copyWith(...)`. Additionally contains functions for specific fields e.g. `instanceOfForecastOut.copyWith.fieldName(...)`
|
||||
class _$ForecastOutCWProxyImpl implements _$ForecastOutCWProxy {
|
||||
const _$ForecastOutCWProxyImpl(this._value);
|
||||
|
||||
final ForecastOut _value;
|
||||
|
||||
@override
|
||||
ForecastOut annualYieldOnValue(String? annualYieldOnValue) =>
|
||||
this(annualYieldOnValue: annualYieldOnValue);
|
||||
|
||||
@override
|
||||
ForecastOut months(List<ForecastMonth> months) => this(months: months);
|
||||
|
||||
@override
|
||||
ForecastOut totalRub(String totalRub) => this(totalRub: totalRub);
|
||||
|
||||
@override
|
||||
ForecastOut warnings(List<String> 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 `ForecastOut(...).copyWith.fieldName(...)` to override fields one at a time with nullification support.
|
||||
///
|
||||
/// Usage
|
||||
/// ```dart
|
||||
/// ForecastOut(...).copyWith(id: 12, name: "My name")
|
||||
/// ````
|
||||
ForecastOut call({
|
||||
Object? annualYieldOnValue = const $CopyWithPlaceholder(),
|
||||
Object? months = const $CopyWithPlaceholder(),
|
||||
Object? totalRub = const $CopyWithPlaceholder(),
|
||||
Object? warnings = const $CopyWithPlaceholder(),
|
||||
}) {
|
||||
return ForecastOut(
|
||||
annualYieldOnValue: annualYieldOnValue == const $CopyWithPlaceholder()
|
||||
? _value.annualYieldOnValue
|
||||
// ignore: cast_nullable_to_non_nullable
|
||||
: annualYieldOnValue as String?,
|
||||
months: months == const $CopyWithPlaceholder()
|
||||
? _value.months
|
||||
// ignore: cast_nullable_to_non_nullable
|
||||
: months as List<ForecastMonth>,
|
||||
totalRub: totalRub == const $CopyWithPlaceholder()
|
||||
? _value.totalRub
|
||||
// ignore: cast_nullable_to_non_nullable
|
||||
: totalRub as String,
|
||||
warnings: warnings == const $CopyWithPlaceholder()
|
||||
? _value.warnings
|
||||
// ignore: cast_nullable_to_non_nullable
|
||||
: warnings as List<String>,
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
extension $ForecastOutCopyWith on ForecastOut {
|
||||
/// Returns a callable class that can be used as follows: `instanceOfForecastOut.copyWith(...)` or like so:`instanceOfForecastOut.copyWith.fieldName(...)`.
|
||||
// ignore: library_private_types_in_public_api
|
||||
_$ForecastOutCWProxy get copyWith => _$ForecastOutCWProxyImpl(this);
|
||||
}
|
||||
|
||||
// **************************************************************************
|
||||
// JsonSerializableGenerator
|
||||
// **************************************************************************
|
||||
|
||||
ForecastOut _$ForecastOutFromJson(Map<String, dynamic> json) => $checkedCreate(
|
||||
'ForecastOut',
|
||||
json,
|
||||
($checkedConvert) {
|
||||
$checkKeys(
|
||||
json,
|
||||
requiredKeys: const [
|
||||
'annual_yield_on_value',
|
||||
'months',
|
||||
'total_rub',
|
||||
'warnings',
|
||||
],
|
||||
);
|
||||
final val = ForecastOut(
|
||||
annualYieldOnValue: $checkedConvert(
|
||||
'annual_yield_on_value',
|
||||
(v) => v as String?,
|
||||
),
|
||||
months: $checkedConvert(
|
||||
'months',
|
||||
(v) => (v as List<dynamic>)
|
||||
.map((e) => ForecastMonth.fromJson(e as Map<String, dynamic>))
|
||||
.toList(),
|
||||
),
|
||||
totalRub: $checkedConvert('total_rub', (v) => v as String),
|
||||
warnings: $checkedConvert(
|
||||
'warnings',
|
||||
(v) => (v as List<dynamic>).map((e) => e as String).toList(),
|
||||
),
|
||||
);
|
||||
return val;
|
||||
},
|
||||
fieldKeyMap: const {
|
||||
'annualYieldOnValue': 'annual_yield_on_value',
|
||||
'totalRub': 'total_rub',
|
||||
},
|
||||
);
|
||||
|
||||
Map<String, dynamic> _$ForecastOutToJson(ForecastOut instance) =>
|
||||
<String, dynamic>{
|
||||
'annual_yield_on_value': instance.annualYieldOnValue,
|
||||
'months': instance.months.map((e) => e.toJson()).toList(),
|
||||
'total_rub': instance.totalRub,
|
||||
'warnings': instance.warnings,
|
||||
};
|
||||
@@ -0,0 +1,172 @@
|
||||
//
|
||||
// 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 'goal_create.g.dart';
|
||||
|
||||
|
||||
@CopyWith()
|
||||
@JsonSerializable(
|
||||
checked: true,
|
||||
createToJson: true,
|
||||
disallowUnrecognizedKeys: false,
|
||||
explicitToJson: true,
|
||||
)
|
||||
class GoalCreate {
|
||||
/// Returns a new [GoalCreate] instance.
|
||||
GoalCreate({
|
||||
|
||||
this.archived = false,
|
||||
|
||||
this.currency = 'RUB',
|
||||
|
||||
this.monthlyContribution,
|
||||
|
||||
required this.name,
|
||||
|
||||
this.note,
|
||||
|
||||
this.scope = 'all',
|
||||
|
||||
required this.targetAmount,
|
||||
|
||||
this.targetDate,
|
||||
});
|
||||
|
||||
@JsonKey(
|
||||
defaultValue: false,
|
||||
name: r'archived',
|
||||
required: false,
|
||||
includeIfNull: false,
|
||||
)
|
||||
|
||||
|
||||
final bool? archived;
|
||||
|
||||
|
||||
|
||||
@JsonKey(
|
||||
defaultValue: 'RUB',
|
||||
name: r'currency',
|
||||
required: false,
|
||||
includeIfNull: false,
|
||||
)
|
||||
|
||||
|
||||
final String? currency;
|
||||
|
||||
|
||||
|
||||
/// decimal as string
|
||||
@JsonKey(
|
||||
|
||||
name: r'monthly_contribution',
|
||||
required: false,
|
||||
includeIfNull: false,
|
||||
)
|
||||
|
||||
|
||||
final String? monthlyContribution;
|
||||
|
||||
|
||||
|
||||
@JsonKey(
|
||||
|
||||
name: r'name',
|
||||
required: true,
|
||||
includeIfNull: false,
|
||||
)
|
||||
|
||||
|
||||
final String name;
|
||||
|
||||
|
||||
|
||||
@JsonKey(
|
||||
|
||||
name: r'note',
|
||||
required: false,
|
||||
includeIfNull: false,
|
||||
)
|
||||
|
||||
|
||||
final String? note;
|
||||
|
||||
|
||||
|
||||
@JsonKey(
|
||||
defaultValue: 'all',
|
||||
name: r'scope',
|
||||
required: false,
|
||||
includeIfNull: false,
|
||||
)
|
||||
|
||||
|
||||
final String? scope;
|
||||
|
||||
|
||||
|
||||
/// decimal as string
|
||||
@JsonKey(
|
||||
|
||||
name: r'target_amount',
|
||||
required: true,
|
||||
includeIfNull: false,
|
||||
)
|
||||
|
||||
|
||||
final String targetAmount;
|
||||
|
||||
|
||||
|
||||
@JsonKey(
|
||||
|
||||
name: r'target_date',
|
||||
required: false,
|
||||
includeIfNull: false,
|
||||
)
|
||||
|
||||
|
||||
final DateTime? targetDate;
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
@override
|
||||
bool operator ==(Object other) => identical(this, other) || other is GoalCreate &&
|
||||
other.archived == archived &&
|
||||
other.currency == currency &&
|
||||
other.monthlyContribution == monthlyContribution &&
|
||||
other.name == name &&
|
||||
other.note == note &&
|
||||
other.scope == scope &&
|
||||
other.targetAmount == targetAmount &&
|
||||
other.targetDate == targetDate;
|
||||
|
||||
@override
|
||||
int get hashCode =>
|
||||
archived.hashCode +
|
||||
currency.hashCode +
|
||||
(monthlyContribution == null ? 0 : monthlyContribution.hashCode) +
|
||||
name.hashCode +
|
||||
(note == null ? 0 : note.hashCode) +
|
||||
scope.hashCode +
|
||||
targetAmount.hashCode +
|
||||
(targetDate == null ? 0 : targetDate.hashCode);
|
||||
|
||||
factory GoalCreate.fromJson(Map<String, dynamic> json) => _$GoalCreateFromJson(json);
|
||||
|
||||
Map<String, dynamic> toJson() => _$GoalCreateToJson(this);
|
||||
|
||||
@override
|
||||
String toString() {
|
||||
return toJson().toString();
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -0,0 +1,180 @@
|
||||
// GENERATED CODE - DO NOT MODIFY BY HAND
|
||||
|
||||
part of 'goal_create.dart';
|
||||
|
||||
// **************************************************************************
|
||||
// CopyWithGenerator
|
||||
// **************************************************************************
|
||||
|
||||
abstract class _$GoalCreateCWProxy {
|
||||
GoalCreate archived(bool? archived);
|
||||
|
||||
GoalCreate currency(String? currency);
|
||||
|
||||
GoalCreate monthlyContribution(String? monthlyContribution);
|
||||
|
||||
GoalCreate name(String name);
|
||||
|
||||
GoalCreate note(String? note);
|
||||
|
||||
GoalCreate scope(String? scope);
|
||||
|
||||
GoalCreate targetAmount(String targetAmount);
|
||||
|
||||
GoalCreate targetDate(DateTime? targetDate);
|
||||
|
||||
/// This function **does support** nullification of nullable fields. All `null` values passed to `non-nullable` fields will be ignored. You can also use `GoalCreate(...).copyWith.fieldName(...)` to override fields one at a time with nullification support.
|
||||
///
|
||||
/// Usage
|
||||
/// ```dart
|
||||
/// GoalCreate(...).copyWith(id: 12, name: "My name")
|
||||
/// ````
|
||||
GoalCreate call({
|
||||
bool? archived,
|
||||
String? currency,
|
||||
String? monthlyContribution,
|
||||
String name,
|
||||
String? note,
|
||||
String? scope,
|
||||
String targetAmount,
|
||||
DateTime? targetDate,
|
||||
});
|
||||
}
|
||||
|
||||
/// Proxy class for `copyWith` functionality. This is a callable class and can be used as follows: `instanceOfGoalCreate.copyWith(...)`. Additionally contains functions for specific fields e.g. `instanceOfGoalCreate.copyWith.fieldName(...)`
|
||||
class _$GoalCreateCWProxyImpl implements _$GoalCreateCWProxy {
|
||||
const _$GoalCreateCWProxyImpl(this._value);
|
||||
|
||||
final GoalCreate _value;
|
||||
|
||||
@override
|
||||
GoalCreate archived(bool? archived) => this(archived: archived);
|
||||
|
||||
@override
|
||||
GoalCreate currency(String? currency) => this(currency: currency);
|
||||
|
||||
@override
|
||||
GoalCreate monthlyContribution(String? monthlyContribution) =>
|
||||
this(monthlyContribution: monthlyContribution);
|
||||
|
||||
@override
|
||||
GoalCreate name(String name) => this(name: name);
|
||||
|
||||
@override
|
||||
GoalCreate note(String? note) => this(note: note);
|
||||
|
||||
@override
|
||||
GoalCreate scope(String? scope) => this(scope: scope);
|
||||
|
||||
@override
|
||||
GoalCreate targetAmount(String targetAmount) =>
|
||||
this(targetAmount: targetAmount);
|
||||
|
||||
@override
|
||||
GoalCreate targetDate(DateTime? targetDate) => this(targetDate: targetDate);
|
||||
|
||||
@override
|
||||
/// This function **does support** nullification of nullable fields. All `null` values passed to `non-nullable` fields will be ignored. You can also use `GoalCreate(...).copyWith.fieldName(...)` to override fields one at a time with nullification support.
|
||||
///
|
||||
/// Usage
|
||||
/// ```dart
|
||||
/// GoalCreate(...).copyWith(id: 12, name: "My name")
|
||||
/// ````
|
||||
GoalCreate call({
|
||||
Object? archived = const $CopyWithPlaceholder(),
|
||||
Object? currency = const $CopyWithPlaceholder(),
|
||||
Object? monthlyContribution = const $CopyWithPlaceholder(),
|
||||
Object? name = const $CopyWithPlaceholder(),
|
||||
Object? note = const $CopyWithPlaceholder(),
|
||||
Object? scope = const $CopyWithPlaceholder(),
|
||||
Object? targetAmount = const $CopyWithPlaceholder(),
|
||||
Object? targetDate = const $CopyWithPlaceholder(),
|
||||
}) {
|
||||
return GoalCreate(
|
||||
archived: archived == const $CopyWithPlaceholder()
|
||||
? _value.archived
|
||||
// ignore: cast_nullable_to_non_nullable
|
||||
: archived as bool?,
|
||||
currency: currency == const $CopyWithPlaceholder()
|
||||
? _value.currency
|
||||
// ignore: cast_nullable_to_non_nullable
|
||||
: currency as String?,
|
||||
monthlyContribution: monthlyContribution == const $CopyWithPlaceholder()
|
||||
? _value.monthlyContribution
|
||||
// ignore: cast_nullable_to_non_nullable
|
||||
: monthlyContribution as String?,
|
||||
name: name == const $CopyWithPlaceholder()
|
||||
? _value.name
|
||||
// ignore: cast_nullable_to_non_nullable
|
||||
: name as String,
|
||||
note: note == const $CopyWithPlaceholder()
|
||||
? _value.note
|
||||
// ignore: cast_nullable_to_non_nullable
|
||||
: note as String?,
|
||||
scope: scope == const $CopyWithPlaceholder()
|
||||
? _value.scope
|
||||
// ignore: cast_nullable_to_non_nullable
|
||||
: scope as String?,
|
||||
targetAmount: targetAmount == const $CopyWithPlaceholder()
|
||||
? _value.targetAmount
|
||||
// ignore: cast_nullable_to_non_nullable
|
||||
: targetAmount as String,
|
||||
targetDate: targetDate == const $CopyWithPlaceholder()
|
||||
? _value.targetDate
|
||||
// ignore: cast_nullable_to_non_nullable
|
||||
: targetDate as DateTime?,
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
extension $GoalCreateCopyWith on GoalCreate {
|
||||
/// Returns a callable class that can be used as follows: `instanceOfGoalCreate.copyWith(...)` or like so:`instanceOfGoalCreate.copyWith.fieldName(...)`.
|
||||
// ignore: library_private_types_in_public_api
|
||||
_$GoalCreateCWProxy get copyWith => _$GoalCreateCWProxyImpl(this);
|
||||
}
|
||||
|
||||
// **************************************************************************
|
||||
// JsonSerializableGenerator
|
||||
// **************************************************************************
|
||||
|
||||
GoalCreate _$GoalCreateFromJson(Map<String, dynamic> json) => $checkedCreate(
|
||||
'GoalCreate',
|
||||
json,
|
||||
($checkedConvert) {
|
||||
$checkKeys(json, requiredKeys: const ['name', 'target_amount']);
|
||||
final val = GoalCreate(
|
||||
archived: $checkedConvert('archived', (v) => v as bool? ?? false),
|
||||
currency: $checkedConvert('currency', (v) => v as String? ?? 'RUB'),
|
||||
monthlyContribution: $checkedConvert(
|
||||
'monthly_contribution',
|
||||
(v) => v as String?,
|
||||
),
|
||||
name: $checkedConvert('name', (v) => v as String),
|
||||
note: $checkedConvert('note', (v) => v as String?),
|
||||
scope: $checkedConvert('scope', (v) => v as String? ?? 'all'),
|
||||
targetAmount: $checkedConvert('target_amount', (v) => v as String),
|
||||
targetDate: $checkedConvert(
|
||||
'target_date',
|
||||
(v) => v == null ? null : DateTime.parse(v as String),
|
||||
),
|
||||
);
|
||||
return val;
|
||||
},
|
||||
fieldKeyMap: const {
|
||||
'monthlyContribution': 'monthly_contribution',
|
||||
'targetAmount': 'target_amount',
|
||||
'targetDate': 'target_date',
|
||||
},
|
||||
);
|
||||
|
||||
Map<String, dynamic> _$GoalCreateToJson(GoalCreate instance) =>
|
||||
<String, dynamic>{
|
||||
'archived': ?instance.archived,
|
||||
'currency': ?instance.currency,
|
||||
'monthly_contribution': ?instance.monthlyContribution,
|
||||
'name': instance.name,
|
||||
'note': ?instance.note,
|
||||
'scope': ?instance.scope,
|
||||
'target_amount': instance.targetAmount,
|
||||
'target_date': ?instance.targetDate?.toIso8601String(),
|
||||
};
|
||||
@@ -0,0 +1,188 @@
|
||||
//
|
||||
// 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 'goal_out.g.dart';
|
||||
|
||||
|
||||
@CopyWith()
|
||||
@JsonSerializable(
|
||||
checked: true,
|
||||
createToJson: true,
|
||||
disallowUnrecognizedKeys: false,
|
||||
explicitToJson: true,
|
||||
)
|
||||
class GoalOut {
|
||||
/// Returns a new [GoalOut] instance.
|
||||
GoalOut({
|
||||
|
||||
required this.archived,
|
||||
|
||||
required this.currency,
|
||||
|
||||
required this.id,
|
||||
|
||||
required this.monthlyContribution,
|
||||
|
||||
required this.name,
|
||||
|
||||
required this.note,
|
||||
|
||||
required this.scope,
|
||||
|
||||
required this.targetAmount,
|
||||
|
||||
required this.targetDate,
|
||||
});
|
||||
|
||||
@JsonKey(
|
||||
|
||||
name: r'archived',
|
||||
required: true,
|
||||
includeIfNull: false,
|
||||
)
|
||||
|
||||
|
||||
final bool archived;
|
||||
|
||||
|
||||
|
||||
@JsonKey(
|
||||
|
||||
name: r'currency',
|
||||
required: true,
|
||||
includeIfNull: false,
|
||||
)
|
||||
|
||||
|
||||
final String currency;
|
||||
|
||||
|
||||
|
||||
@JsonKey(
|
||||
|
||||
name: r'id',
|
||||
required: true,
|
||||
includeIfNull: false,
|
||||
)
|
||||
|
||||
|
||||
final int id;
|
||||
|
||||
|
||||
|
||||
/// decimal as string
|
||||
@JsonKey(
|
||||
|
||||
name: r'monthly_contribution',
|
||||
required: true,
|
||||
includeIfNull: true,
|
||||
)
|
||||
|
||||
|
||||
final String? monthlyContribution;
|
||||
|
||||
|
||||
|
||||
@JsonKey(
|
||||
|
||||
name: r'name',
|
||||
required: true,
|
||||
includeIfNull: false,
|
||||
)
|
||||
|
||||
|
||||
final String name;
|
||||
|
||||
|
||||
|
||||
@JsonKey(
|
||||
|
||||
name: r'note',
|
||||
required: true,
|
||||
includeIfNull: true,
|
||||
)
|
||||
|
||||
|
||||
final String? note;
|
||||
|
||||
|
||||
|
||||
@JsonKey(
|
||||
|
||||
name: r'scope',
|
||||
required: true,
|
||||
includeIfNull: false,
|
||||
)
|
||||
|
||||
|
||||
final String scope;
|
||||
|
||||
|
||||
|
||||
/// decimal as string
|
||||
@JsonKey(
|
||||
|
||||
name: r'target_amount',
|
||||
required: true,
|
||||
includeIfNull: false,
|
||||
)
|
||||
|
||||
|
||||
final String targetAmount;
|
||||
|
||||
|
||||
|
||||
@JsonKey(
|
||||
|
||||
name: r'target_date',
|
||||
required: true,
|
||||
includeIfNull: true,
|
||||
)
|
||||
|
||||
|
||||
final DateTime? targetDate;
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
@override
|
||||
bool operator ==(Object other) => identical(this, other) || other is GoalOut &&
|
||||
other.archived == archived &&
|
||||
other.currency == currency &&
|
||||
other.id == id &&
|
||||
other.monthlyContribution == monthlyContribution &&
|
||||
other.name == name &&
|
||||
other.note == note &&
|
||||
other.scope == scope &&
|
||||
other.targetAmount == targetAmount &&
|
||||
other.targetDate == targetDate;
|
||||
|
||||
@override
|
||||
int get hashCode =>
|
||||
archived.hashCode +
|
||||
currency.hashCode +
|
||||
id.hashCode +
|
||||
(monthlyContribution == null ? 0 : monthlyContribution.hashCode) +
|
||||
name.hashCode +
|
||||
(note == null ? 0 : note.hashCode) +
|
||||
scope.hashCode +
|
||||
targetAmount.hashCode +
|
||||
(targetDate == null ? 0 : targetDate.hashCode);
|
||||
|
||||
factory GoalOut.fromJson(Map<String, dynamic> json) => _$GoalOutFromJson(json);
|
||||
|
||||
Map<String, dynamic> toJson() => _$GoalOutToJson(this);
|
||||
|
||||
@override
|
||||
String toString() {
|
||||
return toJson().toString();
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -0,0 +1,204 @@
|
||||
// GENERATED CODE - DO NOT MODIFY BY HAND
|
||||
|
||||
part of 'goal_out.dart';
|
||||
|
||||
// **************************************************************************
|
||||
// CopyWithGenerator
|
||||
// **************************************************************************
|
||||
|
||||
abstract class _$GoalOutCWProxy {
|
||||
GoalOut archived(bool archived);
|
||||
|
||||
GoalOut currency(String currency);
|
||||
|
||||
GoalOut id(int id);
|
||||
|
||||
GoalOut monthlyContribution(String? monthlyContribution);
|
||||
|
||||
GoalOut name(String name);
|
||||
|
||||
GoalOut note(String? note);
|
||||
|
||||
GoalOut scope(String scope);
|
||||
|
||||
GoalOut targetAmount(String targetAmount);
|
||||
|
||||
GoalOut targetDate(DateTime? targetDate);
|
||||
|
||||
/// This function **does support** nullification of nullable fields. All `null` values passed to `non-nullable` fields will be ignored. You can also use `GoalOut(...).copyWith.fieldName(...)` to override fields one at a time with nullification support.
|
||||
///
|
||||
/// Usage
|
||||
/// ```dart
|
||||
/// GoalOut(...).copyWith(id: 12, name: "My name")
|
||||
/// ````
|
||||
GoalOut call({
|
||||
bool archived,
|
||||
String currency,
|
||||
int id,
|
||||
String? monthlyContribution,
|
||||
String name,
|
||||
String? note,
|
||||
String scope,
|
||||
String targetAmount,
|
||||
DateTime? targetDate,
|
||||
});
|
||||
}
|
||||
|
||||
/// Proxy class for `copyWith` functionality. This is a callable class and can be used as follows: `instanceOfGoalOut.copyWith(...)`. Additionally contains functions for specific fields e.g. `instanceOfGoalOut.copyWith.fieldName(...)`
|
||||
class _$GoalOutCWProxyImpl implements _$GoalOutCWProxy {
|
||||
const _$GoalOutCWProxyImpl(this._value);
|
||||
|
||||
final GoalOut _value;
|
||||
|
||||
@override
|
||||
GoalOut archived(bool archived) => this(archived: archived);
|
||||
|
||||
@override
|
||||
GoalOut currency(String currency) => this(currency: currency);
|
||||
|
||||
@override
|
||||
GoalOut id(int id) => this(id: id);
|
||||
|
||||
@override
|
||||
GoalOut monthlyContribution(String? monthlyContribution) =>
|
||||
this(monthlyContribution: monthlyContribution);
|
||||
|
||||
@override
|
||||
GoalOut name(String name) => this(name: name);
|
||||
|
||||
@override
|
||||
GoalOut note(String? note) => this(note: note);
|
||||
|
||||
@override
|
||||
GoalOut scope(String scope) => this(scope: scope);
|
||||
|
||||
@override
|
||||
GoalOut targetAmount(String targetAmount) => this(targetAmount: targetAmount);
|
||||
|
||||
@override
|
||||
GoalOut targetDate(DateTime? targetDate) => this(targetDate: targetDate);
|
||||
|
||||
@override
|
||||
/// This function **does support** nullification of nullable fields. All `null` values passed to `non-nullable` fields will be ignored. You can also use `GoalOut(...).copyWith.fieldName(...)` to override fields one at a time with nullification support.
|
||||
///
|
||||
/// Usage
|
||||
/// ```dart
|
||||
/// GoalOut(...).copyWith(id: 12, name: "My name")
|
||||
/// ````
|
||||
GoalOut call({
|
||||
Object? archived = const $CopyWithPlaceholder(),
|
||||
Object? currency = const $CopyWithPlaceholder(),
|
||||
Object? id = const $CopyWithPlaceholder(),
|
||||
Object? monthlyContribution = const $CopyWithPlaceholder(),
|
||||
Object? name = const $CopyWithPlaceholder(),
|
||||
Object? note = const $CopyWithPlaceholder(),
|
||||
Object? scope = const $CopyWithPlaceholder(),
|
||||
Object? targetAmount = const $CopyWithPlaceholder(),
|
||||
Object? targetDate = const $CopyWithPlaceholder(),
|
||||
}) {
|
||||
return GoalOut(
|
||||
archived: archived == const $CopyWithPlaceholder()
|
||||
? _value.archived
|
||||
// ignore: cast_nullable_to_non_nullable
|
||||
: archived as bool,
|
||||
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,
|
||||
monthlyContribution: monthlyContribution == const $CopyWithPlaceholder()
|
||||
? _value.monthlyContribution
|
||||
// ignore: cast_nullable_to_non_nullable
|
||||
: monthlyContribution as String?,
|
||||
name: name == const $CopyWithPlaceholder()
|
||||
? _value.name
|
||||
// ignore: cast_nullable_to_non_nullable
|
||||
: name as String,
|
||||
note: note == const $CopyWithPlaceholder()
|
||||
? _value.note
|
||||
// ignore: cast_nullable_to_non_nullable
|
||||
: note as String?,
|
||||
scope: scope == const $CopyWithPlaceholder()
|
||||
? _value.scope
|
||||
// ignore: cast_nullable_to_non_nullable
|
||||
: scope as String,
|
||||
targetAmount: targetAmount == const $CopyWithPlaceholder()
|
||||
? _value.targetAmount
|
||||
// ignore: cast_nullable_to_non_nullable
|
||||
: targetAmount as String,
|
||||
targetDate: targetDate == const $CopyWithPlaceholder()
|
||||
? _value.targetDate
|
||||
// ignore: cast_nullable_to_non_nullable
|
||||
: targetDate as DateTime?,
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
extension $GoalOutCopyWith on GoalOut {
|
||||
/// Returns a callable class that can be used as follows: `instanceOfGoalOut.copyWith(...)` or like so:`instanceOfGoalOut.copyWith.fieldName(...)`.
|
||||
// ignore: library_private_types_in_public_api
|
||||
_$GoalOutCWProxy get copyWith => _$GoalOutCWProxyImpl(this);
|
||||
}
|
||||
|
||||
// **************************************************************************
|
||||
// JsonSerializableGenerator
|
||||
// **************************************************************************
|
||||
|
||||
GoalOut _$GoalOutFromJson(Map<String, dynamic> json) => $checkedCreate(
|
||||
'GoalOut',
|
||||
json,
|
||||
($checkedConvert) {
|
||||
$checkKeys(
|
||||
json,
|
||||
requiredKeys: const [
|
||||
'archived',
|
||||
'currency',
|
||||
'id',
|
||||
'monthly_contribution',
|
||||
'name',
|
||||
'note',
|
||||
'scope',
|
||||
'target_amount',
|
||||
'target_date',
|
||||
],
|
||||
);
|
||||
final val = GoalOut(
|
||||
archived: $checkedConvert('archived', (v) => v as bool),
|
||||
currency: $checkedConvert('currency', (v) => v as String),
|
||||
id: $checkedConvert('id', (v) => (v as num).toInt()),
|
||||
monthlyContribution: $checkedConvert(
|
||||
'monthly_contribution',
|
||||
(v) => v as String?,
|
||||
),
|
||||
name: $checkedConvert('name', (v) => v as String),
|
||||
note: $checkedConvert('note', (v) => v as String?),
|
||||
scope: $checkedConvert('scope', (v) => v as String),
|
||||
targetAmount: $checkedConvert('target_amount', (v) => v as String),
|
||||
targetDate: $checkedConvert(
|
||||
'target_date',
|
||||
(v) => v == null ? null : DateTime.parse(v as String),
|
||||
),
|
||||
);
|
||||
return val;
|
||||
},
|
||||
fieldKeyMap: const {
|
||||
'monthlyContribution': 'monthly_contribution',
|
||||
'targetAmount': 'target_amount',
|
||||
'targetDate': 'target_date',
|
||||
},
|
||||
);
|
||||
|
||||
Map<String, dynamic> _$GoalOutToJson(GoalOut instance) => <String, dynamic>{
|
||||
'archived': instance.archived,
|
||||
'currency': instance.currency,
|
||||
'id': instance.id,
|
||||
'monthly_contribution': instance.monthlyContribution,
|
||||
'name': instance.name,
|
||||
'note': instance.note,
|
||||
'scope': instance.scope,
|
||||
'target_amount': instance.targetAmount,
|
||||
'target_date': instance.targetDate?.toIso8601String(),
|
||||
};
|
||||
@@ -0,0 +1,172 @@
|
||||
//
|
||||
// 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 'goal_patch.g.dart';
|
||||
|
||||
|
||||
@CopyWith()
|
||||
@JsonSerializable(
|
||||
checked: true,
|
||||
createToJson: true,
|
||||
disallowUnrecognizedKeys: false,
|
||||
explicitToJson: true,
|
||||
)
|
||||
class GoalPatch {
|
||||
/// Returns a new [GoalPatch] instance.
|
||||
GoalPatch({
|
||||
|
||||
this.archived,
|
||||
|
||||
this.currency,
|
||||
|
||||
this.monthlyContribution,
|
||||
|
||||
this.name,
|
||||
|
||||
this.note,
|
||||
|
||||
this.scope,
|
||||
|
||||
this.targetAmount,
|
||||
|
||||
this.targetDate,
|
||||
});
|
||||
|
||||
@JsonKey(
|
||||
|
||||
name: r'archived',
|
||||
required: false,
|
||||
includeIfNull: false,
|
||||
)
|
||||
|
||||
|
||||
final bool? archived;
|
||||
|
||||
|
||||
|
||||
@JsonKey(
|
||||
|
||||
name: r'currency',
|
||||
required: false,
|
||||
includeIfNull: false,
|
||||
)
|
||||
|
||||
|
||||
final String? currency;
|
||||
|
||||
|
||||
|
||||
/// decimal as string
|
||||
@JsonKey(
|
||||
|
||||
name: r'monthly_contribution',
|
||||
required: false,
|
||||
includeIfNull: false,
|
||||
)
|
||||
|
||||
|
||||
final String? monthlyContribution;
|
||||
|
||||
|
||||
|
||||
@JsonKey(
|
||||
|
||||
name: r'name',
|
||||
required: false,
|
||||
includeIfNull: false,
|
||||
)
|
||||
|
||||
|
||||
final String? name;
|
||||
|
||||
|
||||
|
||||
@JsonKey(
|
||||
|
||||
name: r'note',
|
||||
required: false,
|
||||
includeIfNull: false,
|
||||
)
|
||||
|
||||
|
||||
final String? note;
|
||||
|
||||
|
||||
|
||||
@JsonKey(
|
||||
|
||||
name: r'scope',
|
||||
required: false,
|
||||
includeIfNull: false,
|
||||
)
|
||||
|
||||
|
||||
final String? scope;
|
||||
|
||||
|
||||
|
||||
/// decimal as string
|
||||
@JsonKey(
|
||||
|
||||
name: r'target_amount',
|
||||
required: false,
|
||||
includeIfNull: false,
|
||||
)
|
||||
|
||||
|
||||
final String? targetAmount;
|
||||
|
||||
|
||||
|
||||
@JsonKey(
|
||||
|
||||
name: r'target_date',
|
||||
required: false,
|
||||
includeIfNull: false,
|
||||
)
|
||||
|
||||
|
||||
final DateTime? targetDate;
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
@override
|
||||
bool operator ==(Object other) => identical(this, other) || other is GoalPatch &&
|
||||
other.archived == archived &&
|
||||
other.currency == currency &&
|
||||
other.monthlyContribution == monthlyContribution &&
|
||||
other.name == name &&
|
||||
other.note == note &&
|
||||
other.scope == scope &&
|
||||
other.targetAmount == targetAmount &&
|
||||
other.targetDate == targetDate;
|
||||
|
||||
@override
|
||||
int get hashCode =>
|
||||
(archived == null ? 0 : archived.hashCode) +
|
||||
(currency == null ? 0 : currency.hashCode) +
|
||||
(monthlyContribution == null ? 0 : monthlyContribution.hashCode) +
|
||||
(name == null ? 0 : name.hashCode) +
|
||||
(note == null ? 0 : note.hashCode) +
|
||||
(scope == null ? 0 : scope.hashCode) +
|
||||
(targetAmount == null ? 0 : targetAmount.hashCode) +
|
||||
(targetDate == null ? 0 : targetDate.hashCode);
|
||||
|
||||
factory GoalPatch.fromJson(Map<String, dynamic> json) => _$GoalPatchFromJson(json);
|
||||
|
||||
Map<String, dynamic> toJson() => _$GoalPatchToJson(this);
|
||||
|
||||
@override
|
||||
String toString() {
|
||||
return toJson().toString();
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -0,0 +1,178 @@
|
||||
// GENERATED CODE - DO NOT MODIFY BY HAND
|
||||
|
||||
part of 'goal_patch.dart';
|
||||
|
||||
// **************************************************************************
|
||||
// CopyWithGenerator
|
||||
// **************************************************************************
|
||||
|
||||
abstract class _$GoalPatchCWProxy {
|
||||
GoalPatch archived(bool? archived);
|
||||
|
||||
GoalPatch currency(String? currency);
|
||||
|
||||
GoalPatch monthlyContribution(String? monthlyContribution);
|
||||
|
||||
GoalPatch name(String? name);
|
||||
|
||||
GoalPatch note(String? note);
|
||||
|
||||
GoalPatch scope(String? scope);
|
||||
|
||||
GoalPatch targetAmount(String? targetAmount);
|
||||
|
||||
GoalPatch targetDate(DateTime? targetDate);
|
||||
|
||||
/// This function **does support** nullification of nullable fields. All `null` values passed to `non-nullable` fields will be ignored. You can also use `GoalPatch(...).copyWith.fieldName(...)` to override fields one at a time with nullification support.
|
||||
///
|
||||
/// Usage
|
||||
/// ```dart
|
||||
/// GoalPatch(...).copyWith(id: 12, name: "My name")
|
||||
/// ````
|
||||
GoalPatch call({
|
||||
bool? archived,
|
||||
String? currency,
|
||||
String? monthlyContribution,
|
||||
String? name,
|
||||
String? note,
|
||||
String? scope,
|
||||
String? targetAmount,
|
||||
DateTime? targetDate,
|
||||
});
|
||||
}
|
||||
|
||||
/// Proxy class for `copyWith` functionality. This is a callable class and can be used as follows: `instanceOfGoalPatch.copyWith(...)`. Additionally contains functions for specific fields e.g. `instanceOfGoalPatch.copyWith.fieldName(...)`
|
||||
class _$GoalPatchCWProxyImpl implements _$GoalPatchCWProxy {
|
||||
const _$GoalPatchCWProxyImpl(this._value);
|
||||
|
||||
final GoalPatch _value;
|
||||
|
||||
@override
|
||||
GoalPatch archived(bool? archived) => this(archived: archived);
|
||||
|
||||
@override
|
||||
GoalPatch currency(String? currency) => this(currency: currency);
|
||||
|
||||
@override
|
||||
GoalPatch monthlyContribution(String? monthlyContribution) =>
|
||||
this(monthlyContribution: monthlyContribution);
|
||||
|
||||
@override
|
||||
GoalPatch name(String? name) => this(name: name);
|
||||
|
||||
@override
|
||||
GoalPatch note(String? note) => this(note: note);
|
||||
|
||||
@override
|
||||
GoalPatch scope(String? scope) => this(scope: scope);
|
||||
|
||||
@override
|
||||
GoalPatch targetAmount(String? targetAmount) =>
|
||||
this(targetAmount: targetAmount);
|
||||
|
||||
@override
|
||||
GoalPatch targetDate(DateTime? targetDate) => this(targetDate: targetDate);
|
||||
|
||||
@override
|
||||
/// This function **does support** nullification of nullable fields. All `null` values passed to `non-nullable` fields will be ignored. You can also use `GoalPatch(...).copyWith.fieldName(...)` to override fields one at a time with nullification support.
|
||||
///
|
||||
/// Usage
|
||||
/// ```dart
|
||||
/// GoalPatch(...).copyWith(id: 12, name: "My name")
|
||||
/// ````
|
||||
GoalPatch call({
|
||||
Object? archived = const $CopyWithPlaceholder(),
|
||||
Object? currency = const $CopyWithPlaceholder(),
|
||||
Object? monthlyContribution = const $CopyWithPlaceholder(),
|
||||
Object? name = const $CopyWithPlaceholder(),
|
||||
Object? note = const $CopyWithPlaceholder(),
|
||||
Object? scope = const $CopyWithPlaceholder(),
|
||||
Object? targetAmount = const $CopyWithPlaceholder(),
|
||||
Object? targetDate = const $CopyWithPlaceholder(),
|
||||
}) {
|
||||
return GoalPatch(
|
||||
archived: archived == const $CopyWithPlaceholder()
|
||||
? _value.archived
|
||||
// ignore: cast_nullable_to_non_nullable
|
||||
: archived as bool?,
|
||||
currency: currency == const $CopyWithPlaceholder()
|
||||
? _value.currency
|
||||
// ignore: cast_nullable_to_non_nullable
|
||||
: currency as String?,
|
||||
monthlyContribution: monthlyContribution == const $CopyWithPlaceholder()
|
||||
? _value.monthlyContribution
|
||||
// ignore: cast_nullable_to_non_nullable
|
||||
: monthlyContribution as String?,
|
||||
name: name == const $CopyWithPlaceholder()
|
||||
? _value.name
|
||||
// ignore: cast_nullable_to_non_nullable
|
||||
: name as String?,
|
||||
note: note == const $CopyWithPlaceholder()
|
||||
? _value.note
|
||||
// ignore: cast_nullable_to_non_nullable
|
||||
: note as String?,
|
||||
scope: scope == const $CopyWithPlaceholder()
|
||||
? _value.scope
|
||||
// ignore: cast_nullable_to_non_nullable
|
||||
: scope as String?,
|
||||
targetAmount: targetAmount == const $CopyWithPlaceholder()
|
||||
? _value.targetAmount
|
||||
// ignore: cast_nullable_to_non_nullable
|
||||
: targetAmount as String?,
|
||||
targetDate: targetDate == const $CopyWithPlaceholder()
|
||||
? _value.targetDate
|
||||
// ignore: cast_nullable_to_non_nullable
|
||||
: targetDate as DateTime?,
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
extension $GoalPatchCopyWith on GoalPatch {
|
||||
/// Returns a callable class that can be used as follows: `instanceOfGoalPatch.copyWith(...)` or like so:`instanceOfGoalPatch.copyWith.fieldName(...)`.
|
||||
// ignore: library_private_types_in_public_api
|
||||
_$GoalPatchCWProxy get copyWith => _$GoalPatchCWProxyImpl(this);
|
||||
}
|
||||
|
||||
// **************************************************************************
|
||||
// JsonSerializableGenerator
|
||||
// **************************************************************************
|
||||
|
||||
GoalPatch _$GoalPatchFromJson(Map<String, dynamic> json) => $checkedCreate(
|
||||
'GoalPatch',
|
||||
json,
|
||||
($checkedConvert) {
|
||||
final val = GoalPatch(
|
||||
archived: $checkedConvert('archived', (v) => v as bool?),
|
||||
currency: $checkedConvert('currency', (v) => v as String?),
|
||||
monthlyContribution: $checkedConvert(
|
||||
'monthly_contribution',
|
||||
(v) => v as String?,
|
||||
),
|
||||
name: $checkedConvert('name', (v) => v as String?),
|
||||
note: $checkedConvert('note', (v) => v as String?),
|
||||
scope: $checkedConvert('scope', (v) => v as String?),
|
||||
targetAmount: $checkedConvert('target_amount', (v) => v as String?),
|
||||
targetDate: $checkedConvert(
|
||||
'target_date',
|
||||
(v) => v == null ? null : DateTime.parse(v as String),
|
||||
),
|
||||
);
|
||||
return val;
|
||||
},
|
||||
fieldKeyMap: const {
|
||||
'monthlyContribution': 'monthly_contribution',
|
||||
'targetAmount': 'target_amount',
|
||||
'targetDate': 'target_date',
|
||||
},
|
||||
);
|
||||
|
||||
Map<String, dynamic> _$GoalPatchToJson(GoalPatch instance) => <String, dynamic>{
|
||||
'archived': ?instance.archived,
|
||||
'currency': ?instance.currency,
|
||||
'monthly_contribution': ?instance.monthlyContribution,
|
||||
'name': ?instance.name,
|
||||
'note': ?instance.note,
|
||||
'scope': ?instance.scope,
|
||||
'target_amount': ?instance.targetAmount,
|
||||
'target_date': ?instance.targetDate?.toIso8601String(),
|
||||
};
|
||||
@@ -0,0 +1,207 @@
|
||||
//
|
||||
// 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 'goal_progress_out.g.dart';
|
||||
|
||||
|
||||
@CopyWith()
|
||||
@JsonSerializable(
|
||||
checked: true,
|
||||
createToJson: true,
|
||||
disallowUnrecognizedKeys: false,
|
||||
explicitToJson: true,
|
||||
)
|
||||
class GoalProgressOut {
|
||||
/// Returns a new [GoalProgressOut] instance.
|
||||
GoalProgressOut({
|
||||
|
||||
required this.asOf,
|
||||
|
||||
required this.assumedRate,
|
||||
|
||||
required this.basis,
|
||||
|
||||
required this.currentValueRub,
|
||||
|
||||
required this.goalId,
|
||||
|
||||
required this.monthlyNeededRub,
|
||||
|
||||
required this.onTrack,
|
||||
|
||||
required this.progress,
|
||||
|
||||
required this.projectedDate,
|
||||
|
||||
required this.targetAmountRub,
|
||||
});
|
||||
|
||||
@JsonKey(
|
||||
|
||||
name: r'as_of',
|
||||
required: true,
|
||||
includeIfNull: false,
|
||||
)
|
||||
|
||||
|
||||
final DateTime asOf;
|
||||
|
||||
|
||||
|
||||
/// decimal as string
|
||||
@JsonKey(
|
||||
|
||||
name: r'assumed_rate',
|
||||
required: true,
|
||||
includeIfNull: true,
|
||||
)
|
||||
|
||||
|
||||
final String? assumedRate;
|
||||
|
||||
|
||||
|
||||
@JsonKey(
|
||||
|
||||
name: r'basis',
|
||||
required: true,
|
||||
includeIfNull: false,
|
||||
)
|
||||
|
||||
|
||||
final String basis;
|
||||
|
||||
|
||||
|
||||
/// decimal as string
|
||||
@JsonKey(
|
||||
|
||||
name: r'current_value_rub',
|
||||
required: true,
|
||||
includeIfNull: false,
|
||||
)
|
||||
|
||||
|
||||
final String currentValueRub;
|
||||
|
||||
|
||||
|
||||
@JsonKey(
|
||||
|
||||
name: r'goal_id',
|
||||
required: true,
|
||||
includeIfNull: false,
|
||||
)
|
||||
|
||||
|
||||
final int goalId;
|
||||
|
||||
|
||||
|
||||
/// decimal as string
|
||||
@JsonKey(
|
||||
|
||||
name: r'monthly_needed_rub',
|
||||
required: true,
|
||||
includeIfNull: true,
|
||||
)
|
||||
|
||||
|
||||
final String? monthlyNeededRub;
|
||||
|
||||
|
||||
|
||||
@JsonKey(
|
||||
|
||||
name: r'on_track',
|
||||
required: true,
|
||||
includeIfNull: true,
|
||||
)
|
||||
|
||||
|
||||
final bool? onTrack;
|
||||
|
||||
|
||||
|
||||
/// decimal as string
|
||||
@JsonKey(
|
||||
|
||||
name: r'progress',
|
||||
required: true,
|
||||
includeIfNull: false,
|
||||
)
|
||||
|
||||
|
||||
final String progress;
|
||||
|
||||
|
||||
|
||||
@JsonKey(
|
||||
|
||||
name: r'projected_date',
|
||||
required: true,
|
||||
includeIfNull: true,
|
||||
)
|
||||
|
||||
|
||||
final DateTime? projectedDate;
|
||||
|
||||
|
||||
|
||||
/// decimal as string
|
||||
@JsonKey(
|
||||
|
||||
name: r'target_amount_rub',
|
||||
required: true,
|
||||
includeIfNull: false,
|
||||
)
|
||||
|
||||
|
||||
final String targetAmountRub;
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
@override
|
||||
bool operator ==(Object other) => identical(this, other) || other is GoalProgressOut &&
|
||||
other.asOf == asOf &&
|
||||
other.assumedRate == assumedRate &&
|
||||
other.basis == basis &&
|
||||
other.currentValueRub == currentValueRub &&
|
||||
other.goalId == goalId &&
|
||||
other.monthlyNeededRub == monthlyNeededRub &&
|
||||
other.onTrack == onTrack &&
|
||||
other.progress == progress &&
|
||||
other.projectedDate == projectedDate &&
|
||||
other.targetAmountRub == targetAmountRub;
|
||||
|
||||
@override
|
||||
int get hashCode =>
|
||||
asOf.hashCode +
|
||||
(assumedRate == null ? 0 : assumedRate.hashCode) +
|
||||
basis.hashCode +
|
||||
currentValueRub.hashCode +
|
||||
goalId.hashCode +
|
||||
(monthlyNeededRub == null ? 0 : monthlyNeededRub.hashCode) +
|
||||
(onTrack == null ? 0 : onTrack.hashCode) +
|
||||
progress.hashCode +
|
||||
(projectedDate == null ? 0 : projectedDate.hashCode) +
|
||||
targetAmountRub.hashCode;
|
||||
|
||||
factory GoalProgressOut.fromJson(Map<String, dynamic> json) => _$GoalProgressOutFromJson(json);
|
||||
|
||||
Map<String, dynamic> toJson() => _$GoalProgressOutToJson(this);
|
||||
|
||||
@override
|
||||
String toString() {
|
||||
return toJson().toString();
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -0,0 +1,230 @@
|
||||
// GENERATED CODE - DO NOT MODIFY BY HAND
|
||||
|
||||
part of 'goal_progress_out.dart';
|
||||
|
||||
// **************************************************************************
|
||||
// CopyWithGenerator
|
||||
// **************************************************************************
|
||||
|
||||
abstract class _$GoalProgressOutCWProxy {
|
||||
GoalProgressOut asOf(DateTime asOf);
|
||||
|
||||
GoalProgressOut assumedRate(String? assumedRate);
|
||||
|
||||
GoalProgressOut basis(String basis);
|
||||
|
||||
GoalProgressOut currentValueRub(String currentValueRub);
|
||||
|
||||
GoalProgressOut goalId(int goalId);
|
||||
|
||||
GoalProgressOut monthlyNeededRub(String? monthlyNeededRub);
|
||||
|
||||
GoalProgressOut onTrack(bool? onTrack);
|
||||
|
||||
GoalProgressOut progress(String progress);
|
||||
|
||||
GoalProgressOut projectedDate(DateTime? projectedDate);
|
||||
|
||||
GoalProgressOut targetAmountRub(String targetAmountRub);
|
||||
|
||||
/// This function **does support** nullification of nullable fields. All `null` values passed to `non-nullable` fields will be ignored. You can also use `GoalProgressOut(...).copyWith.fieldName(...)` to override fields one at a time with nullification support.
|
||||
///
|
||||
/// Usage
|
||||
/// ```dart
|
||||
/// GoalProgressOut(...).copyWith(id: 12, name: "My name")
|
||||
/// ````
|
||||
GoalProgressOut call({
|
||||
DateTime asOf,
|
||||
String? assumedRate,
|
||||
String basis,
|
||||
String currentValueRub,
|
||||
int goalId,
|
||||
String? monthlyNeededRub,
|
||||
bool? onTrack,
|
||||
String progress,
|
||||
DateTime? projectedDate,
|
||||
String targetAmountRub,
|
||||
});
|
||||
}
|
||||
|
||||
/// Proxy class for `copyWith` functionality. This is a callable class and can be used as follows: `instanceOfGoalProgressOut.copyWith(...)`. Additionally contains functions for specific fields e.g. `instanceOfGoalProgressOut.copyWith.fieldName(...)`
|
||||
class _$GoalProgressOutCWProxyImpl implements _$GoalProgressOutCWProxy {
|
||||
const _$GoalProgressOutCWProxyImpl(this._value);
|
||||
|
||||
final GoalProgressOut _value;
|
||||
|
||||
@override
|
||||
GoalProgressOut asOf(DateTime asOf) => this(asOf: asOf);
|
||||
|
||||
@override
|
||||
GoalProgressOut assumedRate(String? assumedRate) =>
|
||||
this(assumedRate: assumedRate);
|
||||
|
||||
@override
|
||||
GoalProgressOut basis(String basis) => this(basis: basis);
|
||||
|
||||
@override
|
||||
GoalProgressOut currentValueRub(String currentValueRub) =>
|
||||
this(currentValueRub: currentValueRub);
|
||||
|
||||
@override
|
||||
GoalProgressOut goalId(int goalId) => this(goalId: goalId);
|
||||
|
||||
@override
|
||||
GoalProgressOut monthlyNeededRub(String? monthlyNeededRub) =>
|
||||
this(monthlyNeededRub: monthlyNeededRub);
|
||||
|
||||
@override
|
||||
GoalProgressOut onTrack(bool? onTrack) => this(onTrack: onTrack);
|
||||
|
||||
@override
|
||||
GoalProgressOut progress(String progress) => this(progress: progress);
|
||||
|
||||
@override
|
||||
GoalProgressOut projectedDate(DateTime? projectedDate) =>
|
||||
this(projectedDate: projectedDate);
|
||||
|
||||
@override
|
||||
GoalProgressOut targetAmountRub(String targetAmountRub) =>
|
||||
this(targetAmountRub: targetAmountRub);
|
||||
|
||||
@override
|
||||
/// This function **does support** nullification of nullable fields. All `null` values passed to `non-nullable` fields will be ignored. You can also use `GoalProgressOut(...).copyWith.fieldName(...)` to override fields one at a time with nullification support.
|
||||
///
|
||||
/// Usage
|
||||
/// ```dart
|
||||
/// GoalProgressOut(...).copyWith(id: 12, name: "My name")
|
||||
/// ````
|
||||
GoalProgressOut call({
|
||||
Object? asOf = const $CopyWithPlaceholder(),
|
||||
Object? assumedRate = const $CopyWithPlaceholder(),
|
||||
Object? basis = const $CopyWithPlaceholder(),
|
||||
Object? currentValueRub = const $CopyWithPlaceholder(),
|
||||
Object? goalId = const $CopyWithPlaceholder(),
|
||||
Object? monthlyNeededRub = const $CopyWithPlaceholder(),
|
||||
Object? onTrack = const $CopyWithPlaceholder(),
|
||||
Object? progress = const $CopyWithPlaceholder(),
|
||||
Object? projectedDate = const $CopyWithPlaceholder(),
|
||||
Object? targetAmountRub = const $CopyWithPlaceholder(),
|
||||
}) {
|
||||
return GoalProgressOut(
|
||||
asOf: asOf == const $CopyWithPlaceholder()
|
||||
? _value.asOf
|
||||
// ignore: cast_nullable_to_non_nullable
|
||||
: asOf as DateTime,
|
||||
assumedRate: assumedRate == const $CopyWithPlaceholder()
|
||||
? _value.assumedRate
|
||||
// ignore: cast_nullable_to_non_nullable
|
||||
: assumedRate as String?,
|
||||
basis: basis == const $CopyWithPlaceholder()
|
||||
? _value.basis
|
||||
// ignore: cast_nullable_to_non_nullable
|
||||
: basis as String,
|
||||
currentValueRub: currentValueRub == const $CopyWithPlaceholder()
|
||||
? _value.currentValueRub
|
||||
// ignore: cast_nullable_to_non_nullable
|
||||
: currentValueRub as String,
|
||||
goalId: goalId == const $CopyWithPlaceholder()
|
||||
? _value.goalId
|
||||
// ignore: cast_nullable_to_non_nullable
|
||||
: goalId as int,
|
||||
monthlyNeededRub: monthlyNeededRub == const $CopyWithPlaceholder()
|
||||
? _value.monthlyNeededRub
|
||||
// ignore: cast_nullable_to_non_nullable
|
||||
: monthlyNeededRub as String?,
|
||||
onTrack: onTrack == const $CopyWithPlaceholder()
|
||||
? _value.onTrack
|
||||
// ignore: cast_nullable_to_non_nullable
|
||||
: onTrack as bool?,
|
||||
progress: progress == const $CopyWithPlaceholder()
|
||||
? _value.progress
|
||||
// ignore: cast_nullable_to_non_nullable
|
||||
: progress as String,
|
||||
projectedDate: projectedDate == const $CopyWithPlaceholder()
|
||||
? _value.projectedDate
|
||||
// ignore: cast_nullable_to_non_nullable
|
||||
: projectedDate as DateTime?,
|
||||
targetAmountRub: targetAmountRub == const $CopyWithPlaceholder()
|
||||
? _value.targetAmountRub
|
||||
// ignore: cast_nullable_to_non_nullable
|
||||
: targetAmountRub as String,
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
extension $GoalProgressOutCopyWith on GoalProgressOut {
|
||||
/// Returns a callable class that can be used as follows: `instanceOfGoalProgressOut.copyWith(...)` or like so:`instanceOfGoalProgressOut.copyWith.fieldName(...)`.
|
||||
// ignore: library_private_types_in_public_api
|
||||
_$GoalProgressOutCWProxy get copyWith => _$GoalProgressOutCWProxyImpl(this);
|
||||
}
|
||||
|
||||
// **************************************************************************
|
||||
// JsonSerializableGenerator
|
||||
// **************************************************************************
|
||||
|
||||
GoalProgressOut _$GoalProgressOutFromJson(
|
||||
Map<String, dynamic> json,
|
||||
) => $checkedCreate(
|
||||
'GoalProgressOut',
|
||||
json,
|
||||
($checkedConvert) {
|
||||
$checkKeys(
|
||||
json,
|
||||
requiredKeys: const [
|
||||
'as_of',
|
||||
'assumed_rate',
|
||||
'basis',
|
||||
'current_value_rub',
|
||||
'goal_id',
|
||||
'monthly_needed_rub',
|
||||
'on_track',
|
||||
'progress',
|
||||
'projected_date',
|
||||
'target_amount_rub',
|
||||
],
|
||||
);
|
||||
final val = GoalProgressOut(
|
||||
asOf: $checkedConvert('as_of', (v) => DateTime.parse(v as String)),
|
||||
assumedRate: $checkedConvert('assumed_rate', (v) => v as String?),
|
||||
basis: $checkedConvert('basis', (v) => v as String),
|
||||
currentValueRub: $checkedConvert('current_value_rub', (v) => v as String),
|
||||
goalId: $checkedConvert('goal_id', (v) => (v as num).toInt()),
|
||||
monthlyNeededRub: $checkedConvert(
|
||||
'monthly_needed_rub',
|
||||
(v) => v as String?,
|
||||
),
|
||||
onTrack: $checkedConvert('on_track', (v) => v as bool?),
|
||||
progress: $checkedConvert('progress', (v) => v as String),
|
||||
projectedDate: $checkedConvert(
|
||||
'projected_date',
|
||||
(v) => v == null ? null : DateTime.parse(v as String),
|
||||
),
|
||||
targetAmountRub: $checkedConvert('target_amount_rub', (v) => v as String),
|
||||
);
|
||||
return val;
|
||||
},
|
||||
fieldKeyMap: const {
|
||||
'asOf': 'as_of',
|
||||
'assumedRate': 'assumed_rate',
|
||||
'currentValueRub': 'current_value_rub',
|
||||
'goalId': 'goal_id',
|
||||
'monthlyNeededRub': 'monthly_needed_rub',
|
||||
'onTrack': 'on_track',
|
||||
'projectedDate': 'projected_date',
|
||||
'targetAmountRub': 'target_amount_rub',
|
||||
},
|
||||
);
|
||||
|
||||
Map<String, dynamic> _$GoalProgressOutToJson(GoalProgressOut instance) =>
|
||||
<String, dynamic>{
|
||||
'as_of': instance.asOf.toIso8601String(),
|
||||
'assumed_rate': instance.assumedRate,
|
||||
'basis': instance.basis,
|
||||
'current_value_rub': instance.currentValueRub,
|
||||
'goal_id': instance.goalId,
|
||||
'monthly_needed_rub': instance.monthlyNeededRub,
|
||||
'on_track': instance.onTrack,
|
||||
'progress': instance.progress,
|
||||
'projected_date': instance.projectedDate?.toIso8601String(),
|
||||
'target_amount_rub': instance.targetAmountRub,
|
||||
};
|
||||
@@ -0,0 +1,76 @@
|
||||
//
|
||||
// AUTO-GENERATED FILE, DO NOT MODIFY!
|
||||
//
|
||||
|
||||
// ignore_for_file: unused_element
|
||||
import 'package:fintracker_api/src/model/history_row.dart';
|
||||
import 'package:fintracker_api/src/model/history_totals.dart';
|
||||
import 'package:copy_with_extension/copy_with_extension.dart';
|
||||
import 'package:json_annotation/json_annotation.dart';
|
||||
|
||||
part 'history_out.g.dart';
|
||||
|
||||
|
||||
@CopyWith()
|
||||
@JsonSerializable(
|
||||
checked: true,
|
||||
createToJson: true,
|
||||
disallowUnrecognizedKeys: false,
|
||||
explicitToJson: true,
|
||||
)
|
||||
class HistoryOut {
|
||||
/// Returns a new [HistoryOut] instance.
|
||||
HistoryOut({
|
||||
|
||||
required this.rows,
|
||||
|
||||
required this.totals,
|
||||
});
|
||||
|
||||
@JsonKey(
|
||||
|
||||
name: r'rows',
|
||||
required: true,
|
||||
includeIfNull: false,
|
||||
)
|
||||
|
||||
|
||||
final List<HistoryRow> rows;
|
||||
|
||||
|
||||
|
||||
@JsonKey(
|
||||
|
||||
name: r'totals',
|
||||
required: true,
|
||||
includeIfNull: false,
|
||||
)
|
||||
|
||||
|
||||
final HistoryTotals totals;
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
@override
|
||||
bool operator ==(Object other) => identical(this, other) || other is HistoryOut &&
|
||||
other.rows == rows &&
|
||||
other.totals == totals;
|
||||
|
||||
@override
|
||||
int get hashCode =>
|
||||
rows.hashCode +
|
||||
totals.hashCode;
|
||||
|
||||
factory HistoryOut.fromJson(Map<String, dynamic> json) => _$HistoryOutFromJson(json);
|
||||
|
||||
Map<String, dynamic> toJson() => _$HistoryOutToJson(this);
|
||||
|
||||
@override
|
||||
String toString() {
|
||||
return toJson().toString();
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -0,0 +1,91 @@
|
||||
// GENERATED CODE - DO NOT MODIFY BY HAND
|
||||
|
||||
part of 'history_out.dart';
|
||||
|
||||
// **************************************************************************
|
||||
// CopyWithGenerator
|
||||
// **************************************************************************
|
||||
|
||||
abstract class _$HistoryOutCWProxy {
|
||||
HistoryOut rows(List<HistoryRow> rows);
|
||||
|
||||
HistoryOut totals(HistoryTotals totals);
|
||||
|
||||
/// This function **does support** nullification of nullable fields. All `null` values passed to `non-nullable` fields will be ignored. You can also use `HistoryOut(...).copyWith.fieldName(...)` to override fields one at a time with nullification support.
|
||||
///
|
||||
/// Usage
|
||||
/// ```dart
|
||||
/// HistoryOut(...).copyWith(id: 12, name: "My name")
|
||||
/// ````
|
||||
HistoryOut call({List<HistoryRow> rows, HistoryTotals totals});
|
||||
}
|
||||
|
||||
/// Proxy class for `copyWith` functionality. This is a callable class and can be used as follows: `instanceOfHistoryOut.copyWith(...)`. Additionally contains functions for specific fields e.g. `instanceOfHistoryOut.copyWith.fieldName(...)`
|
||||
class _$HistoryOutCWProxyImpl implements _$HistoryOutCWProxy {
|
||||
const _$HistoryOutCWProxyImpl(this._value);
|
||||
|
||||
final HistoryOut _value;
|
||||
|
||||
@override
|
||||
HistoryOut rows(List<HistoryRow> rows) => this(rows: rows);
|
||||
|
||||
@override
|
||||
HistoryOut totals(HistoryTotals totals) => this(totals: totals);
|
||||
|
||||
@override
|
||||
/// This function **does support** nullification of nullable fields. All `null` values passed to `non-nullable` fields will be ignored. You can also use `HistoryOut(...).copyWith.fieldName(...)` to override fields one at a time with nullification support.
|
||||
///
|
||||
/// Usage
|
||||
/// ```dart
|
||||
/// HistoryOut(...).copyWith(id: 12, name: "My name")
|
||||
/// ````
|
||||
HistoryOut call({
|
||||
Object? rows = const $CopyWithPlaceholder(),
|
||||
Object? totals = const $CopyWithPlaceholder(),
|
||||
}) {
|
||||
return HistoryOut(
|
||||
rows: rows == const $CopyWithPlaceholder()
|
||||
? _value.rows
|
||||
// ignore: cast_nullable_to_non_nullable
|
||||
: rows as List<HistoryRow>,
|
||||
totals: totals == const $CopyWithPlaceholder()
|
||||
? _value.totals
|
||||
// ignore: cast_nullable_to_non_nullable
|
||||
: totals as HistoryTotals,
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
extension $HistoryOutCopyWith on HistoryOut {
|
||||
/// Returns a callable class that can be used as follows: `instanceOfHistoryOut.copyWith(...)` or like so:`instanceOfHistoryOut.copyWith.fieldName(...)`.
|
||||
// ignore: library_private_types_in_public_api
|
||||
_$HistoryOutCWProxy get copyWith => _$HistoryOutCWProxyImpl(this);
|
||||
}
|
||||
|
||||
// **************************************************************************
|
||||
// JsonSerializableGenerator
|
||||
// **************************************************************************
|
||||
|
||||
HistoryOut _$HistoryOutFromJson(Map<String, dynamic> json) =>
|
||||
$checkedCreate('HistoryOut', json, ($checkedConvert) {
|
||||
$checkKeys(json, requiredKeys: const ['rows', 'totals']);
|
||||
final val = HistoryOut(
|
||||
rows: $checkedConvert(
|
||||
'rows',
|
||||
(v) => (v as List<dynamic>)
|
||||
.map((e) => HistoryRow.fromJson(e as Map<String, dynamic>))
|
||||
.toList(),
|
||||
),
|
||||
totals: $checkedConvert(
|
||||
'totals',
|
||||
(v) => HistoryTotals.fromJson(v as Map<String, dynamic>),
|
||||
),
|
||||
);
|
||||
return val;
|
||||
});
|
||||
|
||||
Map<String, dynamic> _$HistoryOutToJson(HistoryOut instance) =>
|
||||
<String, dynamic>{
|
||||
'rows': instance.rows.map((e) => e.toJson()).toList(),
|
||||
'totals': instance.totals.toJson(),
|
||||
};
|
||||
@@ -0,0 +1,157 @@
|
||||
//
|
||||
// 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 'history_row.g.dart';
|
||||
|
||||
|
||||
@CopyWith()
|
||||
@JsonSerializable(
|
||||
checked: true,
|
||||
createToJson: true,
|
||||
disallowUnrecognizedKeys: false,
|
||||
explicitToJson: true,
|
||||
)
|
||||
class HistoryRow {
|
||||
/// Returns a new [HistoryRow] instance.
|
||||
HistoryRow({
|
||||
|
||||
required this.amount,
|
||||
|
||||
required this.amountRub,
|
||||
|
||||
required this.currency,
|
||||
|
||||
required this.kind,
|
||||
|
||||
required this.month,
|
||||
|
||||
required this.paymentCount,
|
||||
|
||||
required this.taxWithheld,
|
||||
});
|
||||
|
||||
/// decimal as string
|
||||
@JsonKey(
|
||||
|
||||
name: r'amount',
|
||||
required: true,
|
||||
includeIfNull: false,
|
||||
)
|
||||
|
||||
|
||||
final String amount;
|
||||
|
||||
|
||||
|
||||
/// decimal as string
|
||||
@JsonKey(
|
||||
|
||||
name: r'amount_rub',
|
||||
required: true,
|
||||
includeIfNull: true,
|
||||
)
|
||||
|
||||
|
||||
final String? amountRub;
|
||||
|
||||
|
||||
|
||||
@JsonKey(
|
||||
|
||||
name: r'currency',
|
||||
required: true,
|
||||
includeIfNull: false,
|
||||
)
|
||||
|
||||
|
||||
final String currency;
|
||||
|
||||
|
||||
|
||||
@JsonKey(
|
||||
|
||||
name: r'kind',
|
||||
required: true,
|
||||
includeIfNull: false,
|
||||
)
|
||||
|
||||
|
||||
final String kind;
|
||||
|
||||
|
||||
|
||||
@JsonKey(
|
||||
|
||||
name: r'month',
|
||||
required: true,
|
||||
includeIfNull: false,
|
||||
)
|
||||
|
||||
|
||||
final DateTime month;
|
||||
|
||||
|
||||
|
||||
@JsonKey(
|
||||
|
||||
name: r'payment_count',
|
||||
required: true,
|
||||
includeIfNull: false,
|
||||
)
|
||||
|
||||
|
||||
final int paymentCount;
|
||||
|
||||
|
||||
|
||||
/// decimal as string
|
||||
@JsonKey(
|
||||
|
||||
name: r'tax_withheld',
|
||||
required: true,
|
||||
includeIfNull: false,
|
||||
)
|
||||
|
||||
|
||||
final String taxWithheld;
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
@override
|
||||
bool operator ==(Object other) => identical(this, other) || other is HistoryRow &&
|
||||
other.amount == amount &&
|
||||
other.amountRub == amountRub &&
|
||||
other.currency == currency &&
|
||||
other.kind == kind &&
|
||||
other.month == month &&
|
||||
other.paymentCount == paymentCount &&
|
||||
other.taxWithheld == taxWithheld;
|
||||
|
||||
@override
|
||||
int get hashCode =>
|
||||
amount.hashCode +
|
||||
(amountRub == null ? 0 : amountRub.hashCode) +
|
||||
currency.hashCode +
|
||||
kind.hashCode +
|
||||
month.hashCode +
|
||||
paymentCount.hashCode +
|
||||
taxWithheld.hashCode;
|
||||
|
||||
factory HistoryRow.fromJson(Map<String, dynamic> json) => _$HistoryRowFromJson(json);
|
||||
|
||||
Map<String, dynamic> toJson() => _$HistoryRowToJson(this);
|
||||
|
||||
@override
|
||||
String toString() {
|
||||
return toJson().toString();
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -0,0 +1,170 @@
|
||||
// GENERATED CODE - DO NOT MODIFY BY HAND
|
||||
|
||||
part of 'history_row.dart';
|
||||
|
||||
// **************************************************************************
|
||||
// CopyWithGenerator
|
||||
// **************************************************************************
|
||||
|
||||
abstract class _$HistoryRowCWProxy {
|
||||
HistoryRow amount(String amount);
|
||||
|
||||
HistoryRow amountRub(String? amountRub);
|
||||
|
||||
HistoryRow currency(String currency);
|
||||
|
||||
HistoryRow kind(String kind);
|
||||
|
||||
HistoryRow month(DateTime month);
|
||||
|
||||
HistoryRow paymentCount(int paymentCount);
|
||||
|
||||
HistoryRow taxWithheld(String taxWithheld);
|
||||
|
||||
/// This function **does support** nullification of nullable fields. All `null` values passed to `non-nullable` fields will be ignored. You can also use `HistoryRow(...).copyWith.fieldName(...)` to override fields one at a time with nullification support.
|
||||
///
|
||||
/// Usage
|
||||
/// ```dart
|
||||
/// HistoryRow(...).copyWith(id: 12, name: "My name")
|
||||
/// ````
|
||||
HistoryRow call({
|
||||
String amount,
|
||||
String? amountRub,
|
||||
String currency,
|
||||
String kind,
|
||||
DateTime month,
|
||||
int paymentCount,
|
||||
String taxWithheld,
|
||||
});
|
||||
}
|
||||
|
||||
/// Proxy class for `copyWith` functionality. This is a callable class and can be used as follows: `instanceOfHistoryRow.copyWith(...)`. Additionally contains functions for specific fields e.g. `instanceOfHistoryRow.copyWith.fieldName(...)`
|
||||
class _$HistoryRowCWProxyImpl implements _$HistoryRowCWProxy {
|
||||
const _$HistoryRowCWProxyImpl(this._value);
|
||||
|
||||
final HistoryRow _value;
|
||||
|
||||
@override
|
||||
HistoryRow amount(String amount) => this(amount: amount);
|
||||
|
||||
@override
|
||||
HistoryRow amountRub(String? amountRub) => this(amountRub: amountRub);
|
||||
|
||||
@override
|
||||
HistoryRow currency(String currency) => this(currency: currency);
|
||||
|
||||
@override
|
||||
HistoryRow kind(String kind) => this(kind: kind);
|
||||
|
||||
@override
|
||||
HistoryRow month(DateTime month) => this(month: month);
|
||||
|
||||
@override
|
||||
HistoryRow paymentCount(int paymentCount) => this(paymentCount: paymentCount);
|
||||
|
||||
@override
|
||||
HistoryRow taxWithheld(String taxWithheld) => this(taxWithheld: taxWithheld);
|
||||
|
||||
@override
|
||||
/// This function **does support** nullification of nullable fields. All `null` values passed to `non-nullable` fields will be ignored. You can also use `HistoryRow(...).copyWith.fieldName(...)` to override fields one at a time with nullification support.
|
||||
///
|
||||
/// Usage
|
||||
/// ```dart
|
||||
/// HistoryRow(...).copyWith(id: 12, name: "My name")
|
||||
/// ````
|
||||
HistoryRow call({
|
||||
Object? amount = const $CopyWithPlaceholder(),
|
||||
Object? amountRub = const $CopyWithPlaceholder(),
|
||||
Object? currency = const $CopyWithPlaceholder(),
|
||||
Object? kind = const $CopyWithPlaceholder(),
|
||||
Object? month = const $CopyWithPlaceholder(),
|
||||
Object? paymentCount = const $CopyWithPlaceholder(),
|
||||
Object? taxWithheld = const $CopyWithPlaceholder(),
|
||||
}) {
|
||||
return HistoryRow(
|
||||
amount: amount == const $CopyWithPlaceholder()
|
||||
? _value.amount
|
||||
// ignore: cast_nullable_to_non_nullable
|
||||
: amount as String,
|
||||
amountRub: amountRub == const $CopyWithPlaceholder()
|
||||
? _value.amountRub
|
||||
// ignore: cast_nullable_to_non_nullable
|
||||
: amountRub as String?,
|
||||
currency: currency == const $CopyWithPlaceholder()
|
||||
? _value.currency
|
||||
// ignore: cast_nullable_to_non_nullable
|
||||
: currency as String,
|
||||
kind: kind == const $CopyWithPlaceholder()
|
||||
? _value.kind
|
||||
// ignore: cast_nullable_to_non_nullable
|
||||
: kind as String,
|
||||
month: month == const $CopyWithPlaceholder()
|
||||
? _value.month
|
||||
// ignore: cast_nullable_to_non_nullable
|
||||
: month as DateTime,
|
||||
paymentCount: paymentCount == const $CopyWithPlaceholder()
|
||||
? _value.paymentCount
|
||||
// ignore: cast_nullable_to_non_nullable
|
||||
: paymentCount as int,
|
||||
taxWithheld: taxWithheld == const $CopyWithPlaceholder()
|
||||
? _value.taxWithheld
|
||||
// ignore: cast_nullable_to_non_nullable
|
||||
: taxWithheld as String,
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
extension $HistoryRowCopyWith on HistoryRow {
|
||||
/// Returns a callable class that can be used as follows: `instanceOfHistoryRow.copyWith(...)` or like so:`instanceOfHistoryRow.copyWith.fieldName(...)`.
|
||||
// ignore: library_private_types_in_public_api
|
||||
_$HistoryRowCWProxy get copyWith => _$HistoryRowCWProxyImpl(this);
|
||||
}
|
||||
|
||||
// **************************************************************************
|
||||
// JsonSerializableGenerator
|
||||
// **************************************************************************
|
||||
|
||||
HistoryRow _$HistoryRowFromJson(Map<String, dynamic> json) => $checkedCreate(
|
||||
'HistoryRow',
|
||||
json,
|
||||
($checkedConvert) {
|
||||
$checkKeys(
|
||||
json,
|
||||
requiredKeys: const [
|
||||
'amount',
|
||||
'amount_rub',
|
||||
'currency',
|
||||
'kind',
|
||||
'month',
|
||||
'payment_count',
|
||||
'tax_withheld',
|
||||
],
|
||||
);
|
||||
final val = HistoryRow(
|
||||
amount: $checkedConvert('amount', (v) => v as String),
|
||||
amountRub: $checkedConvert('amount_rub', (v) => v as String?),
|
||||
currency: $checkedConvert('currency', (v) => v as String),
|
||||
kind: $checkedConvert('kind', (v) => v as String),
|
||||
month: $checkedConvert('month', (v) => DateTime.parse(v as String)),
|
||||
paymentCount: $checkedConvert('payment_count', (v) => (v as num).toInt()),
|
||||
taxWithheld: $checkedConvert('tax_withheld', (v) => v as String),
|
||||
);
|
||||
return val;
|
||||
},
|
||||
fieldKeyMap: const {
|
||||
'amountRub': 'amount_rub',
|
||||
'paymentCount': 'payment_count',
|
||||
'taxWithheld': 'tax_withheld',
|
||||
},
|
||||
);
|
||||
|
||||
Map<String, dynamic> _$HistoryRowToJson(HistoryRow instance) =>
|
||||
<String, dynamic>{
|
||||
'amount': instance.amount,
|
||||
'amount_rub': instance.amountRub,
|
||||
'currency': instance.currency,
|
||||
'kind': instance.kind,
|
||||
'month': instance.month.toIso8601String(),
|
||||
'payment_count': instance.paymentCount,
|
||||
'tax_withheld': instance.taxWithheld,
|
||||
};
|
||||
@@ -0,0 +1,76 @@
|
||||
//
|
||||
// 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 'history_totals.g.dart';
|
||||
|
||||
|
||||
@CopyWith()
|
||||
@JsonSerializable(
|
||||
checked: true,
|
||||
createToJson: true,
|
||||
disallowUnrecognizedKeys: false,
|
||||
explicitToJson: true,
|
||||
)
|
||||
class HistoryTotals {
|
||||
/// Returns a new [HistoryTotals] instance.
|
||||
HistoryTotals({
|
||||
|
||||
required this.amountRub,
|
||||
|
||||
required this.taxWithheldRub,
|
||||
});
|
||||
|
||||
/// decimal as string
|
||||
@JsonKey(
|
||||
|
||||
name: r'amount_rub',
|
||||
required: true,
|
||||
includeIfNull: false,
|
||||
)
|
||||
|
||||
|
||||
final String amountRub;
|
||||
|
||||
|
||||
|
||||
/// decimal as string
|
||||
@JsonKey(
|
||||
|
||||
name: r'tax_withheld_rub',
|
||||
required: true,
|
||||
includeIfNull: false,
|
||||
)
|
||||
|
||||
|
||||
final String taxWithheldRub;
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
@override
|
||||
bool operator ==(Object other) => identical(this, other) || other is HistoryTotals &&
|
||||
other.amountRub == amountRub &&
|
||||
other.taxWithheldRub == taxWithheldRub;
|
||||
|
||||
@override
|
||||
int get hashCode =>
|
||||
amountRub.hashCode +
|
||||
taxWithheldRub.hashCode;
|
||||
|
||||
factory HistoryTotals.fromJson(Map<String, dynamic> json) => _$HistoryTotalsFromJson(json);
|
||||
|
||||
Map<String, dynamic> toJson() => _$HistoryTotalsToJson(this);
|
||||
|
||||
@override
|
||||
String toString() {
|
||||
return toJson().toString();
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -0,0 +1,93 @@
|
||||
// GENERATED CODE - DO NOT MODIFY BY HAND
|
||||
|
||||
part of 'history_totals.dart';
|
||||
|
||||
// **************************************************************************
|
||||
// CopyWithGenerator
|
||||
// **************************************************************************
|
||||
|
||||
abstract class _$HistoryTotalsCWProxy {
|
||||
HistoryTotals amountRub(String amountRub);
|
||||
|
||||
HistoryTotals taxWithheldRub(String taxWithheldRub);
|
||||
|
||||
/// This function **does support** nullification of nullable fields. All `null` values passed to `non-nullable` fields will be ignored. You can also use `HistoryTotals(...).copyWith.fieldName(...)` to override fields one at a time with nullification support.
|
||||
///
|
||||
/// Usage
|
||||
/// ```dart
|
||||
/// HistoryTotals(...).copyWith(id: 12, name: "My name")
|
||||
/// ````
|
||||
HistoryTotals call({String amountRub, String taxWithheldRub});
|
||||
}
|
||||
|
||||
/// Proxy class for `copyWith` functionality. This is a callable class and can be used as follows: `instanceOfHistoryTotals.copyWith(...)`. Additionally contains functions for specific fields e.g. `instanceOfHistoryTotals.copyWith.fieldName(...)`
|
||||
class _$HistoryTotalsCWProxyImpl implements _$HistoryTotalsCWProxy {
|
||||
const _$HistoryTotalsCWProxyImpl(this._value);
|
||||
|
||||
final HistoryTotals _value;
|
||||
|
||||
@override
|
||||
HistoryTotals amountRub(String amountRub) => this(amountRub: amountRub);
|
||||
|
||||
@override
|
||||
HistoryTotals taxWithheldRub(String taxWithheldRub) =>
|
||||
this(taxWithheldRub: taxWithheldRub);
|
||||
|
||||
@override
|
||||
/// This function **does support** nullification of nullable fields. All `null` values passed to `non-nullable` fields will be ignored. You can also use `HistoryTotals(...).copyWith.fieldName(...)` to override fields one at a time with nullification support.
|
||||
///
|
||||
/// Usage
|
||||
/// ```dart
|
||||
/// HistoryTotals(...).copyWith(id: 12, name: "My name")
|
||||
/// ````
|
||||
HistoryTotals call({
|
||||
Object? amountRub = const $CopyWithPlaceholder(),
|
||||
Object? taxWithheldRub = const $CopyWithPlaceholder(),
|
||||
}) {
|
||||
return HistoryTotals(
|
||||
amountRub: amountRub == const $CopyWithPlaceholder()
|
||||
? _value.amountRub
|
||||
// ignore: cast_nullable_to_non_nullable
|
||||
: amountRub as String,
|
||||
taxWithheldRub: taxWithheldRub == const $CopyWithPlaceholder()
|
||||
? _value.taxWithheldRub
|
||||
// ignore: cast_nullable_to_non_nullable
|
||||
: taxWithheldRub as String,
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
extension $HistoryTotalsCopyWith on HistoryTotals {
|
||||
/// Returns a callable class that can be used as follows: `instanceOfHistoryTotals.copyWith(...)` or like so:`instanceOfHistoryTotals.copyWith.fieldName(...)`.
|
||||
// ignore: library_private_types_in_public_api
|
||||
_$HistoryTotalsCWProxy get copyWith => _$HistoryTotalsCWProxyImpl(this);
|
||||
}
|
||||
|
||||
// **************************************************************************
|
||||
// JsonSerializableGenerator
|
||||
// **************************************************************************
|
||||
|
||||
HistoryTotals _$HistoryTotalsFromJson(
|
||||
Map<String, dynamic> json,
|
||||
) => $checkedCreate(
|
||||
'HistoryTotals',
|
||||
json,
|
||||
($checkedConvert) {
|
||||
$checkKeys(json, requiredKeys: const ['amount_rub', 'tax_withheld_rub']);
|
||||
final val = HistoryTotals(
|
||||
amountRub: $checkedConvert('amount_rub', (v) => v as String),
|
||||
taxWithheldRub: $checkedConvert('tax_withheld_rub', (v) => v as String),
|
||||
);
|
||||
return val;
|
||||
},
|
||||
fieldKeyMap: const {
|
||||
'amountRub': 'amount_rub',
|
||||
'taxWithheldRub': 'tax_withheld_rub',
|
||||
},
|
||||
);
|
||||
|
||||
Map<String, dynamic> _$HistoryTotalsToJson(HistoryTotals instance) =>
|
||||
<String, dynamic>{
|
||||
'amount_rub': instance.amountRub,
|
||||
'tax_withheld_rub': instance.taxWithheldRub,
|
||||
};
|
||||
@@ -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 'import_counts.g.dart';
|
||||
|
||||
|
||||
@CopyWith()
|
||||
@JsonSerializable(
|
||||
checked: true,
|
||||
createToJson: true,
|
||||
disallowUnrecognizedKeys: false,
|
||||
explicitToJson: true,
|
||||
)
|
||||
class ImportCounts {
|
||||
/// Returns a new [ImportCounts] instance.
|
||||
ImportCounts({
|
||||
|
||||
required this.byKind,
|
||||
|
||||
required this.eventsDuplicate,
|
||||
|
||||
required this.eventsNew,
|
||||
|
||||
required this.eventsPending,
|
||||
|
||||
required this.eventsShadow,
|
||||
|
||||
required this.eventsTotal,
|
||||
|
||||
required this.lines,
|
||||
});
|
||||
|
||||
@JsonKey(
|
||||
|
||||
name: r'by_kind',
|
||||
required: true,
|
||||
includeIfNull: false,
|
||||
)
|
||||
|
||||
|
||||
final Map<String, int> byKind;
|
||||
|
||||
|
||||
|
||||
@JsonKey(
|
||||
|
||||
name: r'events_duplicate',
|
||||
required: true,
|
||||
includeIfNull: false,
|
||||
)
|
||||
|
||||
|
||||
final int eventsDuplicate;
|
||||
|
||||
|
||||
|
||||
@JsonKey(
|
||||
|
||||
name: r'events_new',
|
||||
required: true,
|
||||
includeIfNull: false,
|
||||
)
|
||||
|
||||
|
||||
final int eventsNew;
|
||||
|
||||
|
||||
|
||||
@JsonKey(
|
||||
|
||||
name: r'events_pending',
|
||||
required: true,
|
||||
includeIfNull: false,
|
||||
)
|
||||
|
||||
|
||||
final int eventsPending;
|
||||
|
||||
|
||||
|
||||
@JsonKey(
|
||||
|
||||
name: r'events_shadow',
|
||||
required: true,
|
||||
includeIfNull: false,
|
||||
)
|
||||
|
||||
|
||||
final int eventsShadow;
|
||||
|
||||
|
||||
|
||||
@JsonKey(
|
||||
|
||||
name: r'events_total',
|
||||
required: true,
|
||||
includeIfNull: false,
|
||||
)
|
||||
|
||||
|
||||
final int eventsTotal;
|
||||
|
||||
|
||||
|
||||
@JsonKey(
|
||||
|
||||
name: r'lines',
|
||||
required: true,
|
||||
includeIfNull: false,
|
||||
)
|
||||
|
||||
|
||||
final int lines;
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
@override
|
||||
bool operator ==(Object other) => identical(this, other) || other is ImportCounts &&
|
||||
other.byKind == byKind &&
|
||||
other.eventsDuplicate == eventsDuplicate &&
|
||||
other.eventsNew == eventsNew &&
|
||||
other.eventsPending == eventsPending &&
|
||||
other.eventsShadow == eventsShadow &&
|
||||
other.eventsTotal == eventsTotal &&
|
||||
other.lines == lines;
|
||||
|
||||
@override
|
||||
int get hashCode =>
|
||||
byKind.hashCode +
|
||||
eventsDuplicate.hashCode +
|
||||
eventsNew.hashCode +
|
||||
eventsPending.hashCode +
|
||||
eventsShadow.hashCode +
|
||||
eventsTotal.hashCode +
|
||||
lines.hashCode;
|
||||
|
||||
factory ImportCounts.fromJson(Map<String, dynamic> json) => _$ImportCountsFromJson(json);
|
||||
|
||||
Map<String, dynamic> toJson() => _$ImportCountsToJson(this);
|
||||
|
||||
@override
|
||||
String toString() {
|
||||
return toJson().toString();
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -0,0 +1,187 @@
|
||||
// GENERATED CODE - DO NOT MODIFY BY HAND
|
||||
|
||||
part of 'import_counts.dart';
|
||||
|
||||
// **************************************************************************
|
||||
// CopyWithGenerator
|
||||
// **************************************************************************
|
||||
|
||||
abstract class _$ImportCountsCWProxy {
|
||||
ImportCounts byKind(Map<String, int> byKind);
|
||||
|
||||
ImportCounts eventsDuplicate(int eventsDuplicate);
|
||||
|
||||
ImportCounts eventsNew(int eventsNew);
|
||||
|
||||
ImportCounts eventsPending(int eventsPending);
|
||||
|
||||
ImportCounts eventsShadow(int eventsShadow);
|
||||
|
||||
ImportCounts eventsTotal(int eventsTotal);
|
||||
|
||||
ImportCounts lines(int lines);
|
||||
|
||||
/// This function **does support** nullification of nullable fields. All `null` values passed to `non-nullable` fields will be ignored. You can also use `ImportCounts(...).copyWith.fieldName(...)` to override fields one at a time with nullification support.
|
||||
///
|
||||
/// Usage
|
||||
/// ```dart
|
||||
/// ImportCounts(...).copyWith(id: 12, name: "My name")
|
||||
/// ````
|
||||
ImportCounts call({
|
||||
Map<String, int> byKind,
|
||||
int eventsDuplicate,
|
||||
int eventsNew,
|
||||
int eventsPending,
|
||||
int eventsShadow,
|
||||
int eventsTotal,
|
||||
int lines,
|
||||
});
|
||||
}
|
||||
|
||||
/// Proxy class for `copyWith` functionality. This is a callable class and can be used as follows: `instanceOfImportCounts.copyWith(...)`. Additionally contains functions for specific fields e.g. `instanceOfImportCounts.copyWith.fieldName(...)`
|
||||
class _$ImportCountsCWProxyImpl implements _$ImportCountsCWProxy {
|
||||
const _$ImportCountsCWProxyImpl(this._value);
|
||||
|
||||
final ImportCounts _value;
|
||||
|
||||
@override
|
||||
ImportCounts byKind(Map<String, int> byKind) => this(byKind: byKind);
|
||||
|
||||
@override
|
||||
ImportCounts eventsDuplicate(int eventsDuplicate) =>
|
||||
this(eventsDuplicate: eventsDuplicate);
|
||||
|
||||
@override
|
||||
ImportCounts eventsNew(int eventsNew) => this(eventsNew: eventsNew);
|
||||
|
||||
@override
|
||||
ImportCounts eventsPending(int eventsPending) =>
|
||||
this(eventsPending: eventsPending);
|
||||
|
||||
@override
|
||||
ImportCounts eventsShadow(int eventsShadow) =>
|
||||
this(eventsShadow: eventsShadow);
|
||||
|
||||
@override
|
||||
ImportCounts eventsTotal(int eventsTotal) => this(eventsTotal: eventsTotal);
|
||||
|
||||
@override
|
||||
ImportCounts lines(int lines) => this(lines: lines);
|
||||
|
||||
@override
|
||||
/// This function **does support** nullification of nullable fields. All `null` values passed to `non-nullable` fields will be ignored. You can also use `ImportCounts(...).copyWith.fieldName(...)` to override fields one at a time with nullification support.
|
||||
///
|
||||
/// Usage
|
||||
/// ```dart
|
||||
/// ImportCounts(...).copyWith(id: 12, name: "My name")
|
||||
/// ````
|
||||
ImportCounts call({
|
||||
Object? byKind = const $CopyWithPlaceholder(),
|
||||
Object? eventsDuplicate = const $CopyWithPlaceholder(),
|
||||
Object? eventsNew = const $CopyWithPlaceholder(),
|
||||
Object? eventsPending = const $CopyWithPlaceholder(),
|
||||
Object? eventsShadow = const $CopyWithPlaceholder(),
|
||||
Object? eventsTotal = const $CopyWithPlaceholder(),
|
||||
Object? lines = const $CopyWithPlaceholder(),
|
||||
}) {
|
||||
return ImportCounts(
|
||||
byKind: byKind == const $CopyWithPlaceholder()
|
||||
? _value.byKind
|
||||
// ignore: cast_nullable_to_non_nullable
|
||||
: byKind as Map<String, int>,
|
||||
eventsDuplicate: eventsDuplicate == const $CopyWithPlaceholder()
|
||||
? _value.eventsDuplicate
|
||||
// ignore: cast_nullable_to_non_nullable
|
||||
: eventsDuplicate as int,
|
||||
eventsNew: eventsNew == const $CopyWithPlaceholder()
|
||||
? _value.eventsNew
|
||||
// ignore: cast_nullable_to_non_nullable
|
||||
: eventsNew as int,
|
||||
eventsPending: eventsPending == const $CopyWithPlaceholder()
|
||||
? _value.eventsPending
|
||||
// ignore: cast_nullable_to_non_nullable
|
||||
: eventsPending as int,
|
||||
eventsShadow: eventsShadow == const $CopyWithPlaceholder()
|
||||
? _value.eventsShadow
|
||||
// ignore: cast_nullable_to_non_nullable
|
||||
: eventsShadow as int,
|
||||
eventsTotal: eventsTotal == const $CopyWithPlaceholder()
|
||||
? _value.eventsTotal
|
||||
// ignore: cast_nullable_to_non_nullable
|
||||
: eventsTotal as int,
|
||||
lines: lines == const $CopyWithPlaceholder()
|
||||
? _value.lines
|
||||
// ignore: cast_nullable_to_non_nullable
|
||||
: lines as int,
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
extension $ImportCountsCopyWith on ImportCounts {
|
||||
/// Returns a callable class that can be used as follows: `instanceOfImportCounts.copyWith(...)` or like so:`instanceOfImportCounts.copyWith.fieldName(...)`.
|
||||
// ignore: library_private_types_in_public_api
|
||||
_$ImportCountsCWProxy get copyWith => _$ImportCountsCWProxyImpl(this);
|
||||
}
|
||||
|
||||
// **************************************************************************
|
||||
// JsonSerializableGenerator
|
||||
// **************************************************************************
|
||||
|
||||
ImportCounts _$ImportCountsFromJson(
|
||||
Map<String, dynamic> json,
|
||||
) => $checkedCreate(
|
||||
'ImportCounts',
|
||||
json,
|
||||
($checkedConvert) {
|
||||
$checkKeys(
|
||||
json,
|
||||
requiredKeys: const [
|
||||
'by_kind',
|
||||
'events_duplicate',
|
||||
'events_new',
|
||||
'events_pending',
|
||||
'events_shadow',
|
||||
'events_total',
|
||||
'lines',
|
||||
],
|
||||
);
|
||||
final val = ImportCounts(
|
||||
byKind: $checkedConvert(
|
||||
'by_kind',
|
||||
(v) => Map<String, int>.from(v as Map),
|
||||
),
|
||||
eventsDuplicate: $checkedConvert(
|
||||
'events_duplicate',
|
||||
(v) => (v as num).toInt(),
|
||||
),
|
||||
eventsNew: $checkedConvert('events_new', (v) => (v as num).toInt()),
|
||||
eventsPending: $checkedConvert(
|
||||
'events_pending',
|
||||
(v) => (v as num).toInt(),
|
||||
),
|
||||
eventsShadow: $checkedConvert('events_shadow', (v) => (v as num).toInt()),
|
||||
eventsTotal: $checkedConvert('events_total', (v) => (v as num).toInt()),
|
||||
lines: $checkedConvert('lines', (v) => (v as num).toInt()),
|
||||
);
|
||||
return val;
|
||||
},
|
||||
fieldKeyMap: const {
|
||||
'byKind': 'by_kind',
|
||||
'eventsDuplicate': 'events_duplicate',
|
||||
'eventsNew': 'events_new',
|
||||
'eventsPending': 'events_pending',
|
||||
'eventsShadow': 'events_shadow',
|
||||
'eventsTotal': 'events_total',
|
||||
},
|
||||
);
|
||||
|
||||
Map<String, dynamic> _$ImportCountsToJson(ImportCounts instance) =>
|
||||
<String, dynamic>{
|
||||
'by_kind': instance.byKind,
|
||||
'events_duplicate': instance.eventsDuplicate,
|
||||
'events_new': instance.eventsNew,
|
||||
'events_pending': instance.eventsPending,
|
||||
'events_shadow': instance.eventsShadow,
|
||||
'events_total': instance.eventsTotal,
|
||||
'lines': instance.lines,
|
||||
};
|
||||
@@ -0,0 +1,415 @@
|
||||
//
|
||||
// AUTO-GENERATED FILE, DO NOT MODIFY!
|
||||
//
|
||||
|
||||
// ignore_for_file: unused_element
|
||||
import 'package:fintracker_api/src/model/pending_instrument_out.dart';
|
||||
import 'package:fintracker_api/src/model/import_counts.dart';
|
||||
import 'package:fintracker_api/src/model/sample_event_out.dart';
|
||||
import 'package:fintracker_api/src/model/reconciliation_out.dart';
|
||||
import 'package:fintracker_api/src/model/account_suggestion.dart';
|
||||
import 'package:copy_with_extension/copy_with_extension.dart';
|
||||
import 'package:json_annotation/json_annotation.dart';
|
||||
|
||||
part 'import_preview.g.dart';
|
||||
|
||||
|
||||
@CopyWith()
|
||||
@JsonSerializable(
|
||||
checked: true,
|
||||
createToJson: true,
|
||||
disallowUnrecognizedKeys: false,
|
||||
explicitToJson: true,
|
||||
)
|
||||
class ImportPreview {
|
||||
/// Returns a new [ImportPreview] instance.
|
||||
ImportPreview({
|
||||
|
||||
this.accountExternalId,
|
||||
|
||||
this.accountId,
|
||||
|
||||
this.accountName,
|
||||
|
||||
this.accountSuggestions,
|
||||
|
||||
required this.broker,
|
||||
|
||||
this.committedAt,
|
||||
|
||||
required this.counts,
|
||||
|
||||
this.duplicateOfId,
|
||||
|
||||
this.error,
|
||||
|
||||
required this.filename,
|
||||
|
||||
required this.id,
|
||||
|
||||
required this.parseStatus,
|
||||
|
||||
this.parserName,
|
||||
|
||||
this.parserVersion,
|
||||
|
||||
this.pendingInstruments,
|
||||
|
||||
this.periodFrom,
|
||||
|
||||
this.periodTo,
|
||||
|
||||
required this.reconciliation,
|
||||
|
||||
this.sampleEvents,
|
||||
|
||||
required this.sha256,
|
||||
|
||||
required this.sizeBytes,
|
||||
|
||||
this.uploadedAt,
|
||||
|
||||
this.warnings,
|
||||
});
|
||||
|
||||
@JsonKey(
|
||||
|
||||
name: r'account_external_id',
|
||||
required: false,
|
||||
includeIfNull: false,
|
||||
)
|
||||
|
||||
|
||||
final String? accountExternalId;
|
||||
|
||||
|
||||
|
||||
@JsonKey(
|
||||
|
||||
name: r'account_id',
|
||||
required: false,
|
||||
includeIfNull: false,
|
||||
)
|
||||
|
||||
|
||||
final int? accountId;
|
||||
|
||||
|
||||
|
||||
@JsonKey(
|
||||
|
||||
name: r'account_name',
|
||||
required: false,
|
||||
includeIfNull: false,
|
||||
)
|
||||
|
||||
|
||||
final String? accountName;
|
||||
|
||||
|
||||
|
||||
@JsonKey(
|
||||
|
||||
name: r'account_suggestions',
|
||||
required: false,
|
||||
includeIfNull: false,
|
||||
)
|
||||
|
||||
|
||||
final List<AccountSuggestion>? accountSuggestions;
|
||||
|
||||
|
||||
|
||||
@JsonKey(
|
||||
|
||||
name: r'broker',
|
||||
required: true,
|
||||
includeIfNull: false,
|
||||
)
|
||||
|
||||
|
||||
final String broker;
|
||||
|
||||
|
||||
|
||||
@JsonKey(
|
||||
|
||||
name: r'committed_at',
|
||||
required: false,
|
||||
includeIfNull: false,
|
||||
)
|
||||
|
||||
|
||||
final DateTime? committedAt;
|
||||
|
||||
|
||||
|
||||
@JsonKey(
|
||||
|
||||
name: r'counts',
|
||||
required: true,
|
||||
includeIfNull: false,
|
||||
)
|
||||
|
||||
|
||||
final ImportCounts counts;
|
||||
|
||||
|
||||
|
||||
@JsonKey(
|
||||
|
||||
name: r'duplicate_of_id',
|
||||
required: false,
|
||||
includeIfNull: false,
|
||||
)
|
||||
|
||||
|
||||
final int? duplicateOfId;
|
||||
|
||||
|
||||
|
||||
@JsonKey(
|
||||
|
||||
name: r'error',
|
||||
required: false,
|
||||
includeIfNull: false,
|
||||
)
|
||||
|
||||
|
||||
final String? error;
|
||||
|
||||
|
||||
|
||||
@JsonKey(
|
||||
|
||||
name: r'filename',
|
||||
required: true,
|
||||
includeIfNull: false,
|
||||
)
|
||||
|
||||
|
||||
final String filename;
|
||||
|
||||
|
||||
|
||||
@JsonKey(
|
||||
|
||||
name: r'id',
|
||||
required: true,
|
||||
includeIfNull: false,
|
||||
)
|
||||
|
||||
|
||||
final int id;
|
||||
|
||||
|
||||
|
||||
@JsonKey(
|
||||
|
||||
name: r'parse_status',
|
||||
required: true,
|
||||
includeIfNull: false,
|
||||
)
|
||||
|
||||
|
||||
final String parseStatus;
|
||||
|
||||
|
||||
|
||||
@JsonKey(
|
||||
|
||||
name: r'parser_name',
|
||||
required: false,
|
||||
includeIfNull: false,
|
||||
)
|
||||
|
||||
|
||||
final String? parserName;
|
||||
|
||||
|
||||
|
||||
@JsonKey(
|
||||
|
||||
name: r'parser_version',
|
||||
required: false,
|
||||
includeIfNull: false,
|
||||
)
|
||||
|
||||
|
||||
final String? parserVersion;
|
||||
|
||||
|
||||
|
||||
@JsonKey(
|
||||
|
||||
name: r'pending_instruments',
|
||||
required: false,
|
||||
includeIfNull: false,
|
||||
)
|
||||
|
||||
|
||||
final List<PendingInstrumentOut>? pendingInstruments;
|
||||
|
||||
|
||||
|
||||
@JsonKey(
|
||||
|
||||
name: r'period_from',
|
||||
required: false,
|
||||
includeIfNull: false,
|
||||
)
|
||||
|
||||
|
||||
final DateTime? periodFrom;
|
||||
|
||||
|
||||
|
||||
@JsonKey(
|
||||
|
||||
name: r'period_to',
|
||||
required: false,
|
||||
includeIfNull: false,
|
||||
)
|
||||
|
||||
|
||||
final DateTime? periodTo;
|
||||
|
||||
|
||||
|
||||
@JsonKey(
|
||||
|
||||
name: r'reconciliation',
|
||||
required: true,
|
||||
includeIfNull: false,
|
||||
)
|
||||
|
||||
|
||||
final ReconciliationOut reconciliation;
|
||||
|
||||
|
||||
|
||||
@JsonKey(
|
||||
|
||||
name: r'sample_events',
|
||||
required: false,
|
||||
includeIfNull: false,
|
||||
)
|
||||
|
||||
|
||||
final List<SampleEventOut>? sampleEvents;
|
||||
|
||||
|
||||
|
||||
@JsonKey(
|
||||
|
||||
name: r'sha256',
|
||||
required: true,
|
||||
includeIfNull: false,
|
||||
)
|
||||
|
||||
|
||||
final String sha256;
|
||||
|
||||
|
||||
|
||||
@JsonKey(
|
||||
|
||||
name: r'size_bytes',
|
||||
required: true,
|
||||
includeIfNull: false,
|
||||
)
|
||||
|
||||
|
||||
final int sizeBytes;
|
||||
|
||||
|
||||
|
||||
@JsonKey(
|
||||
|
||||
name: r'uploaded_at',
|
||||
required: false,
|
||||
includeIfNull: false,
|
||||
)
|
||||
|
||||
|
||||
final DateTime? uploadedAt;
|
||||
|
||||
|
||||
|
||||
@JsonKey(
|
||||
|
||||
name: r'warnings',
|
||||
required: false,
|
||||
includeIfNull: false,
|
||||
)
|
||||
|
||||
|
||||
final List<String>? warnings;
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
@override
|
||||
bool operator ==(Object other) => identical(this, other) || other is ImportPreview &&
|
||||
other.accountExternalId == accountExternalId &&
|
||||
other.accountId == accountId &&
|
||||
other.accountName == accountName &&
|
||||
other.accountSuggestions == accountSuggestions &&
|
||||
other.broker == broker &&
|
||||
other.committedAt == committedAt &&
|
||||
other.counts == counts &&
|
||||
other.duplicateOfId == duplicateOfId &&
|
||||
other.error == error &&
|
||||
other.filename == filename &&
|
||||
other.id == id &&
|
||||
other.parseStatus == parseStatus &&
|
||||
other.parserName == parserName &&
|
||||
other.parserVersion == parserVersion &&
|
||||
other.pendingInstruments == pendingInstruments &&
|
||||
other.periodFrom == periodFrom &&
|
||||
other.periodTo == periodTo &&
|
||||
other.reconciliation == reconciliation &&
|
||||
other.sampleEvents == sampleEvents &&
|
||||
other.sha256 == sha256 &&
|
||||
other.sizeBytes == sizeBytes &&
|
||||
other.uploadedAt == uploadedAt &&
|
||||
other.warnings == warnings;
|
||||
|
||||
@override
|
||||
int get hashCode =>
|
||||
(accountExternalId == null ? 0 : accountExternalId.hashCode) +
|
||||
(accountId == null ? 0 : accountId.hashCode) +
|
||||
(accountName == null ? 0 : accountName.hashCode) +
|
||||
accountSuggestions.hashCode +
|
||||
broker.hashCode +
|
||||
(committedAt == null ? 0 : committedAt.hashCode) +
|
||||
counts.hashCode +
|
||||
(duplicateOfId == null ? 0 : duplicateOfId.hashCode) +
|
||||
(error == null ? 0 : error.hashCode) +
|
||||
filename.hashCode +
|
||||
id.hashCode +
|
||||
parseStatus.hashCode +
|
||||
(parserName == null ? 0 : parserName.hashCode) +
|
||||
(parserVersion == null ? 0 : parserVersion.hashCode) +
|
||||
pendingInstruments.hashCode +
|
||||
(periodFrom == null ? 0 : periodFrom.hashCode) +
|
||||
(periodTo == null ? 0 : periodTo.hashCode) +
|
||||
reconciliation.hashCode +
|
||||
sampleEvents.hashCode +
|
||||
sha256.hashCode +
|
||||
sizeBytes.hashCode +
|
||||
(uploadedAt == null ? 0 : uploadedAt.hashCode) +
|
||||
warnings.hashCode;
|
||||
|
||||
factory ImportPreview.fromJson(Map<String, dynamic> json) => _$ImportPreviewFromJson(json);
|
||||
|
||||
Map<String, dynamic> toJson() => _$ImportPreviewToJson(this);
|
||||
|
||||
@override
|
||||
String toString() {
|
||||
return toJson().toString();
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -0,0 +1,459 @@
|
||||
// GENERATED CODE - DO NOT MODIFY BY HAND
|
||||
|
||||
part of 'import_preview.dart';
|
||||
|
||||
// **************************************************************************
|
||||
// CopyWithGenerator
|
||||
// **************************************************************************
|
||||
|
||||
abstract class _$ImportPreviewCWProxy {
|
||||
ImportPreview accountExternalId(String? accountExternalId);
|
||||
|
||||
ImportPreview accountId(int? accountId);
|
||||
|
||||
ImportPreview accountName(String? accountName);
|
||||
|
||||
ImportPreview accountSuggestions(List<AccountSuggestion>? accountSuggestions);
|
||||
|
||||
ImportPreview broker(String broker);
|
||||
|
||||
ImportPreview committedAt(DateTime? committedAt);
|
||||
|
||||
ImportPreview counts(ImportCounts counts);
|
||||
|
||||
ImportPreview duplicateOfId(int? duplicateOfId);
|
||||
|
||||
ImportPreview error(String? error);
|
||||
|
||||
ImportPreview filename(String filename);
|
||||
|
||||
ImportPreview id(int id);
|
||||
|
||||
ImportPreview parseStatus(String parseStatus);
|
||||
|
||||
ImportPreview parserName(String? parserName);
|
||||
|
||||
ImportPreview parserVersion(String? parserVersion);
|
||||
|
||||
ImportPreview pendingInstruments(
|
||||
List<PendingInstrumentOut>? pendingInstruments,
|
||||
);
|
||||
|
||||
ImportPreview periodFrom(DateTime? periodFrom);
|
||||
|
||||
ImportPreview periodTo(DateTime? periodTo);
|
||||
|
||||
ImportPreview reconciliation(ReconciliationOut reconciliation);
|
||||
|
||||
ImportPreview sampleEvents(List<SampleEventOut>? sampleEvents);
|
||||
|
||||
ImportPreview sha256(String sha256);
|
||||
|
||||
ImportPreview sizeBytes(int sizeBytes);
|
||||
|
||||
ImportPreview uploadedAt(DateTime? uploadedAt);
|
||||
|
||||
ImportPreview warnings(List<String>? warnings);
|
||||
|
||||
/// This function **does support** nullification of nullable fields. All `null` values passed to `non-nullable` fields will be ignored. You can also use `ImportPreview(...).copyWith.fieldName(...)` to override fields one at a time with nullification support.
|
||||
///
|
||||
/// Usage
|
||||
/// ```dart
|
||||
/// ImportPreview(...).copyWith(id: 12, name: "My name")
|
||||
/// ````
|
||||
ImportPreview call({
|
||||
String? accountExternalId,
|
||||
int? accountId,
|
||||
String? accountName,
|
||||
List<AccountSuggestion>? accountSuggestions,
|
||||
String broker,
|
||||
DateTime? committedAt,
|
||||
ImportCounts counts,
|
||||
int? duplicateOfId,
|
||||
String? error,
|
||||
String filename,
|
||||
int id,
|
||||
String parseStatus,
|
||||
String? parserName,
|
||||
String? parserVersion,
|
||||
List<PendingInstrumentOut>? pendingInstruments,
|
||||
DateTime? periodFrom,
|
||||
DateTime? periodTo,
|
||||
ReconciliationOut reconciliation,
|
||||
List<SampleEventOut>? sampleEvents,
|
||||
String sha256,
|
||||
int sizeBytes,
|
||||
DateTime? uploadedAt,
|
||||
List<String>? warnings,
|
||||
});
|
||||
}
|
||||
|
||||
/// Proxy class for `copyWith` functionality. This is a callable class and can be used as follows: `instanceOfImportPreview.copyWith(...)`. Additionally contains functions for specific fields e.g. `instanceOfImportPreview.copyWith.fieldName(...)`
|
||||
class _$ImportPreviewCWProxyImpl implements _$ImportPreviewCWProxy {
|
||||
const _$ImportPreviewCWProxyImpl(this._value);
|
||||
|
||||
final ImportPreview _value;
|
||||
|
||||
@override
|
||||
ImportPreview accountExternalId(String? accountExternalId) =>
|
||||
this(accountExternalId: accountExternalId);
|
||||
|
||||
@override
|
||||
ImportPreview accountId(int? accountId) => this(accountId: accountId);
|
||||
|
||||
@override
|
||||
ImportPreview accountName(String? accountName) =>
|
||||
this(accountName: accountName);
|
||||
|
||||
@override
|
||||
ImportPreview accountSuggestions(
|
||||
List<AccountSuggestion>? accountSuggestions,
|
||||
) => this(accountSuggestions: accountSuggestions);
|
||||
|
||||
@override
|
||||
ImportPreview broker(String broker) => this(broker: broker);
|
||||
|
||||
@override
|
||||
ImportPreview committedAt(DateTime? committedAt) =>
|
||||
this(committedAt: committedAt);
|
||||
|
||||
@override
|
||||
ImportPreview counts(ImportCounts counts) => this(counts: counts);
|
||||
|
||||
@override
|
||||
ImportPreview duplicateOfId(int? duplicateOfId) =>
|
||||
this(duplicateOfId: duplicateOfId);
|
||||
|
||||
@override
|
||||
ImportPreview error(String? error) => this(error: error);
|
||||
|
||||
@override
|
||||
ImportPreview filename(String filename) => this(filename: filename);
|
||||
|
||||
@override
|
||||
ImportPreview id(int id) => this(id: id);
|
||||
|
||||
@override
|
||||
ImportPreview parseStatus(String parseStatus) =>
|
||||
this(parseStatus: parseStatus);
|
||||
|
||||
@override
|
||||
ImportPreview parserName(String? parserName) => this(parserName: parserName);
|
||||
|
||||
@override
|
||||
ImportPreview parserVersion(String? parserVersion) =>
|
||||
this(parserVersion: parserVersion);
|
||||
|
||||
@override
|
||||
ImportPreview pendingInstruments(
|
||||
List<PendingInstrumentOut>? pendingInstruments,
|
||||
) => this(pendingInstruments: pendingInstruments);
|
||||
|
||||
@override
|
||||
ImportPreview periodFrom(DateTime? periodFrom) =>
|
||||
this(periodFrom: periodFrom);
|
||||
|
||||
@override
|
||||
ImportPreview periodTo(DateTime? periodTo) => this(periodTo: periodTo);
|
||||
|
||||
@override
|
||||
ImportPreview reconciliation(ReconciliationOut reconciliation) =>
|
||||
this(reconciliation: reconciliation);
|
||||
|
||||
@override
|
||||
ImportPreview sampleEvents(List<SampleEventOut>? sampleEvents) =>
|
||||
this(sampleEvents: sampleEvents);
|
||||
|
||||
@override
|
||||
ImportPreview sha256(String sha256) => this(sha256: sha256);
|
||||
|
||||
@override
|
||||
ImportPreview sizeBytes(int sizeBytes) => this(sizeBytes: sizeBytes);
|
||||
|
||||
@override
|
||||
ImportPreview uploadedAt(DateTime? uploadedAt) =>
|
||||
this(uploadedAt: uploadedAt);
|
||||
|
||||
@override
|
||||
ImportPreview warnings(List<String>? 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 `ImportPreview(...).copyWith.fieldName(...)` to override fields one at a time with nullification support.
|
||||
///
|
||||
/// Usage
|
||||
/// ```dart
|
||||
/// ImportPreview(...).copyWith(id: 12, name: "My name")
|
||||
/// ````
|
||||
ImportPreview call({
|
||||
Object? accountExternalId = const $CopyWithPlaceholder(),
|
||||
Object? accountId = const $CopyWithPlaceholder(),
|
||||
Object? accountName = const $CopyWithPlaceholder(),
|
||||
Object? accountSuggestions = const $CopyWithPlaceholder(),
|
||||
Object? broker = const $CopyWithPlaceholder(),
|
||||
Object? committedAt = const $CopyWithPlaceholder(),
|
||||
Object? counts = const $CopyWithPlaceholder(),
|
||||
Object? duplicateOfId = const $CopyWithPlaceholder(),
|
||||
Object? error = const $CopyWithPlaceholder(),
|
||||
Object? filename = const $CopyWithPlaceholder(),
|
||||
Object? id = const $CopyWithPlaceholder(),
|
||||
Object? parseStatus = const $CopyWithPlaceholder(),
|
||||
Object? parserName = const $CopyWithPlaceholder(),
|
||||
Object? parserVersion = const $CopyWithPlaceholder(),
|
||||
Object? pendingInstruments = const $CopyWithPlaceholder(),
|
||||
Object? periodFrom = const $CopyWithPlaceholder(),
|
||||
Object? periodTo = const $CopyWithPlaceholder(),
|
||||
Object? reconciliation = const $CopyWithPlaceholder(),
|
||||
Object? sampleEvents = const $CopyWithPlaceholder(),
|
||||
Object? sha256 = const $CopyWithPlaceholder(),
|
||||
Object? sizeBytes = const $CopyWithPlaceholder(),
|
||||
Object? uploadedAt = const $CopyWithPlaceholder(),
|
||||
Object? warnings = const $CopyWithPlaceholder(),
|
||||
}) {
|
||||
return ImportPreview(
|
||||
accountExternalId: accountExternalId == const $CopyWithPlaceholder()
|
||||
? _value.accountExternalId
|
||||
// ignore: cast_nullable_to_non_nullable
|
||||
: accountExternalId as String?,
|
||||
accountId: accountId == const $CopyWithPlaceholder()
|
||||
? _value.accountId
|
||||
// ignore: cast_nullable_to_non_nullable
|
||||
: accountId as int?,
|
||||
accountName: accountName == const $CopyWithPlaceholder()
|
||||
? _value.accountName
|
||||
// ignore: cast_nullable_to_non_nullable
|
||||
: accountName as String?,
|
||||
accountSuggestions: accountSuggestions == const $CopyWithPlaceholder()
|
||||
? _value.accountSuggestions
|
||||
// ignore: cast_nullable_to_non_nullable
|
||||
: accountSuggestions as List<AccountSuggestion>?,
|
||||
broker: broker == const $CopyWithPlaceholder()
|
||||
? _value.broker
|
||||
// ignore: cast_nullable_to_non_nullable
|
||||
: broker as String,
|
||||
committedAt: committedAt == const $CopyWithPlaceholder()
|
||||
? _value.committedAt
|
||||
// ignore: cast_nullable_to_non_nullable
|
||||
: committedAt as DateTime?,
|
||||
counts: counts == const $CopyWithPlaceholder()
|
||||
? _value.counts
|
||||
// ignore: cast_nullable_to_non_nullable
|
||||
: counts as ImportCounts,
|
||||
duplicateOfId: duplicateOfId == const $CopyWithPlaceholder()
|
||||
? _value.duplicateOfId
|
||||
// ignore: cast_nullable_to_non_nullable
|
||||
: duplicateOfId as int?,
|
||||
error: error == const $CopyWithPlaceholder()
|
||||
? _value.error
|
||||
// ignore: cast_nullable_to_non_nullable
|
||||
: error as String?,
|
||||
filename: filename == const $CopyWithPlaceholder()
|
||||
? _value.filename
|
||||
// ignore: cast_nullable_to_non_nullable
|
||||
: filename as String,
|
||||
id: id == const $CopyWithPlaceholder()
|
||||
? _value.id
|
||||
// ignore: cast_nullable_to_non_nullable
|
||||
: id as int,
|
||||
parseStatus: parseStatus == const $CopyWithPlaceholder()
|
||||
? _value.parseStatus
|
||||
// ignore: cast_nullable_to_non_nullable
|
||||
: parseStatus as String,
|
||||
parserName: parserName == const $CopyWithPlaceholder()
|
||||
? _value.parserName
|
||||
// ignore: cast_nullable_to_non_nullable
|
||||
: parserName as String?,
|
||||
parserVersion: parserVersion == const $CopyWithPlaceholder()
|
||||
? _value.parserVersion
|
||||
// ignore: cast_nullable_to_non_nullable
|
||||
: parserVersion as String?,
|
||||
pendingInstruments: pendingInstruments == const $CopyWithPlaceholder()
|
||||
? _value.pendingInstruments
|
||||
// ignore: cast_nullable_to_non_nullable
|
||||
: pendingInstruments as List<PendingInstrumentOut>?,
|
||||
periodFrom: periodFrom == const $CopyWithPlaceholder()
|
||||
? _value.periodFrom
|
||||
// ignore: cast_nullable_to_non_nullable
|
||||
: periodFrom as DateTime?,
|
||||
periodTo: periodTo == const $CopyWithPlaceholder()
|
||||
? _value.periodTo
|
||||
// ignore: cast_nullable_to_non_nullable
|
||||
: periodTo as DateTime?,
|
||||
reconciliation: reconciliation == const $CopyWithPlaceholder()
|
||||
? _value.reconciliation
|
||||
// ignore: cast_nullable_to_non_nullable
|
||||
: reconciliation as ReconciliationOut,
|
||||
sampleEvents: sampleEvents == const $CopyWithPlaceholder()
|
||||
? _value.sampleEvents
|
||||
// ignore: cast_nullable_to_non_nullable
|
||||
: sampleEvents as List<SampleEventOut>?,
|
||||
sha256: sha256 == const $CopyWithPlaceholder()
|
||||
? _value.sha256
|
||||
// ignore: cast_nullable_to_non_nullable
|
||||
: sha256 as String,
|
||||
sizeBytes: sizeBytes == const $CopyWithPlaceholder()
|
||||
? _value.sizeBytes
|
||||
// ignore: cast_nullable_to_non_nullable
|
||||
: sizeBytes as int,
|
||||
uploadedAt: uploadedAt == const $CopyWithPlaceholder()
|
||||
? _value.uploadedAt
|
||||
// ignore: cast_nullable_to_non_nullable
|
||||
: uploadedAt as DateTime?,
|
||||
warnings: warnings == const $CopyWithPlaceholder()
|
||||
? _value.warnings
|
||||
// ignore: cast_nullable_to_non_nullable
|
||||
: warnings as List<String>?,
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
extension $ImportPreviewCopyWith on ImportPreview {
|
||||
/// Returns a callable class that can be used as follows: `instanceOfImportPreview.copyWith(...)` or like so:`instanceOfImportPreview.copyWith.fieldName(...)`.
|
||||
// ignore: library_private_types_in_public_api
|
||||
_$ImportPreviewCWProxy get copyWith => _$ImportPreviewCWProxyImpl(this);
|
||||
}
|
||||
|
||||
// **************************************************************************
|
||||
// JsonSerializableGenerator
|
||||
// **************************************************************************
|
||||
|
||||
ImportPreview _$ImportPreviewFromJson(Map<String, dynamic> json) =>
|
||||
$checkedCreate(
|
||||
'ImportPreview',
|
||||
json,
|
||||
($checkedConvert) {
|
||||
$checkKeys(
|
||||
json,
|
||||
requiredKeys: const [
|
||||
'broker',
|
||||
'counts',
|
||||
'filename',
|
||||
'id',
|
||||
'parse_status',
|
||||
'reconciliation',
|
||||
'sha256',
|
||||
'size_bytes',
|
||||
],
|
||||
);
|
||||
final val = ImportPreview(
|
||||
accountExternalId: $checkedConvert(
|
||||
'account_external_id',
|
||||
(v) => v as String?,
|
||||
),
|
||||
accountId: $checkedConvert('account_id', (v) => (v as num?)?.toInt()),
|
||||
accountName: $checkedConvert('account_name', (v) => v as String?),
|
||||
accountSuggestions: $checkedConvert(
|
||||
'account_suggestions',
|
||||
(v) => (v as List<dynamic>?)
|
||||
?.map(
|
||||
(e) => AccountSuggestion.fromJson(e as Map<String, dynamic>),
|
||||
)
|
||||
.toList(),
|
||||
),
|
||||
broker: $checkedConvert('broker', (v) => v as String),
|
||||
committedAt: $checkedConvert(
|
||||
'committed_at',
|
||||
(v) => v == null ? null : DateTime.parse(v as String),
|
||||
),
|
||||
counts: $checkedConvert(
|
||||
'counts',
|
||||
(v) => ImportCounts.fromJson(v as Map<String, dynamic>),
|
||||
),
|
||||
duplicateOfId: $checkedConvert(
|
||||
'duplicate_of_id',
|
||||
(v) => (v as num?)?.toInt(),
|
||||
),
|
||||
error: $checkedConvert('error', (v) => v as String?),
|
||||
filename: $checkedConvert('filename', (v) => v as String),
|
||||
id: $checkedConvert('id', (v) => (v as num).toInt()),
|
||||
parseStatus: $checkedConvert('parse_status', (v) => v as String),
|
||||
parserName: $checkedConvert('parser_name', (v) => v as String?),
|
||||
parserVersion: $checkedConvert('parser_version', (v) => v as String?),
|
||||
pendingInstruments: $checkedConvert(
|
||||
'pending_instruments',
|
||||
(v) => (v as List<dynamic>?)
|
||||
?.map(
|
||||
(e) =>
|
||||
PendingInstrumentOut.fromJson(e as Map<String, dynamic>),
|
||||
)
|
||||
.toList(),
|
||||
),
|
||||
periodFrom: $checkedConvert(
|
||||
'period_from',
|
||||
(v) => v == null ? null : DateTime.parse(v as String),
|
||||
),
|
||||
periodTo: $checkedConvert(
|
||||
'period_to',
|
||||
(v) => v == null ? null : DateTime.parse(v as String),
|
||||
),
|
||||
reconciliation: $checkedConvert(
|
||||
'reconciliation',
|
||||
(v) => ReconciliationOut.fromJson(v as Map<String, dynamic>),
|
||||
),
|
||||
sampleEvents: $checkedConvert(
|
||||
'sample_events',
|
||||
(v) => (v as List<dynamic>?)
|
||||
?.map((e) => SampleEventOut.fromJson(e as Map<String, dynamic>))
|
||||
.toList(),
|
||||
),
|
||||
sha256: $checkedConvert('sha256', (v) => v as String),
|
||||
sizeBytes: $checkedConvert('size_bytes', (v) => (v as num).toInt()),
|
||||
uploadedAt: $checkedConvert(
|
||||
'uploaded_at',
|
||||
(v) => v == null ? null : DateTime.parse(v as String),
|
||||
),
|
||||
warnings: $checkedConvert(
|
||||
'warnings',
|
||||
(v) => (v as List<dynamic>?)?.map((e) => e as String).toList(),
|
||||
),
|
||||
);
|
||||
return val;
|
||||
},
|
||||
fieldKeyMap: const {
|
||||
'accountExternalId': 'account_external_id',
|
||||
'accountId': 'account_id',
|
||||
'accountName': 'account_name',
|
||||
'accountSuggestions': 'account_suggestions',
|
||||
'committedAt': 'committed_at',
|
||||
'duplicateOfId': 'duplicate_of_id',
|
||||
'parseStatus': 'parse_status',
|
||||
'parserName': 'parser_name',
|
||||
'parserVersion': 'parser_version',
|
||||
'pendingInstruments': 'pending_instruments',
|
||||
'periodFrom': 'period_from',
|
||||
'periodTo': 'period_to',
|
||||
'sampleEvents': 'sample_events',
|
||||
'sizeBytes': 'size_bytes',
|
||||
'uploadedAt': 'uploaded_at',
|
||||
},
|
||||
);
|
||||
|
||||
Map<String, dynamic> _$ImportPreviewToJson(ImportPreview instance) =>
|
||||
<String, dynamic>{
|
||||
'account_external_id': ?instance.accountExternalId,
|
||||
'account_id': ?instance.accountId,
|
||||
'account_name': ?instance.accountName,
|
||||
'account_suggestions': ?instance.accountSuggestions
|
||||
?.map((e) => e.toJson())
|
||||
.toList(),
|
||||
'broker': instance.broker,
|
||||
'committed_at': ?instance.committedAt?.toIso8601String(),
|
||||
'counts': instance.counts.toJson(),
|
||||
'duplicate_of_id': ?instance.duplicateOfId,
|
||||
'error': ?instance.error,
|
||||
'filename': instance.filename,
|
||||
'id': instance.id,
|
||||
'parse_status': instance.parseStatus,
|
||||
'parser_name': ?instance.parserName,
|
||||
'parser_version': ?instance.parserVersion,
|
||||
'pending_instruments': ?instance.pendingInstruments
|
||||
?.map((e) => e.toJson())
|
||||
.toList(),
|
||||
'period_from': ?instance.periodFrom?.toIso8601String(),
|
||||
'period_to': ?instance.periodTo?.toIso8601String(),
|
||||
'reconciliation': instance.reconciliation.toJson(),
|
||||
'sample_events': ?instance.sampleEvents?.map((e) => e.toJson()).toList(),
|
||||
'sha256': instance.sha256,
|
||||
'size_bytes': instance.sizeBytes,
|
||||
'uploaded_at': ?instance.uploadedAt?.toIso8601String(),
|
||||
'warnings': ?instance.warnings,
|
||||
};
|
||||
@@ -0,0 +1,187 @@
|
||||
//
|
||||
// AUTO-GENERATED FILE, DO NOT MODIFY!
|
||||
//
|
||||
|
||||
// ignore_for_file: unused_element
|
||||
import 'package:fintracker_api/src/model/reconciliation_out.dart';
|
||||
import 'package:copy_with_extension/copy_with_extension.dart';
|
||||
import 'package:json_annotation/json_annotation.dart';
|
||||
|
||||
part 'import_result.g.dart';
|
||||
|
||||
|
||||
@CopyWith()
|
||||
@JsonSerializable(
|
||||
checked: true,
|
||||
createToJson: true,
|
||||
disallowUnrecognizedKeys: false,
|
||||
explicitToJson: true,
|
||||
)
|
||||
class ImportResult {
|
||||
/// Returns a new [ImportResult] instance.
|
||||
ImportResult({
|
||||
|
||||
required this.committed,
|
||||
|
||||
required this.eventsCreated,
|
||||
|
||||
required this.eventsShadow,
|
||||
|
||||
required this.eventsSkipped,
|
||||
|
||||
required this.eventsUpdated,
|
||||
|
||||
required this.importId,
|
||||
|
||||
required this.metricsRefreshed,
|
||||
|
||||
required this.pendingInstruments,
|
||||
|
||||
required this.reconciliation,
|
||||
});
|
||||
|
||||
@JsonKey(
|
||||
|
||||
name: r'committed',
|
||||
required: true,
|
||||
includeIfNull: false,
|
||||
)
|
||||
|
||||
|
||||
final bool committed;
|
||||
|
||||
|
||||
|
||||
@JsonKey(
|
||||
|
||||
name: r'events_created',
|
||||
required: true,
|
||||
includeIfNull: false,
|
||||
)
|
||||
|
||||
|
||||
final int eventsCreated;
|
||||
|
||||
|
||||
|
||||
@JsonKey(
|
||||
|
||||
name: r'events_shadow',
|
||||
required: true,
|
||||
includeIfNull: false,
|
||||
)
|
||||
|
||||
|
||||
final int eventsShadow;
|
||||
|
||||
|
||||
|
||||
@JsonKey(
|
||||
|
||||
name: r'events_skipped',
|
||||
required: true,
|
||||
includeIfNull: false,
|
||||
)
|
||||
|
||||
|
||||
final int eventsSkipped;
|
||||
|
||||
|
||||
|
||||
@JsonKey(
|
||||
|
||||
name: r'events_updated',
|
||||
required: true,
|
||||
includeIfNull: false,
|
||||
)
|
||||
|
||||
|
||||
final int eventsUpdated;
|
||||
|
||||
|
||||
|
||||
@JsonKey(
|
||||
|
||||
name: r'import_id',
|
||||
required: true,
|
||||
includeIfNull: false,
|
||||
)
|
||||
|
||||
|
||||
final int importId;
|
||||
|
||||
|
||||
|
||||
@JsonKey(
|
||||
|
||||
name: r'metrics_refreshed',
|
||||
required: true,
|
||||
includeIfNull: false,
|
||||
)
|
||||
|
||||
|
||||
final bool metricsRefreshed;
|
||||
|
||||
|
||||
|
||||
@JsonKey(
|
||||
|
||||
name: r'pending_instruments',
|
||||
required: true,
|
||||
includeIfNull: false,
|
||||
)
|
||||
|
||||
|
||||
final int pendingInstruments;
|
||||
|
||||
|
||||
|
||||
@JsonKey(
|
||||
|
||||
name: r'reconciliation',
|
||||
required: true,
|
||||
includeIfNull: false,
|
||||
)
|
||||
|
||||
|
||||
final ReconciliationOut reconciliation;
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
@override
|
||||
bool operator ==(Object other) => identical(this, other) || other is ImportResult &&
|
||||
other.committed == committed &&
|
||||
other.eventsCreated == eventsCreated &&
|
||||
other.eventsShadow == eventsShadow &&
|
||||
other.eventsSkipped == eventsSkipped &&
|
||||
other.eventsUpdated == eventsUpdated &&
|
||||
other.importId == importId &&
|
||||
other.metricsRefreshed == metricsRefreshed &&
|
||||
other.pendingInstruments == pendingInstruments &&
|
||||
other.reconciliation == reconciliation;
|
||||
|
||||
@override
|
||||
int get hashCode =>
|
||||
committed.hashCode +
|
||||
eventsCreated.hashCode +
|
||||
eventsShadow.hashCode +
|
||||
eventsSkipped.hashCode +
|
||||
eventsUpdated.hashCode +
|
||||
importId.hashCode +
|
||||
metricsRefreshed.hashCode +
|
||||
pendingInstruments.hashCode +
|
||||
reconciliation.hashCode;
|
||||
|
||||
factory ImportResult.fromJson(Map<String, dynamic> json) => _$ImportResultFromJson(json);
|
||||
|
||||
Map<String, dynamic> toJson() => _$ImportResultToJson(this);
|
||||
|
||||
@override
|
||||
String toString() {
|
||||
return toJson().toString();
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -0,0 +1,226 @@
|
||||
// GENERATED CODE - DO NOT MODIFY BY HAND
|
||||
|
||||
part of 'import_result.dart';
|
||||
|
||||
// **************************************************************************
|
||||
// CopyWithGenerator
|
||||
// **************************************************************************
|
||||
|
||||
abstract class _$ImportResultCWProxy {
|
||||
ImportResult committed(bool committed);
|
||||
|
||||
ImportResult eventsCreated(int eventsCreated);
|
||||
|
||||
ImportResult eventsShadow(int eventsShadow);
|
||||
|
||||
ImportResult eventsSkipped(int eventsSkipped);
|
||||
|
||||
ImportResult eventsUpdated(int eventsUpdated);
|
||||
|
||||
ImportResult importId(int importId);
|
||||
|
||||
ImportResult metricsRefreshed(bool metricsRefreshed);
|
||||
|
||||
ImportResult pendingInstruments(int pendingInstruments);
|
||||
|
||||
ImportResult reconciliation(ReconciliationOut reconciliation);
|
||||
|
||||
/// This function **does support** nullification of nullable fields. All `null` values passed to `non-nullable` fields will be ignored. You can also use `ImportResult(...).copyWith.fieldName(...)` to override fields one at a time with nullification support.
|
||||
///
|
||||
/// Usage
|
||||
/// ```dart
|
||||
/// ImportResult(...).copyWith(id: 12, name: "My name")
|
||||
/// ````
|
||||
ImportResult call({
|
||||
bool committed,
|
||||
int eventsCreated,
|
||||
int eventsShadow,
|
||||
int eventsSkipped,
|
||||
int eventsUpdated,
|
||||
int importId,
|
||||
bool metricsRefreshed,
|
||||
int pendingInstruments,
|
||||
ReconciliationOut reconciliation,
|
||||
});
|
||||
}
|
||||
|
||||
/// Proxy class for `copyWith` functionality. This is a callable class and can be used as follows: `instanceOfImportResult.copyWith(...)`. Additionally contains functions for specific fields e.g. `instanceOfImportResult.copyWith.fieldName(...)`
|
||||
class _$ImportResultCWProxyImpl implements _$ImportResultCWProxy {
|
||||
const _$ImportResultCWProxyImpl(this._value);
|
||||
|
||||
final ImportResult _value;
|
||||
|
||||
@override
|
||||
ImportResult committed(bool committed) => this(committed: committed);
|
||||
|
||||
@override
|
||||
ImportResult eventsCreated(int eventsCreated) =>
|
||||
this(eventsCreated: eventsCreated);
|
||||
|
||||
@override
|
||||
ImportResult eventsShadow(int eventsShadow) =>
|
||||
this(eventsShadow: eventsShadow);
|
||||
|
||||
@override
|
||||
ImportResult eventsSkipped(int eventsSkipped) =>
|
||||
this(eventsSkipped: eventsSkipped);
|
||||
|
||||
@override
|
||||
ImportResult eventsUpdated(int eventsUpdated) =>
|
||||
this(eventsUpdated: eventsUpdated);
|
||||
|
||||
@override
|
||||
ImportResult importId(int importId) => this(importId: importId);
|
||||
|
||||
@override
|
||||
ImportResult metricsRefreshed(bool metricsRefreshed) =>
|
||||
this(metricsRefreshed: metricsRefreshed);
|
||||
|
||||
@override
|
||||
ImportResult pendingInstruments(int pendingInstruments) =>
|
||||
this(pendingInstruments: pendingInstruments);
|
||||
|
||||
@override
|
||||
ImportResult reconciliation(ReconciliationOut reconciliation) =>
|
||||
this(reconciliation: reconciliation);
|
||||
|
||||
@override
|
||||
/// This function **does support** nullification of nullable fields. All `null` values passed to `non-nullable` fields will be ignored. You can also use `ImportResult(...).copyWith.fieldName(...)` to override fields one at a time with nullification support.
|
||||
///
|
||||
/// Usage
|
||||
/// ```dart
|
||||
/// ImportResult(...).copyWith(id: 12, name: "My name")
|
||||
/// ````
|
||||
ImportResult call({
|
||||
Object? committed = const $CopyWithPlaceholder(),
|
||||
Object? eventsCreated = const $CopyWithPlaceholder(),
|
||||
Object? eventsShadow = const $CopyWithPlaceholder(),
|
||||
Object? eventsSkipped = const $CopyWithPlaceholder(),
|
||||
Object? eventsUpdated = const $CopyWithPlaceholder(),
|
||||
Object? importId = const $CopyWithPlaceholder(),
|
||||
Object? metricsRefreshed = const $CopyWithPlaceholder(),
|
||||
Object? pendingInstruments = const $CopyWithPlaceholder(),
|
||||
Object? reconciliation = const $CopyWithPlaceholder(),
|
||||
}) {
|
||||
return ImportResult(
|
||||
committed: committed == const $CopyWithPlaceholder()
|
||||
? _value.committed
|
||||
// ignore: cast_nullable_to_non_nullable
|
||||
: committed as bool,
|
||||
eventsCreated: eventsCreated == const $CopyWithPlaceholder()
|
||||
? _value.eventsCreated
|
||||
// ignore: cast_nullable_to_non_nullable
|
||||
: eventsCreated as int,
|
||||
eventsShadow: eventsShadow == const $CopyWithPlaceholder()
|
||||
? _value.eventsShadow
|
||||
// ignore: cast_nullable_to_non_nullable
|
||||
: eventsShadow as int,
|
||||
eventsSkipped: eventsSkipped == const $CopyWithPlaceholder()
|
||||
? _value.eventsSkipped
|
||||
// ignore: cast_nullable_to_non_nullable
|
||||
: eventsSkipped as int,
|
||||
eventsUpdated: eventsUpdated == const $CopyWithPlaceholder()
|
||||
? _value.eventsUpdated
|
||||
// ignore: cast_nullable_to_non_nullable
|
||||
: eventsUpdated as int,
|
||||
importId: importId == const $CopyWithPlaceholder()
|
||||
? _value.importId
|
||||
// ignore: cast_nullable_to_non_nullable
|
||||
: importId as int,
|
||||
metricsRefreshed: metricsRefreshed == const $CopyWithPlaceholder()
|
||||
? _value.metricsRefreshed
|
||||
// ignore: cast_nullable_to_non_nullable
|
||||
: metricsRefreshed as bool,
|
||||
pendingInstruments: pendingInstruments == const $CopyWithPlaceholder()
|
||||
? _value.pendingInstruments
|
||||
// ignore: cast_nullable_to_non_nullable
|
||||
: pendingInstruments as int,
|
||||
reconciliation: reconciliation == const $CopyWithPlaceholder()
|
||||
? _value.reconciliation
|
||||
// ignore: cast_nullable_to_non_nullable
|
||||
: reconciliation as ReconciliationOut,
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
extension $ImportResultCopyWith on ImportResult {
|
||||
/// Returns a callable class that can be used as follows: `instanceOfImportResult.copyWith(...)` or like so:`instanceOfImportResult.copyWith.fieldName(...)`.
|
||||
// ignore: library_private_types_in_public_api
|
||||
_$ImportResultCWProxy get copyWith => _$ImportResultCWProxyImpl(this);
|
||||
}
|
||||
|
||||
// **************************************************************************
|
||||
// JsonSerializableGenerator
|
||||
// **************************************************************************
|
||||
|
||||
ImportResult _$ImportResultFromJson(
|
||||
Map<String, dynamic> json,
|
||||
) => $checkedCreate(
|
||||
'ImportResult',
|
||||
json,
|
||||
($checkedConvert) {
|
||||
$checkKeys(
|
||||
json,
|
||||
requiredKeys: const [
|
||||
'committed',
|
||||
'events_created',
|
||||
'events_shadow',
|
||||
'events_skipped',
|
||||
'events_updated',
|
||||
'import_id',
|
||||
'metrics_refreshed',
|
||||
'pending_instruments',
|
||||
'reconciliation',
|
||||
],
|
||||
);
|
||||
final val = ImportResult(
|
||||
committed: $checkedConvert('committed', (v) => v as bool),
|
||||
eventsCreated: $checkedConvert(
|
||||
'events_created',
|
||||
(v) => (v as num).toInt(),
|
||||
),
|
||||
eventsShadow: $checkedConvert('events_shadow', (v) => (v as num).toInt()),
|
||||
eventsSkipped: $checkedConvert(
|
||||
'events_skipped',
|
||||
(v) => (v as num).toInt(),
|
||||
),
|
||||
eventsUpdated: $checkedConvert(
|
||||
'events_updated',
|
||||
(v) => (v as num).toInt(),
|
||||
),
|
||||
importId: $checkedConvert('import_id', (v) => (v as num).toInt()),
|
||||
metricsRefreshed: $checkedConvert('metrics_refreshed', (v) => v as bool),
|
||||
pendingInstruments: $checkedConvert(
|
||||
'pending_instruments',
|
||||
(v) => (v as num).toInt(),
|
||||
),
|
||||
reconciliation: $checkedConvert(
|
||||
'reconciliation',
|
||||
(v) => ReconciliationOut.fromJson(v as Map<String, dynamic>),
|
||||
),
|
||||
);
|
||||
return val;
|
||||
},
|
||||
fieldKeyMap: const {
|
||||
'eventsCreated': 'events_created',
|
||||
'eventsShadow': 'events_shadow',
|
||||
'eventsSkipped': 'events_skipped',
|
||||
'eventsUpdated': 'events_updated',
|
||||
'importId': 'import_id',
|
||||
'metricsRefreshed': 'metrics_refreshed',
|
||||
'pendingInstruments': 'pending_instruments',
|
||||
},
|
||||
);
|
||||
|
||||
Map<String, dynamic> _$ImportResultToJson(ImportResult instance) =>
|
||||
<String, dynamic>{
|
||||
'committed': instance.committed,
|
||||
'events_created': instance.eventsCreated,
|
||||
'events_shadow': instance.eventsShadow,
|
||||
'events_skipped': instance.eventsSkipped,
|
||||
'events_updated': instance.eventsUpdated,
|
||||
'import_id': instance.importId,
|
||||
'metrics_refreshed': instance.metricsRefreshed,
|
||||
'pending_instruments': instance.pendingInstruments,
|
||||
'reconciliation': instance.reconciliation.toJson(),
|
||||
};
|
||||
@@ -0,0 +1,331 @@
|
||||
//
|
||||
// AUTO-GENERATED FILE, DO NOT MODIFY!
|
||||
//
|
||||
|
||||
// ignore_for_file: unused_element
|
||||
import 'package:fintracker_api/src/model/import_counts.dart';
|
||||
import 'package:copy_with_extension/copy_with_extension.dart';
|
||||
import 'package:json_annotation/json_annotation.dart';
|
||||
|
||||
part 'import_summary.g.dart';
|
||||
|
||||
|
||||
@CopyWith()
|
||||
@JsonSerializable(
|
||||
checked: true,
|
||||
createToJson: true,
|
||||
disallowUnrecognizedKeys: false,
|
||||
explicitToJson: true,
|
||||
)
|
||||
class ImportSummary {
|
||||
/// Returns a new [ImportSummary] instance.
|
||||
ImportSummary({
|
||||
|
||||
this.accountExternalId,
|
||||
|
||||
this.accountId,
|
||||
|
||||
this.accountName,
|
||||
|
||||
required this.broker,
|
||||
|
||||
this.committedAt,
|
||||
|
||||
required this.counts,
|
||||
|
||||
this.duplicateOfId,
|
||||
|
||||
this.error,
|
||||
|
||||
required this.filename,
|
||||
|
||||
required this.id,
|
||||
|
||||
required this.parseStatus,
|
||||
|
||||
this.parserName,
|
||||
|
||||
this.parserVersion,
|
||||
|
||||
this.periodFrom,
|
||||
|
||||
this.periodTo,
|
||||
|
||||
required this.sha256,
|
||||
|
||||
required this.sizeBytes,
|
||||
|
||||
this.uploadedAt,
|
||||
});
|
||||
|
||||
@JsonKey(
|
||||
|
||||
name: r'account_external_id',
|
||||
required: false,
|
||||
includeIfNull: false,
|
||||
)
|
||||
|
||||
|
||||
final String? accountExternalId;
|
||||
|
||||
|
||||
|
||||
@JsonKey(
|
||||
|
||||
name: r'account_id',
|
||||
required: false,
|
||||
includeIfNull: false,
|
||||
)
|
||||
|
||||
|
||||
final int? accountId;
|
||||
|
||||
|
||||
|
||||
@JsonKey(
|
||||
|
||||
name: r'account_name',
|
||||
required: false,
|
||||
includeIfNull: false,
|
||||
)
|
||||
|
||||
|
||||
final String? accountName;
|
||||
|
||||
|
||||
|
||||
@JsonKey(
|
||||
|
||||
name: r'broker',
|
||||
required: true,
|
||||
includeIfNull: false,
|
||||
)
|
||||
|
||||
|
||||
final String broker;
|
||||
|
||||
|
||||
|
||||
@JsonKey(
|
||||
|
||||
name: r'committed_at',
|
||||
required: false,
|
||||
includeIfNull: false,
|
||||
)
|
||||
|
||||
|
||||
final DateTime? committedAt;
|
||||
|
||||
|
||||
|
||||
@JsonKey(
|
||||
|
||||
name: r'counts',
|
||||
required: true,
|
||||
includeIfNull: false,
|
||||
)
|
||||
|
||||
|
||||
final ImportCounts counts;
|
||||
|
||||
|
||||
|
||||
@JsonKey(
|
||||
|
||||
name: r'duplicate_of_id',
|
||||
required: false,
|
||||
includeIfNull: false,
|
||||
)
|
||||
|
||||
|
||||
final int? duplicateOfId;
|
||||
|
||||
|
||||
|
||||
@JsonKey(
|
||||
|
||||
name: r'error',
|
||||
required: false,
|
||||
includeIfNull: false,
|
||||
)
|
||||
|
||||
|
||||
final String? error;
|
||||
|
||||
|
||||
|
||||
@JsonKey(
|
||||
|
||||
name: r'filename',
|
||||
required: true,
|
||||
includeIfNull: false,
|
||||
)
|
||||
|
||||
|
||||
final String filename;
|
||||
|
||||
|
||||
|
||||
@JsonKey(
|
||||
|
||||
name: r'id',
|
||||
required: true,
|
||||
includeIfNull: false,
|
||||
)
|
||||
|
||||
|
||||
final int id;
|
||||
|
||||
|
||||
|
||||
@JsonKey(
|
||||
|
||||
name: r'parse_status',
|
||||
required: true,
|
||||
includeIfNull: false,
|
||||
)
|
||||
|
||||
|
||||
final String parseStatus;
|
||||
|
||||
|
||||
|
||||
@JsonKey(
|
||||
|
||||
name: r'parser_name',
|
||||
required: false,
|
||||
includeIfNull: false,
|
||||
)
|
||||
|
||||
|
||||
final String? parserName;
|
||||
|
||||
|
||||
|
||||
@JsonKey(
|
||||
|
||||
name: r'parser_version',
|
||||
required: false,
|
||||
includeIfNull: false,
|
||||
)
|
||||
|
||||
|
||||
final String? parserVersion;
|
||||
|
||||
|
||||
|
||||
@JsonKey(
|
||||
|
||||
name: r'period_from',
|
||||
required: false,
|
||||
includeIfNull: false,
|
||||
)
|
||||
|
||||
|
||||
final DateTime? periodFrom;
|
||||
|
||||
|
||||
|
||||
@JsonKey(
|
||||
|
||||
name: r'period_to',
|
||||
required: false,
|
||||
includeIfNull: false,
|
||||
)
|
||||
|
||||
|
||||
final DateTime? periodTo;
|
||||
|
||||
|
||||
|
||||
@JsonKey(
|
||||
|
||||
name: r'sha256',
|
||||
required: true,
|
||||
includeIfNull: false,
|
||||
)
|
||||
|
||||
|
||||
final String sha256;
|
||||
|
||||
|
||||
|
||||
@JsonKey(
|
||||
|
||||
name: r'size_bytes',
|
||||
required: true,
|
||||
includeIfNull: false,
|
||||
)
|
||||
|
||||
|
||||
final int sizeBytes;
|
||||
|
||||
|
||||
|
||||
@JsonKey(
|
||||
|
||||
name: r'uploaded_at',
|
||||
required: false,
|
||||
includeIfNull: false,
|
||||
)
|
||||
|
||||
|
||||
final DateTime? uploadedAt;
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
@override
|
||||
bool operator ==(Object other) => identical(this, other) || other is ImportSummary &&
|
||||
other.accountExternalId == accountExternalId &&
|
||||
other.accountId == accountId &&
|
||||
other.accountName == accountName &&
|
||||
other.broker == broker &&
|
||||
other.committedAt == committedAt &&
|
||||
other.counts == counts &&
|
||||
other.duplicateOfId == duplicateOfId &&
|
||||
other.error == error &&
|
||||
other.filename == filename &&
|
||||
other.id == id &&
|
||||
other.parseStatus == parseStatus &&
|
||||
other.parserName == parserName &&
|
||||
other.parserVersion == parserVersion &&
|
||||
other.periodFrom == periodFrom &&
|
||||
other.periodTo == periodTo &&
|
||||
other.sha256 == sha256 &&
|
||||
other.sizeBytes == sizeBytes &&
|
||||
other.uploadedAt == uploadedAt;
|
||||
|
||||
@override
|
||||
int get hashCode =>
|
||||
(accountExternalId == null ? 0 : accountExternalId.hashCode) +
|
||||
(accountId == null ? 0 : accountId.hashCode) +
|
||||
(accountName == null ? 0 : accountName.hashCode) +
|
||||
broker.hashCode +
|
||||
(committedAt == null ? 0 : committedAt.hashCode) +
|
||||
counts.hashCode +
|
||||
(duplicateOfId == null ? 0 : duplicateOfId.hashCode) +
|
||||
(error == null ? 0 : error.hashCode) +
|
||||
filename.hashCode +
|
||||
id.hashCode +
|
||||
parseStatus.hashCode +
|
||||
(parserName == null ? 0 : parserName.hashCode) +
|
||||
(parserVersion == null ? 0 : parserVersion.hashCode) +
|
||||
(periodFrom == null ? 0 : periodFrom.hashCode) +
|
||||
(periodTo == null ? 0 : periodTo.hashCode) +
|
||||
sha256.hashCode +
|
||||
sizeBytes.hashCode +
|
||||
(uploadedAt == null ? 0 : uploadedAt.hashCode);
|
||||
|
||||
factory ImportSummary.fromJson(Map<String, dynamic> json) => _$ImportSummaryFromJson(json);
|
||||
|
||||
Map<String, dynamic> toJson() => _$ImportSummaryToJson(this);
|
||||
|
||||
@override
|
||||
String toString() {
|
||||
return toJson().toString();
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -0,0 +1,352 @@
|
||||
// GENERATED CODE - DO NOT MODIFY BY HAND
|
||||
|
||||
part of 'import_summary.dart';
|
||||
|
||||
// **************************************************************************
|
||||
// CopyWithGenerator
|
||||
// **************************************************************************
|
||||
|
||||
abstract class _$ImportSummaryCWProxy {
|
||||
ImportSummary accountExternalId(String? accountExternalId);
|
||||
|
||||
ImportSummary accountId(int? accountId);
|
||||
|
||||
ImportSummary accountName(String? accountName);
|
||||
|
||||
ImportSummary broker(String broker);
|
||||
|
||||
ImportSummary committedAt(DateTime? committedAt);
|
||||
|
||||
ImportSummary counts(ImportCounts counts);
|
||||
|
||||
ImportSummary duplicateOfId(int? duplicateOfId);
|
||||
|
||||
ImportSummary error(String? error);
|
||||
|
||||
ImportSummary filename(String filename);
|
||||
|
||||
ImportSummary id(int id);
|
||||
|
||||
ImportSummary parseStatus(String parseStatus);
|
||||
|
||||
ImportSummary parserName(String? parserName);
|
||||
|
||||
ImportSummary parserVersion(String? parserVersion);
|
||||
|
||||
ImportSummary periodFrom(DateTime? periodFrom);
|
||||
|
||||
ImportSummary periodTo(DateTime? periodTo);
|
||||
|
||||
ImportSummary sha256(String sha256);
|
||||
|
||||
ImportSummary sizeBytes(int sizeBytes);
|
||||
|
||||
ImportSummary uploadedAt(DateTime? uploadedAt);
|
||||
|
||||
/// This function **does support** nullification of nullable fields. All `null` values passed to `non-nullable` fields will be ignored. You can also use `ImportSummary(...).copyWith.fieldName(...)` to override fields one at a time with nullification support.
|
||||
///
|
||||
/// Usage
|
||||
/// ```dart
|
||||
/// ImportSummary(...).copyWith(id: 12, name: "My name")
|
||||
/// ````
|
||||
ImportSummary call({
|
||||
String? accountExternalId,
|
||||
int? accountId,
|
||||
String? accountName,
|
||||
String broker,
|
||||
DateTime? committedAt,
|
||||
ImportCounts counts,
|
||||
int? duplicateOfId,
|
||||
String? error,
|
||||
String filename,
|
||||
int id,
|
||||
String parseStatus,
|
||||
String? parserName,
|
||||
String? parserVersion,
|
||||
DateTime? periodFrom,
|
||||
DateTime? periodTo,
|
||||
String sha256,
|
||||
int sizeBytes,
|
||||
DateTime? uploadedAt,
|
||||
});
|
||||
}
|
||||
|
||||
/// Proxy class for `copyWith` functionality. This is a callable class and can be used as follows: `instanceOfImportSummary.copyWith(...)`. Additionally contains functions for specific fields e.g. `instanceOfImportSummary.copyWith.fieldName(...)`
|
||||
class _$ImportSummaryCWProxyImpl implements _$ImportSummaryCWProxy {
|
||||
const _$ImportSummaryCWProxyImpl(this._value);
|
||||
|
||||
final ImportSummary _value;
|
||||
|
||||
@override
|
||||
ImportSummary accountExternalId(String? accountExternalId) =>
|
||||
this(accountExternalId: accountExternalId);
|
||||
|
||||
@override
|
||||
ImportSummary accountId(int? accountId) => this(accountId: accountId);
|
||||
|
||||
@override
|
||||
ImportSummary accountName(String? accountName) =>
|
||||
this(accountName: accountName);
|
||||
|
||||
@override
|
||||
ImportSummary broker(String broker) => this(broker: broker);
|
||||
|
||||
@override
|
||||
ImportSummary committedAt(DateTime? committedAt) =>
|
||||
this(committedAt: committedAt);
|
||||
|
||||
@override
|
||||
ImportSummary counts(ImportCounts counts) => this(counts: counts);
|
||||
|
||||
@override
|
||||
ImportSummary duplicateOfId(int? duplicateOfId) =>
|
||||
this(duplicateOfId: duplicateOfId);
|
||||
|
||||
@override
|
||||
ImportSummary error(String? error) => this(error: error);
|
||||
|
||||
@override
|
||||
ImportSummary filename(String filename) => this(filename: filename);
|
||||
|
||||
@override
|
||||
ImportSummary id(int id) => this(id: id);
|
||||
|
||||
@override
|
||||
ImportSummary parseStatus(String parseStatus) =>
|
||||
this(parseStatus: parseStatus);
|
||||
|
||||
@override
|
||||
ImportSummary parserName(String? parserName) => this(parserName: parserName);
|
||||
|
||||
@override
|
||||
ImportSummary parserVersion(String? parserVersion) =>
|
||||
this(parserVersion: parserVersion);
|
||||
|
||||
@override
|
||||
ImportSummary periodFrom(DateTime? periodFrom) =>
|
||||
this(periodFrom: periodFrom);
|
||||
|
||||
@override
|
||||
ImportSummary periodTo(DateTime? periodTo) => this(periodTo: periodTo);
|
||||
|
||||
@override
|
||||
ImportSummary sha256(String sha256) => this(sha256: sha256);
|
||||
|
||||
@override
|
||||
ImportSummary sizeBytes(int sizeBytes) => this(sizeBytes: sizeBytes);
|
||||
|
||||
@override
|
||||
ImportSummary uploadedAt(DateTime? uploadedAt) =>
|
||||
this(uploadedAt: uploadedAt);
|
||||
|
||||
@override
|
||||
/// This function **does support** nullification of nullable fields. All `null` values passed to `non-nullable` fields will be ignored. You can also use `ImportSummary(...).copyWith.fieldName(...)` to override fields one at a time with nullification support.
|
||||
///
|
||||
/// Usage
|
||||
/// ```dart
|
||||
/// ImportSummary(...).copyWith(id: 12, name: "My name")
|
||||
/// ````
|
||||
ImportSummary call({
|
||||
Object? accountExternalId = const $CopyWithPlaceholder(),
|
||||
Object? accountId = const $CopyWithPlaceholder(),
|
||||
Object? accountName = const $CopyWithPlaceholder(),
|
||||
Object? broker = const $CopyWithPlaceholder(),
|
||||
Object? committedAt = const $CopyWithPlaceholder(),
|
||||
Object? counts = const $CopyWithPlaceholder(),
|
||||
Object? duplicateOfId = const $CopyWithPlaceholder(),
|
||||
Object? error = const $CopyWithPlaceholder(),
|
||||
Object? filename = const $CopyWithPlaceholder(),
|
||||
Object? id = const $CopyWithPlaceholder(),
|
||||
Object? parseStatus = const $CopyWithPlaceholder(),
|
||||
Object? parserName = const $CopyWithPlaceholder(),
|
||||
Object? parserVersion = const $CopyWithPlaceholder(),
|
||||
Object? periodFrom = const $CopyWithPlaceholder(),
|
||||
Object? periodTo = const $CopyWithPlaceholder(),
|
||||
Object? sha256 = const $CopyWithPlaceholder(),
|
||||
Object? sizeBytes = const $CopyWithPlaceholder(),
|
||||
Object? uploadedAt = const $CopyWithPlaceholder(),
|
||||
}) {
|
||||
return ImportSummary(
|
||||
accountExternalId: accountExternalId == const $CopyWithPlaceholder()
|
||||
? _value.accountExternalId
|
||||
// ignore: cast_nullable_to_non_nullable
|
||||
: accountExternalId as String?,
|
||||
accountId: accountId == const $CopyWithPlaceholder()
|
||||
? _value.accountId
|
||||
// ignore: cast_nullable_to_non_nullable
|
||||
: accountId as int?,
|
||||
accountName: accountName == const $CopyWithPlaceholder()
|
||||
? _value.accountName
|
||||
// ignore: cast_nullable_to_non_nullable
|
||||
: accountName as String?,
|
||||
broker: broker == const $CopyWithPlaceholder()
|
||||
? _value.broker
|
||||
// ignore: cast_nullable_to_non_nullable
|
||||
: broker as String,
|
||||
committedAt: committedAt == const $CopyWithPlaceholder()
|
||||
? _value.committedAt
|
||||
// ignore: cast_nullable_to_non_nullable
|
||||
: committedAt as DateTime?,
|
||||
counts: counts == const $CopyWithPlaceholder()
|
||||
? _value.counts
|
||||
// ignore: cast_nullable_to_non_nullable
|
||||
: counts as ImportCounts,
|
||||
duplicateOfId: duplicateOfId == const $CopyWithPlaceholder()
|
||||
? _value.duplicateOfId
|
||||
// ignore: cast_nullable_to_non_nullable
|
||||
: duplicateOfId as int?,
|
||||
error: error == const $CopyWithPlaceholder()
|
||||
? _value.error
|
||||
// ignore: cast_nullable_to_non_nullable
|
||||
: error as String?,
|
||||
filename: filename == const $CopyWithPlaceholder()
|
||||
? _value.filename
|
||||
// ignore: cast_nullable_to_non_nullable
|
||||
: filename as String,
|
||||
id: id == const $CopyWithPlaceholder()
|
||||
? _value.id
|
||||
// ignore: cast_nullable_to_non_nullable
|
||||
: id as int,
|
||||
parseStatus: parseStatus == const $CopyWithPlaceholder()
|
||||
? _value.parseStatus
|
||||
// ignore: cast_nullable_to_non_nullable
|
||||
: parseStatus as String,
|
||||
parserName: parserName == const $CopyWithPlaceholder()
|
||||
? _value.parserName
|
||||
// ignore: cast_nullable_to_non_nullable
|
||||
: parserName as String?,
|
||||
parserVersion: parserVersion == const $CopyWithPlaceholder()
|
||||
? _value.parserVersion
|
||||
// ignore: cast_nullable_to_non_nullable
|
||||
: parserVersion as String?,
|
||||
periodFrom: periodFrom == const $CopyWithPlaceholder()
|
||||
? _value.periodFrom
|
||||
// ignore: cast_nullable_to_non_nullable
|
||||
: periodFrom as DateTime?,
|
||||
periodTo: periodTo == const $CopyWithPlaceholder()
|
||||
? _value.periodTo
|
||||
// ignore: cast_nullable_to_non_nullable
|
||||
: periodTo as DateTime?,
|
||||
sha256: sha256 == const $CopyWithPlaceholder()
|
||||
? _value.sha256
|
||||
// ignore: cast_nullable_to_non_nullable
|
||||
: sha256 as String,
|
||||
sizeBytes: sizeBytes == const $CopyWithPlaceholder()
|
||||
? _value.sizeBytes
|
||||
// ignore: cast_nullable_to_non_nullable
|
||||
: sizeBytes as int,
|
||||
uploadedAt: uploadedAt == const $CopyWithPlaceholder()
|
||||
? _value.uploadedAt
|
||||
// ignore: cast_nullable_to_non_nullable
|
||||
: uploadedAt as DateTime?,
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
extension $ImportSummaryCopyWith on ImportSummary {
|
||||
/// Returns a callable class that can be used as follows: `instanceOfImportSummary.copyWith(...)` or like so:`instanceOfImportSummary.copyWith.fieldName(...)`.
|
||||
// ignore: library_private_types_in_public_api
|
||||
_$ImportSummaryCWProxy get copyWith => _$ImportSummaryCWProxyImpl(this);
|
||||
}
|
||||
|
||||
// **************************************************************************
|
||||
// JsonSerializableGenerator
|
||||
// **************************************************************************
|
||||
|
||||
ImportSummary _$ImportSummaryFromJson(Map<String, dynamic> json) =>
|
||||
$checkedCreate(
|
||||
'ImportSummary',
|
||||
json,
|
||||
($checkedConvert) {
|
||||
$checkKeys(
|
||||
json,
|
||||
requiredKeys: const [
|
||||
'broker',
|
||||
'counts',
|
||||
'filename',
|
||||
'id',
|
||||
'parse_status',
|
||||
'sha256',
|
||||
'size_bytes',
|
||||
],
|
||||
);
|
||||
final val = ImportSummary(
|
||||
accountExternalId: $checkedConvert(
|
||||
'account_external_id',
|
||||
(v) => v as String?,
|
||||
),
|
||||
accountId: $checkedConvert('account_id', (v) => (v as num?)?.toInt()),
|
||||
accountName: $checkedConvert('account_name', (v) => v as String?),
|
||||
broker: $checkedConvert('broker', (v) => v as String),
|
||||
committedAt: $checkedConvert(
|
||||
'committed_at',
|
||||
(v) => v == null ? null : DateTime.parse(v as String),
|
||||
),
|
||||
counts: $checkedConvert(
|
||||
'counts',
|
||||
(v) => ImportCounts.fromJson(v as Map<String, dynamic>),
|
||||
),
|
||||
duplicateOfId: $checkedConvert(
|
||||
'duplicate_of_id',
|
||||
(v) => (v as num?)?.toInt(),
|
||||
),
|
||||
error: $checkedConvert('error', (v) => v as String?),
|
||||
filename: $checkedConvert('filename', (v) => v as String),
|
||||
id: $checkedConvert('id', (v) => (v as num).toInt()),
|
||||
parseStatus: $checkedConvert('parse_status', (v) => v as String),
|
||||
parserName: $checkedConvert('parser_name', (v) => v as String?),
|
||||
parserVersion: $checkedConvert('parser_version', (v) => v as String?),
|
||||
periodFrom: $checkedConvert(
|
||||
'period_from',
|
||||
(v) => v == null ? null : DateTime.parse(v as String),
|
||||
),
|
||||
periodTo: $checkedConvert(
|
||||
'period_to',
|
||||
(v) => v == null ? null : DateTime.parse(v as String),
|
||||
),
|
||||
sha256: $checkedConvert('sha256', (v) => v as String),
|
||||
sizeBytes: $checkedConvert('size_bytes', (v) => (v as num).toInt()),
|
||||
uploadedAt: $checkedConvert(
|
||||
'uploaded_at',
|
||||
(v) => v == null ? null : DateTime.parse(v as String),
|
||||
),
|
||||
);
|
||||
return val;
|
||||
},
|
||||
fieldKeyMap: const {
|
||||
'accountExternalId': 'account_external_id',
|
||||
'accountId': 'account_id',
|
||||
'accountName': 'account_name',
|
||||
'committedAt': 'committed_at',
|
||||
'duplicateOfId': 'duplicate_of_id',
|
||||
'parseStatus': 'parse_status',
|
||||
'parserName': 'parser_name',
|
||||
'parserVersion': 'parser_version',
|
||||
'periodFrom': 'period_from',
|
||||
'periodTo': 'period_to',
|
||||
'sizeBytes': 'size_bytes',
|
||||
'uploadedAt': 'uploaded_at',
|
||||
},
|
||||
);
|
||||
|
||||
Map<String, dynamic> _$ImportSummaryToJson(ImportSummary instance) =>
|
||||
<String, dynamic>{
|
||||
'account_external_id': ?instance.accountExternalId,
|
||||
'account_id': ?instance.accountId,
|
||||
'account_name': ?instance.accountName,
|
||||
'broker': instance.broker,
|
||||
'committed_at': ?instance.committedAt?.toIso8601String(),
|
||||
'counts': instance.counts.toJson(),
|
||||
'duplicate_of_id': ?instance.duplicateOfId,
|
||||
'error': ?instance.error,
|
||||
'filename': instance.filename,
|
||||
'id': instance.id,
|
||||
'parse_status': instance.parseStatus,
|
||||
'parser_name': ?instance.parserName,
|
||||
'parser_version': ?instance.parserVersion,
|
||||
'period_from': ?instance.periodFrom?.toIso8601String(),
|
||||
'period_to': ?instance.periodTo?.toIso8601String(),
|
||||
'sha256': instance.sha256,
|
||||
'size_bytes': instance.sizeBytes,
|
||||
'uploaded_at': ?instance.uploadedAt?.toIso8601String(),
|
||||
};
|
||||
@@ -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 'link_create.g.dart';
|
||||
|
||||
|
||||
@CopyWith()
|
||||
@JsonSerializable(
|
||||
checked: true,
|
||||
createToJson: true,
|
||||
disallowUnrecognizedKeys: false,
|
||||
explicitToJson: true,
|
||||
)
|
||||
class LinkCreate {
|
||||
/// Returns a new [LinkCreate] instance.
|
||||
LinkCreate({
|
||||
|
||||
required this.cashTxnId,
|
||||
|
||||
required this.eventId,
|
||||
});
|
||||
|
||||
@JsonKey(
|
||||
|
||||
name: r'cash_txn_id',
|
||||
required: true,
|
||||
includeIfNull: false,
|
||||
)
|
||||
|
||||
|
||||
final int cashTxnId;
|
||||
|
||||
|
||||
|
||||
@JsonKey(
|
||||
|
||||
name: r'event_id',
|
||||
required: true,
|
||||
includeIfNull: false,
|
||||
)
|
||||
|
||||
|
||||
final int eventId;
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
@override
|
||||
bool operator ==(Object other) => identical(this, other) || other is LinkCreate &&
|
||||
other.cashTxnId == cashTxnId &&
|
||||
other.eventId == eventId;
|
||||
|
||||
@override
|
||||
int get hashCode =>
|
||||
cashTxnId.hashCode +
|
||||
eventId.hashCode;
|
||||
|
||||
factory LinkCreate.fromJson(Map<String, dynamic> json) => _$LinkCreateFromJson(json);
|
||||
|
||||
Map<String, dynamic> toJson() => _$LinkCreateToJson(this);
|
||||
|
||||
@override
|
||||
String toString() {
|
||||
return toJson().toString();
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -0,0 +1,87 @@
|
||||
// GENERATED CODE - DO NOT MODIFY BY HAND
|
||||
|
||||
part of 'link_create.dart';
|
||||
|
||||
// **************************************************************************
|
||||
// CopyWithGenerator
|
||||
// **************************************************************************
|
||||
|
||||
abstract class _$LinkCreateCWProxy {
|
||||
LinkCreate cashTxnId(int cashTxnId);
|
||||
|
||||
LinkCreate eventId(int eventId);
|
||||
|
||||
/// This function **does support** nullification of nullable fields. All `null` values passed to `non-nullable` fields will be ignored. You can also use `LinkCreate(...).copyWith.fieldName(...)` to override fields one at a time with nullification support.
|
||||
///
|
||||
/// Usage
|
||||
/// ```dart
|
||||
/// LinkCreate(...).copyWith(id: 12, name: "My name")
|
||||
/// ````
|
||||
LinkCreate call({int cashTxnId, int eventId});
|
||||
}
|
||||
|
||||
/// Proxy class for `copyWith` functionality. This is a callable class and can be used as follows: `instanceOfLinkCreate.copyWith(...)`. Additionally contains functions for specific fields e.g. `instanceOfLinkCreate.copyWith.fieldName(...)`
|
||||
class _$LinkCreateCWProxyImpl implements _$LinkCreateCWProxy {
|
||||
const _$LinkCreateCWProxyImpl(this._value);
|
||||
|
||||
final LinkCreate _value;
|
||||
|
||||
@override
|
||||
LinkCreate cashTxnId(int cashTxnId) => this(cashTxnId: cashTxnId);
|
||||
|
||||
@override
|
||||
LinkCreate eventId(int eventId) => this(eventId: eventId);
|
||||
|
||||
@override
|
||||
/// This function **does support** nullification of nullable fields. All `null` values passed to `non-nullable` fields will be ignored. You can also use `LinkCreate(...).copyWith.fieldName(...)` to override fields one at a time with nullification support.
|
||||
///
|
||||
/// Usage
|
||||
/// ```dart
|
||||
/// LinkCreate(...).copyWith(id: 12, name: "My name")
|
||||
/// ````
|
||||
LinkCreate call({
|
||||
Object? cashTxnId = const $CopyWithPlaceholder(),
|
||||
Object? eventId = const $CopyWithPlaceholder(),
|
||||
}) {
|
||||
return LinkCreate(
|
||||
cashTxnId: cashTxnId == const $CopyWithPlaceholder()
|
||||
? _value.cashTxnId
|
||||
// ignore: cast_nullable_to_non_nullable
|
||||
: cashTxnId as int,
|
||||
eventId: eventId == const $CopyWithPlaceholder()
|
||||
? _value.eventId
|
||||
// ignore: cast_nullable_to_non_nullable
|
||||
: eventId as int,
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
extension $LinkCreateCopyWith on LinkCreate {
|
||||
/// Returns a callable class that can be used as follows: `instanceOfLinkCreate.copyWith(...)` or like so:`instanceOfLinkCreate.copyWith.fieldName(...)`.
|
||||
// ignore: library_private_types_in_public_api
|
||||
_$LinkCreateCWProxy get copyWith => _$LinkCreateCWProxyImpl(this);
|
||||
}
|
||||
|
||||
// **************************************************************************
|
||||
// JsonSerializableGenerator
|
||||
// **************************************************************************
|
||||
|
||||
LinkCreate _$LinkCreateFromJson(Map<String, dynamic> json) => $checkedCreate(
|
||||
'LinkCreate',
|
||||
json,
|
||||
($checkedConvert) {
|
||||
$checkKeys(json, requiredKeys: const ['cash_txn_id', 'event_id']);
|
||||
final val = LinkCreate(
|
||||
cashTxnId: $checkedConvert('cash_txn_id', (v) => (v as num).toInt()),
|
||||
eventId: $checkedConvert('event_id', (v) => (v as num).toInt()),
|
||||
);
|
||||
return val;
|
||||
},
|
||||
fieldKeyMap: const {'cashTxnId': 'cash_txn_id', 'eventId': 'event_id'},
|
||||
);
|
||||
|
||||
Map<String, dynamic> _$LinkCreateToJson(LinkCreate instance) =>
|
||||
<String, dynamic>{
|
||||
'cash_txn_id': instance.cashTxnId,
|
||||
'event_id': instance.eventId,
|
||||
};
|
||||
@@ -0,0 +1,188 @@
|
||||
//
|
||||
// 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 'link_out.g.dart';
|
||||
|
||||
|
||||
@CopyWith()
|
||||
@JsonSerializable(
|
||||
checked: true,
|
||||
createToJson: true,
|
||||
disallowUnrecognizedKeys: false,
|
||||
explicitToJson: true,
|
||||
)
|
||||
class LinkOut {
|
||||
/// Returns a new [LinkOut] instance.
|
||||
LinkOut({
|
||||
|
||||
required this.amountDelta,
|
||||
|
||||
required this.cashTxnId,
|
||||
|
||||
required this.confidence,
|
||||
|
||||
required this.currency,
|
||||
|
||||
required this.dayGap,
|
||||
|
||||
required this.eventId,
|
||||
|
||||
required this.id,
|
||||
|
||||
required this.kind,
|
||||
|
||||
required this.note,
|
||||
});
|
||||
|
||||
/// decimal as string
|
||||
@JsonKey(
|
||||
|
||||
name: r'amount_delta',
|
||||
required: true,
|
||||
includeIfNull: false,
|
||||
)
|
||||
|
||||
|
||||
final String amountDelta;
|
||||
|
||||
|
||||
|
||||
@JsonKey(
|
||||
|
||||
name: r'cash_txn_id',
|
||||
required: true,
|
||||
includeIfNull: false,
|
||||
)
|
||||
|
||||
|
||||
final int cashTxnId;
|
||||
|
||||
|
||||
|
||||
/// decimal as string
|
||||
@JsonKey(
|
||||
|
||||
name: r'confidence',
|
||||
required: true,
|
||||
includeIfNull: false,
|
||||
)
|
||||
|
||||
|
||||
final String confidence;
|
||||
|
||||
|
||||
|
||||
@JsonKey(
|
||||
|
||||
name: r'currency',
|
||||
required: true,
|
||||
includeIfNull: false,
|
||||
)
|
||||
|
||||
|
||||
final String currency;
|
||||
|
||||
|
||||
|
||||
@JsonKey(
|
||||
|
||||
name: r'day_gap',
|
||||
required: true,
|
||||
includeIfNull: false,
|
||||
)
|
||||
|
||||
|
||||
final int dayGap;
|
||||
|
||||
|
||||
|
||||
@JsonKey(
|
||||
|
||||
name: r'event_id',
|
||||
required: true,
|
||||
includeIfNull: false,
|
||||
)
|
||||
|
||||
|
||||
final int eventId;
|
||||
|
||||
|
||||
|
||||
@JsonKey(
|
||||
|
||||
name: r'id',
|
||||
required: true,
|
||||
includeIfNull: false,
|
||||
)
|
||||
|
||||
|
||||
final int id;
|
||||
|
||||
|
||||
|
||||
@JsonKey(
|
||||
|
||||
name: r'kind',
|
||||
required: true,
|
||||
includeIfNull: false,
|
||||
)
|
||||
|
||||
|
||||
final String kind;
|
||||
|
||||
|
||||
|
||||
@JsonKey(
|
||||
|
||||
name: r'note',
|
||||
required: true,
|
||||
includeIfNull: true,
|
||||
)
|
||||
|
||||
|
||||
final String? note;
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
@override
|
||||
bool operator ==(Object other) => identical(this, other) || other is LinkOut &&
|
||||
other.amountDelta == amountDelta &&
|
||||
other.cashTxnId == cashTxnId &&
|
||||
other.confidence == confidence &&
|
||||
other.currency == currency &&
|
||||
other.dayGap == dayGap &&
|
||||
other.eventId == eventId &&
|
||||
other.id == id &&
|
||||
other.kind == kind &&
|
||||
other.note == note;
|
||||
|
||||
@override
|
||||
int get hashCode =>
|
||||
amountDelta.hashCode +
|
||||
cashTxnId.hashCode +
|
||||
confidence.hashCode +
|
||||
currency.hashCode +
|
||||
dayGap.hashCode +
|
||||
eventId.hashCode +
|
||||
id.hashCode +
|
||||
kind.hashCode +
|
||||
(note == null ? 0 : note.hashCode);
|
||||
|
||||
factory LinkOut.fromJson(Map<String, dynamic> json) => _$LinkOutFromJson(json);
|
||||
|
||||
Map<String, dynamic> toJson() => _$LinkOutToJson(this);
|
||||
|
||||
@override
|
||||
String toString() {
|
||||
return toJson().toString();
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -0,0 +1,198 @@
|
||||
// GENERATED CODE - DO NOT MODIFY BY HAND
|
||||
|
||||
part of 'link_out.dart';
|
||||
|
||||
// **************************************************************************
|
||||
// CopyWithGenerator
|
||||
// **************************************************************************
|
||||
|
||||
abstract class _$LinkOutCWProxy {
|
||||
LinkOut amountDelta(String amountDelta);
|
||||
|
||||
LinkOut cashTxnId(int cashTxnId);
|
||||
|
||||
LinkOut confidence(String confidence);
|
||||
|
||||
LinkOut currency(String currency);
|
||||
|
||||
LinkOut dayGap(int dayGap);
|
||||
|
||||
LinkOut eventId(int eventId);
|
||||
|
||||
LinkOut id(int id);
|
||||
|
||||
LinkOut kind(String kind);
|
||||
|
||||
LinkOut note(String? note);
|
||||
|
||||
/// This function **does support** nullification of nullable fields. All `null` values passed to `non-nullable` fields will be ignored. You can also use `LinkOut(...).copyWith.fieldName(...)` to override fields one at a time with nullification support.
|
||||
///
|
||||
/// Usage
|
||||
/// ```dart
|
||||
/// LinkOut(...).copyWith(id: 12, name: "My name")
|
||||
/// ````
|
||||
LinkOut call({
|
||||
String amountDelta,
|
||||
int cashTxnId,
|
||||
String confidence,
|
||||
String currency,
|
||||
int dayGap,
|
||||
int eventId,
|
||||
int id,
|
||||
String kind,
|
||||
String? note,
|
||||
});
|
||||
}
|
||||
|
||||
/// Proxy class for `copyWith` functionality. This is a callable class and can be used as follows: `instanceOfLinkOut.copyWith(...)`. Additionally contains functions for specific fields e.g. `instanceOfLinkOut.copyWith.fieldName(...)`
|
||||
class _$LinkOutCWProxyImpl implements _$LinkOutCWProxy {
|
||||
const _$LinkOutCWProxyImpl(this._value);
|
||||
|
||||
final LinkOut _value;
|
||||
|
||||
@override
|
||||
LinkOut amountDelta(String amountDelta) => this(amountDelta: amountDelta);
|
||||
|
||||
@override
|
||||
LinkOut cashTxnId(int cashTxnId) => this(cashTxnId: cashTxnId);
|
||||
|
||||
@override
|
||||
LinkOut confidence(String confidence) => this(confidence: confidence);
|
||||
|
||||
@override
|
||||
LinkOut currency(String currency) => this(currency: currency);
|
||||
|
||||
@override
|
||||
LinkOut dayGap(int dayGap) => this(dayGap: dayGap);
|
||||
|
||||
@override
|
||||
LinkOut eventId(int eventId) => this(eventId: eventId);
|
||||
|
||||
@override
|
||||
LinkOut id(int id) => this(id: id);
|
||||
|
||||
@override
|
||||
LinkOut kind(String kind) => this(kind: kind);
|
||||
|
||||
@override
|
||||
LinkOut note(String? note) => this(note: note);
|
||||
|
||||
@override
|
||||
/// This function **does support** nullification of nullable fields. All `null` values passed to `non-nullable` fields will be ignored. You can also use `LinkOut(...).copyWith.fieldName(...)` to override fields one at a time with nullification support.
|
||||
///
|
||||
/// Usage
|
||||
/// ```dart
|
||||
/// LinkOut(...).copyWith(id: 12, name: "My name")
|
||||
/// ````
|
||||
LinkOut call({
|
||||
Object? amountDelta = const $CopyWithPlaceholder(),
|
||||
Object? cashTxnId = const $CopyWithPlaceholder(),
|
||||
Object? confidence = const $CopyWithPlaceholder(),
|
||||
Object? currency = const $CopyWithPlaceholder(),
|
||||
Object? dayGap = const $CopyWithPlaceholder(),
|
||||
Object? eventId = const $CopyWithPlaceholder(),
|
||||
Object? id = const $CopyWithPlaceholder(),
|
||||
Object? kind = const $CopyWithPlaceholder(),
|
||||
Object? note = const $CopyWithPlaceholder(),
|
||||
}) {
|
||||
return LinkOut(
|
||||
amountDelta: amountDelta == const $CopyWithPlaceholder()
|
||||
? _value.amountDelta
|
||||
// ignore: cast_nullable_to_non_nullable
|
||||
: amountDelta as String,
|
||||
cashTxnId: cashTxnId == const $CopyWithPlaceholder()
|
||||
? _value.cashTxnId
|
||||
// ignore: cast_nullable_to_non_nullable
|
||||
: cashTxnId as int,
|
||||
confidence: confidence == const $CopyWithPlaceholder()
|
||||
? _value.confidence
|
||||
// ignore: cast_nullable_to_non_nullable
|
||||
: confidence as String,
|
||||
currency: currency == const $CopyWithPlaceholder()
|
||||
? _value.currency
|
||||
// ignore: cast_nullable_to_non_nullable
|
||||
: currency as String,
|
||||
dayGap: dayGap == const $CopyWithPlaceholder()
|
||||
? _value.dayGap
|
||||
// ignore: cast_nullable_to_non_nullable
|
||||
: dayGap as int,
|
||||
eventId: eventId == const $CopyWithPlaceholder()
|
||||
? _value.eventId
|
||||
// ignore: cast_nullable_to_non_nullable
|
||||
: eventId as int,
|
||||
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 String,
|
||||
note: note == const $CopyWithPlaceholder()
|
||||
? _value.note
|
||||
// ignore: cast_nullable_to_non_nullable
|
||||
: note as String?,
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
extension $LinkOutCopyWith on LinkOut {
|
||||
/// Returns a callable class that can be used as follows: `instanceOfLinkOut.copyWith(...)` or like so:`instanceOfLinkOut.copyWith.fieldName(...)`.
|
||||
// ignore: library_private_types_in_public_api
|
||||
_$LinkOutCWProxy get copyWith => _$LinkOutCWProxyImpl(this);
|
||||
}
|
||||
|
||||
// **************************************************************************
|
||||
// JsonSerializableGenerator
|
||||
// **************************************************************************
|
||||
|
||||
LinkOut _$LinkOutFromJson(Map<String, dynamic> json) => $checkedCreate(
|
||||
'LinkOut',
|
||||
json,
|
||||
($checkedConvert) {
|
||||
$checkKeys(
|
||||
json,
|
||||
requiredKeys: const [
|
||||
'amount_delta',
|
||||
'cash_txn_id',
|
||||
'confidence',
|
||||
'currency',
|
||||
'day_gap',
|
||||
'event_id',
|
||||
'id',
|
||||
'kind',
|
||||
'note',
|
||||
],
|
||||
);
|
||||
final val = LinkOut(
|
||||
amountDelta: $checkedConvert('amount_delta', (v) => v as String),
|
||||
cashTxnId: $checkedConvert('cash_txn_id', (v) => (v as num).toInt()),
|
||||
confidence: $checkedConvert('confidence', (v) => v as String),
|
||||
currency: $checkedConvert('currency', (v) => v as String),
|
||||
dayGap: $checkedConvert('day_gap', (v) => (v as num).toInt()),
|
||||
eventId: $checkedConvert('event_id', (v) => (v as num).toInt()),
|
||||
id: $checkedConvert('id', (v) => (v as num).toInt()),
|
||||
kind: $checkedConvert('kind', (v) => v as String),
|
||||
note: $checkedConvert('note', (v) => v as String?),
|
||||
);
|
||||
return val;
|
||||
},
|
||||
fieldKeyMap: const {
|
||||
'amountDelta': 'amount_delta',
|
||||
'cashTxnId': 'cash_txn_id',
|
||||
'dayGap': 'day_gap',
|
||||
'eventId': 'event_id',
|
||||
},
|
||||
);
|
||||
|
||||
Map<String, dynamic> _$LinkOutToJson(LinkOut instance) => <String, dynamic>{
|
||||
'amount_delta': instance.amountDelta,
|
||||
'cash_txn_id': instance.cashTxnId,
|
||||
'confidence': instance.confidence,
|
||||
'currency': instance.currency,
|
||||
'day_gap': instance.dayGap,
|
||||
'event_id': instance.eventId,
|
||||
'id': instance.id,
|
||||
'kind': instance.kind,
|
||||
'note': instance.note,
|
||||
};
|
||||
@@ -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 'new_instrument.g.dart';
|
||||
|
||||
|
||||
@CopyWith()
|
||||
@JsonSerializable(
|
||||
checked: true,
|
||||
createToJson: true,
|
||||
disallowUnrecognizedKeys: false,
|
||||
explicitToJson: true,
|
||||
)
|
||||
class NewInstrument {
|
||||
/// Returns a new [NewInstrument] instance.
|
||||
NewInstrument({
|
||||
|
||||
required this.assetClass,
|
||||
|
||||
this.board,
|
||||
|
||||
this.currency = 'RUB',
|
||||
|
||||
this.isin,
|
||||
|
||||
this.lot = 1,
|
||||
|
||||
required this.name,
|
||||
|
||||
this.ticker,
|
||||
});
|
||||
|
||||
@JsonKey(
|
||||
|
||||
name: r'asset_class',
|
||||
required: true,
|
||||
includeIfNull: false,
|
||||
)
|
||||
|
||||
|
||||
final String assetClass;
|
||||
|
||||
|
||||
|
||||
@JsonKey(
|
||||
|
||||
name: r'board',
|
||||
required: false,
|
||||
includeIfNull: false,
|
||||
)
|
||||
|
||||
|
||||
final String? board;
|
||||
|
||||
|
||||
|
||||
@JsonKey(
|
||||
defaultValue: 'RUB',
|
||||
name: r'currency',
|
||||
required: false,
|
||||
includeIfNull: false,
|
||||
)
|
||||
|
||||
|
||||
final String? currency;
|
||||
|
||||
|
||||
|
||||
@JsonKey(
|
||||
|
||||
name: r'isin',
|
||||
required: false,
|
||||
includeIfNull: false,
|
||||
)
|
||||
|
||||
|
||||
final String? isin;
|
||||
|
||||
|
||||
|
||||
@JsonKey(
|
||||
defaultValue: 1,
|
||||
name: r'lot',
|
||||
required: false,
|
||||
includeIfNull: false,
|
||||
)
|
||||
|
||||
|
||||
final int? lot;
|
||||
|
||||
|
||||
|
||||
@JsonKey(
|
||||
|
||||
name: r'name',
|
||||
required: true,
|
||||
includeIfNull: false,
|
||||
)
|
||||
|
||||
|
||||
final String name;
|
||||
|
||||
|
||||
|
||||
@JsonKey(
|
||||
|
||||
name: r'ticker',
|
||||
required: false,
|
||||
includeIfNull: false,
|
||||
)
|
||||
|
||||
|
||||
final String? ticker;
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
@override
|
||||
bool operator ==(Object other) => identical(this, other) || other is NewInstrument &&
|
||||
other.assetClass == assetClass &&
|
||||
other.board == board &&
|
||||
other.currency == currency &&
|
||||
other.isin == isin &&
|
||||
other.lot == lot &&
|
||||
other.name == name &&
|
||||
other.ticker == ticker;
|
||||
|
||||
@override
|
||||
int get hashCode =>
|
||||
assetClass.hashCode +
|
||||
(board == null ? 0 : board.hashCode) +
|
||||
currency.hashCode +
|
||||
(isin == null ? 0 : isin.hashCode) +
|
||||
lot.hashCode +
|
||||
name.hashCode +
|
||||
(ticker == null ? 0 : ticker.hashCode);
|
||||
|
||||
factory NewInstrument.fromJson(Map<String, dynamic> json) => _$NewInstrumentFromJson(json);
|
||||
|
||||
Map<String, dynamic> toJson() => _$NewInstrumentToJson(this);
|
||||
|
||||
@override
|
||||
String toString() {
|
||||
return toJson().toString();
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -0,0 +1,151 @@
|
||||
// GENERATED CODE - DO NOT MODIFY BY HAND
|
||||
|
||||
part of 'new_instrument.dart';
|
||||
|
||||
// **************************************************************************
|
||||
// CopyWithGenerator
|
||||
// **************************************************************************
|
||||
|
||||
abstract class _$NewInstrumentCWProxy {
|
||||
NewInstrument assetClass(String assetClass);
|
||||
|
||||
NewInstrument board(String? board);
|
||||
|
||||
NewInstrument currency(String? currency);
|
||||
|
||||
NewInstrument isin(String? isin);
|
||||
|
||||
NewInstrument lot(int? lot);
|
||||
|
||||
NewInstrument name(String name);
|
||||
|
||||
NewInstrument ticker(String? ticker);
|
||||
|
||||
/// This function **does support** nullification of nullable fields. All `null` values passed to `non-nullable` fields will be ignored. You can also use `NewInstrument(...).copyWith.fieldName(...)` to override fields one at a time with nullification support.
|
||||
///
|
||||
/// Usage
|
||||
/// ```dart
|
||||
/// NewInstrument(...).copyWith(id: 12, name: "My name")
|
||||
/// ````
|
||||
NewInstrument call({
|
||||
String assetClass,
|
||||
String? board,
|
||||
String? currency,
|
||||
String? isin,
|
||||
int? lot,
|
||||
String name,
|
||||
String? ticker,
|
||||
});
|
||||
}
|
||||
|
||||
/// Proxy class for `copyWith` functionality. This is a callable class and can be used as follows: `instanceOfNewInstrument.copyWith(...)`. Additionally contains functions for specific fields e.g. `instanceOfNewInstrument.copyWith.fieldName(...)`
|
||||
class _$NewInstrumentCWProxyImpl implements _$NewInstrumentCWProxy {
|
||||
const _$NewInstrumentCWProxyImpl(this._value);
|
||||
|
||||
final NewInstrument _value;
|
||||
|
||||
@override
|
||||
NewInstrument assetClass(String assetClass) => this(assetClass: assetClass);
|
||||
|
||||
@override
|
||||
NewInstrument board(String? board) => this(board: board);
|
||||
|
||||
@override
|
||||
NewInstrument currency(String? currency) => this(currency: currency);
|
||||
|
||||
@override
|
||||
NewInstrument isin(String? isin) => this(isin: isin);
|
||||
|
||||
@override
|
||||
NewInstrument lot(int? lot) => this(lot: lot);
|
||||
|
||||
@override
|
||||
NewInstrument name(String name) => this(name: name);
|
||||
|
||||
@override
|
||||
NewInstrument ticker(String? ticker) => this(ticker: ticker);
|
||||
|
||||
@override
|
||||
/// This function **does support** nullification of nullable fields. All `null` values passed to `non-nullable` fields will be ignored. You can also use `NewInstrument(...).copyWith.fieldName(...)` to override fields one at a time with nullification support.
|
||||
///
|
||||
/// Usage
|
||||
/// ```dart
|
||||
/// NewInstrument(...).copyWith(id: 12, name: "My name")
|
||||
/// ````
|
||||
NewInstrument call({
|
||||
Object? assetClass = const $CopyWithPlaceholder(),
|
||||
Object? board = const $CopyWithPlaceholder(),
|
||||
Object? currency = const $CopyWithPlaceholder(),
|
||||
Object? isin = const $CopyWithPlaceholder(),
|
||||
Object? lot = const $CopyWithPlaceholder(),
|
||||
Object? name = const $CopyWithPlaceholder(),
|
||||
Object? ticker = const $CopyWithPlaceholder(),
|
||||
}) {
|
||||
return NewInstrument(
|
||||
assetClass: assetClass == const $CopyWithPlaceholder()
|
||||
? _value.assetClass
|
||||
// ignore: cast_nullable_to_non_nullable
|
||||
: assetClass as String,
|
||||
board: board == const $CopyWithPlaceholder()
|
||||
? _value.board
|
||||
// ignore: cast_nullable_to_non_nullable
|
||||
: board as String?,
|
||||
currency: currency == const $CopyWithPlaceholder()
|
||||
? _value.currency
|
||||
// ignore: cast_nullable_to_non_nullable
|
||||
: currency as String?,
|
||||
isin: isin == const $CopyWithPlaceholder()
|
||||
? _value.isin
|
||||
// ignore: cast_nullable_to_non_nullable
|
||||
: isin as String?,
|
||||
lot: lot == const $CopyWithPlaceholder()
|
||||
? _value.lot
|
||||
// ignore: cast_nullable_to_non_nullable
|
||||
: lot as int?,
|
||||
name: name == const $CopyWithPlaceholder()
|
||||
? _value.name
|
||||
// ignore: cast_nullable_to_non_nullable
|
||||
: name as String,
|
||||
ticker: ticker == const $CopyWithPlaceholder()
|
||||
? _value.ticker
|
||||
// ignore: cast_nullable_to_non_nullable
|
||||
: ticker as String?,
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
extension $NewInstrumentCopyWith on NewInstrument {
|
||||
/// Returns a callable class that can be used as follows: `instanceOfNewInstrument.copyWith(...)` or like so:`instanceOfNewInstrument.copyWith.fieldName(...)`.
|
||||
// ignore: library_private_types_in_public_api
|
||||
_$NewInstrumentCWProxy get copyWith => _$NewInstrumentCWProxyImpl(this);
|
||||
}
|
||||
|
||||
// **************************************************************************
|
||||
// JsonSerializableGenerator
|
||||
// **************************************************************************
|
||||
|
||||
NewInstrument _$NewInstrumentFromJson(Map<String, dynamic> json) =>
|
||||
$checkedCreate('NewInstrument', json, ($checkedConvert) {
|
||||
$checkKeys(json, requiredKeys: const ['asset_class', 'name']);
|
||||
final val = NewInstrument(
|
||||
assetClass: $checkedConvert('asset_class', (v) => v as String),
|
||||
board: $checkedConvert('board', (v) => v as String?),
|
||||
currency: $checkedConvert('currency', (v) => v as String? ?? 'RUB'),
|
||||
isin: $checkedConvert('isin', (v) => v as String?),
|
||||
lot: $checkedConvert('lot', (v) => (v as num?)?.toInt() ?? 1),
|
||||
name: $checkedConvert('name', (v) => v as String),
|
||||
ticker: $checkedConvert('ticker', (v) => v as String?),
|
||||
);
|
||||
return val;
|
||||
}, fieldKeyMap: const {'assetClass': 'asset_class'});
|
||||
|
||||
Map<String, dynamic> _$NewInstrumentToJson(NewInstrument instance) =>
|
||||
<String, dynamic>{
|
||||
'asset_class': instance.assetClass,
|
||||
'board': ?instance.board,
|
||||
'currency': ?instance.currency,
|
||||
'isin': ?instance.isin,
|
||||
'lot': ?instance.lot,
|
||||
'name': instance.name,
|
||||
'ticker': ?instance.ticker,
|
||||
};
|
||||
@@ -0,0 +1,300 @@
|
||||
//
|
||||
// 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 'pending_instrument_out.g.dart';
|
||||
|
||||
|
||||
@CopyWith()
|
||||
@JsonSerializable(
|
||||
checked: true,
|
||||
createToJson: true,
|
||||
disallowUnrecognizedKeys: false,
|
||||
explicitToJson: true,
|
||||
)
|
||||
class PendingInstrumentOut {
|
||||
/// Returns a new [PendingInstrumentOut] instance.
|
||||
PendingInstrumentOut({
|
||||
|
||||
this.assetClassHint,
|
||||
|
||||
this.board,
|
||||
|
||||
this.createdAt,
|
||||
|
||||
this.currency,
|
||||
|
||||
this.firstSeenFileId,
|
||||
|
||||
required this.id,
|
||||
|
||||
this.instrumentId,
|
||||
|
||||
this.isin,
|
||||
|
||||
this.name,
|
||||
|
||||
required this.occurrences,
|
||||
|
||||
this.samplePrice,
|
||||
|
||||
this.sampleQuantity,
|
||||
|
||||
required this.source_,
|
||||
|
||||
required this.sourceKey,
|
||||
|
||||
required this.status,
|
||||
|
||||
this.ticker,
|
||||
});
|
||||
|
||||
@JsonKey(
|
||||
|
||||
name: r'asset_class_hint',
|
||||
required: false,
|
||||
includeIfNull: false,
|
||||
)
|
||||
|
||||
|
||||
final String? assetClassHint;
|
||||
|
||||
|
||||
|
||||
@JsonKey(
|
||||
|
||||
name: r'board',
|
||||
required: false,
|
||||
includeIfNull: false,
|
||||
)
|
||||
|
||||
|
||||
final String? board;
|
||||
|
||||
|
||||
|
||||
@JsonKey(
|
||||
|
||||
name: r'created_at',
|
||||
required: false,
|
||||
includeIfNull: false,
|
||||
)
|
||||
|
||||
|
||||
final DateTime? createdAt;
|
||||
|
||||
|
||||
|
||||
@JsonKey(
|
||||
|
||||
name: r'currency',
|
||||
required: false,
|
||||
includeIfNull: false,
|
||||
)
|
||||
|
||||
|
||||
final String? currency;
|
||||
|
||||
|
||||
|
||||
@JsonKey(
|
||||
|
||||
name: r'first_seen_file_id',
|
||||
required: false,
|
||||
includeIfNull: false,
|
||||
)
|
||||
|
||||
|
||||
final int? firstSeenFileId;
|
||||
|
||||
|
||||
|
||||
@JsonKey(
|
||||
|
||||
name: r'id',
|
||||
required: true,
|
||||
includeIfNull: false,
|
||||
)
|
||||
|
||||
|
||||
final int id;
|
||||
|
||||
|
||||
|
||||
@JsonKey(
|
||||
|
||||
name: r'instrument_id',
|
||||
required: false,
|
||||
includeIfNull: false,
|
||||
)
|
||||
|
||||
|
||||
final int? instrumentId;
|
||||
|
||||
|
||||
|
||||
@JsonKey(
|
||||
|
||||
name: r'isin',
|
||||
required: false,
|
||||
includeIfNull: false,
|
||||
)
|
||||
|
||||
|
||||
final String? isin;
|
||||
|
||||
|
||||
|
||||
@JsonKey(
|
||||
|
||||
name: r'name',
|
||||
required: false,
|
||||
includeIfNull: false,
|
||||
)
|
||||
|
||||
|
||||
final String? name;
|
||||
|
||||
|
||||
|
||||
@JsonKey(
|
||||
|
||||
name: r'occurrences',
|
||||
required: true,
|
||||
includeIfNull: false,
|
||||
)
|
||||
|
||||
|
||||
final int occurrences;
|
||||
|
||||
|
||||
|
||||
/// decimal as string
|
||||
@JsonKey(
|
||||
|
||||
name: r'sample_price',
|
||||
required: false,
|
||||
includeIfNull: false,
|
||||
)
|
||||
|
||||
|
||||
final String? samplePrice;
|
||||
|
||||
|
||||
|
||||
/// decimal as string
|
||||
@JsonKey(
|
||||
|
||||
name: r'sample_quantity',
|
||||
required: false,
|
||||
includeIfNull: false,
|
||||
)
|
||||
|
||||
|
||||
final String? sampleQuantity;
|
||||
|
||||
|
||||
|
||||
@JsonKey(
|
||||
|
||||
name: r'source',
|
||||
required: true,
|
||||
includeIfNull: false,
|
||||
)
|
||||
|
||||
|
||||
final String source_;
|
||||
|
||||
|
||||
|
||||
@JsonKey(
|
||||
|
||||
name: r'source_key',
|
||||
required: true,
|
||||
includeIfNull: false,
|
||||
)
|
||||
|
||||
|
||||
final String sourceKey;
|
||||
|
||||
|
||||
|
||||
@JsonKey(
|
||||
|
||||
name: r'status',
|
||||
required: true,
|
||||
includeIfNull: false,
|
||||
)
|
||||
|
||||
|
||||
final String status;
|
||||
|
||||
|
||||
|
||||
@JsonKey(
|
||||
|
||||
name: r'ticker',
|
||||
required: false,
|
||||
includeIfNull: false,
|
||||
)
|
||||
|
||||
|
||||
final String? ticker;
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
@override
|
||||
bool operator ==(Object other) => identical(this, other) || other is PendingInstrumentOut &&
|
||||
other.assetClassHint == assetClassHint &&
|
||||
other.board == board &&
|
||||
other.createdAt == createdAt &&
|
||||
other.currency == currency &&
|
||||
other.firstSeenFileId == firstSeenFileId &&
|
||||
other.id == id &&
|
||||
other.instrumentId == instrumentId &&
|
||||
other.isin == isin &&
|
||||
other.name == name &&
|
||||
other.occurrences == occurrences &&
|
||||
other.samplePrice == samplePrice &&
|
||||
other.sampleQuantity == sampleQuantity &&
|
||||
other.source_ == source_ &&
|
||||
other.sourceKey == sourceKey &&
|
||||
other.status == status &&
|
||||
other.ticker == ticker;
|
||||
|
||||
@override
|
||||
int get hashCode =>
|
||||
(assetClassHint == null ? 0 : assetClassHint.hashCode) +
|
||||
(board == null ? 0 : board.hashCode) +
|
||||
(createdAt == null ? 0 : createdAt.hashCode) +
|
||||
(currency == null ? 0 : currency.hashCode) +
|
||||
(firstSeenFileId == null ? 0 : firstSeenFileId.hashCode) +
|
||||
id.hashCode +
|
||||
(instrumentId == null ? 0 : instrumentId.hashCode) +
|
||||
(isin == null ? 0 : isin.hashCode) +
|
||||
(name == null ? 0 : name.hashCode) +
|
||||
occurrences.hashCode +
|
||||
(samplePrice == null ? 0 : samplePrice.hashCode) +
|
||||
(sampleQuantity == null ? 0 : sampleQuantity.hashCode) +
|
||||
source_.hashCode +
|
||||
sourceKey.hashCode +
|
||||
status.hashCode +
|
||||
(ticker == null ? 0 : ticker.hashCode);
|
||||
|
||||
factory PendingInstrumentOut.fromJson(Map<String, dynamic> json) => _$PendingInstrumentOutFromJson(json);
|
||||
|
||||
Map<String, dynamic> toJson() => _$PendingInstrumentOutToJson(this);
|
||||
|
||||
@override
|
||||
String toString() {
|
||||
return toJson().toString();
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -0,0 +1,312 @@
|
||||
// GENERATED CODE - DO NOT MODIFY BY HAND
|
||||
|
||||
part of 'pending_instrument_out.dart';
|
||||
|
||||
// **************************************************************************
|
||||
// CopyWithGenerator
|
||||
// **************************************************************************
|
||||
|
||||
abstract class _$PendingInstrumentOutCWProxy {
|
||||
PendingInstrumentOut assetClassHint(String? assetClassHint);
|
||||
|
||||
PendingInstrumentOut board(String? board);
|
||||
|
||||
PendingInstrumentOut createdAt(DateTime? createdAt);
|
||||
|
||||
PendingInstrumentOut currency(String? currency);
|
||||
|
||||
PendingInstrumentOut firstSeenFileId(int? firstSeenFileId);
|
||||
|
||||
PendingInstrumentOut id(int id);
|
||||
|
||||
PendingInstrumentOut instrumentId(int? instrumentId);
|
||||
|
||||
PendingInstrumentOut isin(String? isin);
|
||||
|
||||
PendingInstrumentOut name(String? name);
|
||||
|
||||
PendingInstrumentOut occurrences(int occurrences);
|
||||
|
||||
PendingInstrumentOut samplePrice(String? samplePrice);
|
||||
|
||||
PendingInstrumentOut sampleQuantity(String? sampleQuantity);
|
||||
|
||||
PendingInstrumentOut source_(String source_);
|
||||
|
||||
PendingInstrumentOut sourceKey(String sourceKey);
|
||||
|
||||
PendingInstrumentOut status(String status);
|
||||
|
||||
PendingInstrumentOut ticker(String? ticker);
|
||||
|
||||
/// This function **does support** nullification of nullable fields. All `null` values passed to `non-nullable` fields will be ignored. You can also use `PendingInstrumentOut(...).copyWith.fieldName(...)` to override fields one at a time with nullification support.
|
||||
///
|
||||
/// Usage
|
||||
/// ```dart
|
||||
/// PendingInstrumentOut(...).copyWith(id: 12, name: "My name")
|
||||
/// ````
|
||||
PendingInstrumentOut call({
|
||||
String? assetClassHint,
|
||||
String? board,
|
||||
DateTime? createdAt,
|
||||
String? currency,
|
||||
int? firstSeenFileId,
|
||||
int id,
|
||||
int? instrumentId,
|
||||
String? isin,
|
||||
String? name,
|
||||
int occurrences,
|
||||
String? samplePrice,
|
||||
String? sampleQuantity,
|
||||
String source_,
|
||||
String sourceKey,
|
||||
String status,
|
||||
String? ticker,
|
||||
});
|
||||
}
|
||||
|
||||
/// Proxy class for `copyWith` functionality. This is a callable class and can be used as follows: `instanceOfPendingInstrumentOut.copyWith(...)`. Additionally contains functions for specific fields e.g. `instanceOfPendingInstrumentOut.copyWith.fieldName(...)`
|
||||
class _$PendingInstrumentOutCWProxyImpl
|
||||
implements _$PendingInstrumentOutCWProxy {
|
||||
const _$PendingInstrumentOutCWProxyImpl(this._value);
|
||||
|
||||
final PendingInstrumentOut _value;
|
||||
|
||||
@override
|
||||
PendingInstrumentOut assetClassHint(String? assetClassHint) =>
|
||||
this(assetClassHint: assetClassHint);
|
||||
|
||||
@override
|
||||
PendingInstrumentOut board(String? board) => this(board: board);
|
||||
|
||||
@override
|
||||
PendingInstrumentOut createdAt(DateTime? createdAt) =>
|
||||
this(createdAt: createdAt);
|
||||
|
||||
@override
|
||||
PendingInstrumentOut currency(String? currency) => this(currency: currency);
|
||||
|
||||
@override
|
||||
PendingInstrumentOut firstSeenFileId(int? firstSeenFileId) =>
|
||||
this(firstSeenFileId: firstSeenFileId);
|
||||
|
||||
@override
|
||||
PendingInstrumentOut id(int id) => this(id: id);
|
||||
|
||||
@override
|
||||
PendingInstrumentOut instrumentId(int? instrumentId) =>
|
||||
this(instrumentId: instrumentId);
|
||||
|
||||
@override
|
||||
PendingInstrumentOut isin(String? isin) => this(isin: isin);
|
||||
|
||||
@override
|
||||
PendingInstrumentOut name(String? name) => this(name: name);
|
||||
|
||||
@override
|
||||
PendingInstrumentOut occurrences(int occurrences) =>
|
||||
this(occurrences: occurrences);
|
||||
|
||||
@override
|
||||
PendingInstrumentOut samplePrice(String? samplePrice) =>
|
||||
this(samplePrice: samplePrice);
|
||||
|
||||
@override
|
||||
PendingInstrumentOut sampleQuantity(String? sampleQuantity) =>
|
||||
this(sampleQuantity: sampleQuantity);
|
||||
|
||||
@override
|
||||
PendingInstrumentOut source_(String source_) => this(source_: source_);
|
||||
|
||||
@override
|
||||
PendingInstrumentOut sourceKey(String sourceKey) =>
|
||||
this(sourceKey: sourceKey);
|
||||
|
||||
@override
|
||||
PendingInstrumentOut status(String status) => this(status: status);
|
||||
|
||||
@override
|
||||
PendingInstrumentOut ticker(String? ticker) => this(ticker: ticker);
|
||||
|
||||
@override
|
||||
/// This function **does support** nullification of nullable fields. All `null` values passed to `non-nullable` fields will be ignored. You can also use `PendingInstrumentOut(...).copyWith.fieldName(...)` to override fields one at a time with nullification support.
|
||||
///
|
||||
/// Usage
|
||||
/// ```dart
|
||||
/// PendingInstrumentOut(...).copyWith(id: 12, name: "My name")
|
||||
/// ````
|
||||
PendingInstrumentOut call({
|
||||
Object? assetClassHint = const $CopyWithPlaceholder(),
|
||||
Object? board = const $CopyWithPlaceholder(),
|
||||
Object? createdAt = const $CopyWithPlaceholder(),
|
||||
Object? currency = const $CopyWithPlaceholder(),
|
||||
Object? firstSeenFileId = const $CopyWithPlaceholder(),
|
||||
Object? id = const $CopyWithPlaceholder(),
|
||||
Object? instrumentId = const $CopyWithPlaceholder(),
|
||||
Object? isin = const $CopyWithPlaceholder(),
|
||||
Object? name = const $CopyWithPlaceholder(),
|
||||
Object? occurrences = const $CopyWithPlaceholder(),
|
||||
Object? samplePrice = const $CopyWithPlaceholder(),
|
||||
Object? sampleQuantity = const $CopyWithPlaceholder(),
|
||||
Object? source_ = const $CopyWithPlaceholder(),
|
||||
Object? sourceKey = const $CopyWithPlaceholder(),
|
||||
Object? status = const $CopyWithPlaceholder(),
|
||||
Object? ticker = const $CopyWithPlaceholder(),
|
||||
}) {
|
||||
return PendingInstrumentOut(
|
||||
assetClassHint: assetClassHint == const $CopyWithPlaceholder()
|
||||
? _value.assetClassHint
|
||||
// ignore: cast_nullable_to_non_nullable
|
||||
: assetClassHint as String?,
|
||||
board: board == const $CopyWithPlaceholder()
|
||||
? _value.board
|
||||
// ignore: cast_nullable_to_non_nullable
|
||||
: board as String?,
|
||||
createdAt: createdAt == const $CopyWithPlaceholder()
|
||||
? _value.createdAt
|
||||
// ignore: cast_nullable_to_non_nullable
|
||||
: createdAt as DateTime?,
|
||||
currency: currency == const $CopyWithPlaceholder()
|
||||
? _value.currency
|
||||
// ignore: cast_nullable_to_non_nullable
|
||||
: currency as String?,
|
||||
firstSeenFileId: firstSeenFileId == const $CopyWithPlaceholder()
|
||||
? _value.firstSeenFileId
|
||||
// ignore: cast_nullable_to_non_nullable
|
||||
: firstSeenFileId as int?,
|
||||
id: id == const $CopyWithPlaceholder()
|
||||
? _value.id
|
||||
// ignore: cast_nullable_to_non_nullable
|
||||
: id as int,
|
||||
instrumentId: instrumentId == const $CopyWithPlaceholder()
|
||||
? _value.instrumentId
|
||||
// ignore: cast_nullable_to_non_nullable
|
||||
: instrumentId as int?,
|
||||
isin: isin == const $CopyWithPlaceholder()
|
||||
? _value.isin
|
||||
// ignore: cast_nullable_to_non_nullable
|
||||
: isin as String?,
|
||||
name: name == const $CopyWithPlaceholder()
|
||||
? _value.name
|
||||
// ignore: cast_nullable_to_non_nullable
|
||||
: name as String?,
|
||||
occurrences: occurrences == const $CopyWithPlaceholder()
|
||||
? _value.occurrences
|
||||
// ignore: cast_nullable_to_non_nullable
|
||||
: occurrences as int,
|
||||
samplePrice: samplePrice == const $CopyWithPlaceholder()
|
||||
? _value.samplePrice
|
||||
// ignore: cast_nullable_to_non_nullable
|
||||
: samplePrice as String?,
|
||||
sampleQuantity: sampleQuantity == const $CopyWithPlaceholder()
|
||||
? _value.sampleQuantity
|
||||
// ignore: cast_nullable_to_non_nullable
|
||||
: sampleQuantity as String?,
|
||||
source_: source_ == const $CopyWithPlaceholder()
|
||||
? _value.source_
|
||||
// ignore: cast_nullable_to_non_nullable
|
||||
: source_ as String,
|
||||
sourceKey: sourceKey == const $CopyWithPlaceholder()
|
||||
? _value.sourceKey
|
||||
// ignore: cast_nullable_to_non_nullable
|
||||
: sourceKey as String,
|
||||
status: status == const $CopyWithPlaceholder()
|
||||
? _value.status
|
||||
// ignore: cast_nullable_to_non_nullable
|
||||
: status as String,
|
||||
ticker: ticker == const $CopyWithPlaceholder()
|
||||
? _value.ticker
|
||||
// ignore: cast_nullable_to_non_nullable
|
||||
: ticker as String?,
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
extension $PendingInstrumentOutCopyWith on PendingInstrumentOut {
|
||||
/// Returns a callable class that can be used as follows: `instanceOfPendingInstrumentOut.copyWith(...)` or like so:`instanceOfPendingInstrumentOut.copyWith.fieldName(...)`.
|
||||
// ignore: library_private_types_in_public_api
|
||||
_$PendingInstrumentOutCWProxy get copyWith =>
|
||||
_$PendingInstrumentOutCWProxyImpl(this);
|
||||
}
|
||||
|
||||
// **************************************************************************
|
||||
// JsonSerializableGenerator
|
||||
// **************************************************************************
|
||||
|
||||
PendingInstrumentOut _$PendingInstrumentOutFromJson(
|
||||
Map<String, dynamic> json,
|
||||
) => $checkedCreate(
|
||||
'PendingInstrumentOut',
|
||||
json,
|
||||
($checkedConvert) {
|
||||
$checkKeys(
|
||||
json,
|
||||
requiredKeys: const [
|
||||
'id',
|
||||
'occurrences',
|
||||
'source',
|
||||
'source_key',
|
||||
'status',
|
||||
],
|
||||
);
|
||||
final val = PendingInstrumentOut(
|
||||
assetClassHint: $checkedConvert('asset_class_hint', (v) => v as String?),
|
||||
board: $checkedConvert('board', (v) => v as String?),
|
||||
createdAt: $checkedConvert(
|
||||
'created_at',
|
||||
(v) => v == null ? null : DateTime.parse(v as String),
|
||||
),
|
||||
currency: $checkedConvert('currency', (v) => v as String?),
|
||||
firstSeenFileId: $checkedConvert(
|
||||
'first_seen_file_id',
|
||||
(v) => (v as num?)?.toInt(),
|
||||
),
|
||||
id: $checkedConvert('id', (v) => (v as num).toInt()),
|
||||
instrumentId: $checkedConvert(
|
||||
'instrument_id',
|
||||
(v) => (v as num?)?.toInt(),
|
||||
),
|
||||
isin: $checkedConvert('isin', (v) => v as String?),
|
||||
name: $checkedConvert('name', (v) => v as String?),
|
||||
occurrences: $checkedConvert('occurrences', (v) => (v as num).toInt()),
|
||||
samplePrice: $checkedConvert('sample_price', (v) => v as String?),
|
||||
sampleQuantity: $checkedConvert('sample_quantity', (v) => v as String?),
|
||||
source_: $checkedConvert('source', (v) => v as String),
|
||||
sourceKey: $checkedConvert('source_key', (v) => v as String),
|
||||
status: $checkedConvert('status', (v) => v as String),
|
||||
ticker: $checkedConvert('ticker', (v) => v as String?),
|
||||
);
|
||||
return val;
|
||||
},
|
||||
fieldKeyMap: const {
|
||||
'assetClassHint': 'asset_class_hint',
|
||||
'createdAt': 'created_at',
|
||||
'firstSeenFileId': 'first_seen_file_id',
|
||||
'instrumentId': 'instrument_id',
|
||||
'samplePrice': 'sample_price',
|
||||
'sampleQuantity': 'sample_quantity',
|
||||
'source_': 'source',
|
||||
'sourceKey': 'source_key',
|
||||
},
|
||||
);
|
||||
|
||||
Map<String, dynamic> _$PendingInstrumentOutToJson(
|
||||
PendingInstrumentOut instance,
|
||||
) => <String, dynamic>{
|
||||
'asset_class_hint': ?instance.assetClassHint,
|
||||
'board': ?instance.board,
|
||||
'created_at': ?instance.createdAt?.toIso8601String(),
|
||||
'currency': ?instance.currency,
|
||||
'first_seen_file_id': ?instance.firstSeenFileId,
|
||||
'id': instance.id,
|
||||
'instrument_id': ?instance.instrumentId,
|
||||
'isin': ?instance.isin,
|
||||
'name': ?instance.name,
|
||||
'occurrences': instance.occurrences,
|
||||
'sample_price': ?instance.samplePrice,
|
||||
'sample_quantity': ?instance.sampleQuantity,
|
||||
'source': instance.source_,
|
||||
'source_key': instance.sourceKey,
|
||||
'status': instance.status,
|
||||
'ticker': ?instance.ticker,
|
||||
};
|
||||
@@ -0,0 +1,111 @@
|
||||
//
|
||||
// AUTO-GENERATED FILE, DO NOT MODIFY!
|
||||
//
|
||||
|
||||
// ignore_for_file: unused_element
|
||||
import 'package:fintracker_api/src/model/new_instrument.dart';
|
||||
import 'package:copy_with_extension/copy_with_extension.dart';
|
||||
import 'package:json_annotation/json_annotation.dart';
|
||||
|
||||
part 'pending_resolve_request.g.dart';
|
||||
|
||||
|
||||
@CopyWith()
|
||||
@JsonSerializable(
|
||||
checked: true,
|
||||
createToJson: true,
|
||||
disallowUnrecognizedKeys: false,
|
||||
explicitToJson: true,
|
||||
)
|
||||
class PendingResolveRequest {
|
||||
/// Returns a new [PendingResolveRequest] instance.
|
||||
PendingResolveRequest({
|
||||
|
||||
required this.action,
|
||||
|
||||
this.instrument,
|
||||
|
||||
this.instrumentId,
|
||||
});
|
||||
|
||||
@JsonKey(
|
||||
|
||||
name: r'action',
|
||||
required: true,
|
||||
includeIfNull: false,
|
||||
unknownEnumValue: PendingResolveRequestActionEnum.unknownDefaultOpenApi,
|
||||
)
|
||||
|
||||
|
||||
final PendingResolveRequestActionEnum action;
|
||||
|
||||
|
||||
|
||||
@JsonKey(
|
||||
|
||||
name: r'instrument',
|
||||
required: false,
|
||||
includeIfNull: false,
|
||||
)
|
||||
|
||||
|
||||
final NewInstrument? instrument;
|
||||
|
||||
|
||||
|
||||
@JsonKey(
|
||||
|
||||
name: r'instrument_id',
|
||||
required: false,
|
||||
includeIfNull: false,
|
||||
)
|
||||
|
||||
|
||||
final int? instrumentId;
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
@override
|
||||
bool operator ==(Object other) => identical(this, other) || other is PendingResolveRequest &&
|
||||
other.action == action &&
|
||||
other.instrument == instrument &&
|
||||
other.instrumentId == instrumentId;
|
||||
|
||||
@override
|
||||
int get hashCode =>
|
||||
action.hashCode +
|
||||
(instrument == null ? 0 : instrument.hashCode) +
|
||||
(instrumentId == null ? 0 : instrumentId.hashCode);
|
||||
|
||||
factory PendingResolveRequest.fromJson(Map<String, dynamic> json) => _$PendingResolveRequestFromJson(json);
|
||||
|
||||
Map<String, dynamic> toJson() => _$PendingResolveRequestToJson(this);
|
||||
|
||||
@override
|
||||
String toString() {
|
||||
return toJson().toString();
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
enum PendingResolveRequestActionEnum {
|
||||
@JsonValue(r'link')
|
||||
link(r'link'),
|
||||
@JsonValue(r'create')
|
||||
create(r'create'),
|
||||
@JsonValue(r'ignore')
|
||||
ignore(r'ignore'),
|
||||
@JsonValue(r'unknown_default_open_api')
|
||||
unknownDefaultOpenApi(r'unknown_default_open_api');
|
||||
|
||||
const PendingResolveRequestActionEnum(this.value);
|
||||
|
||||
final String value;
|
||||
|
||||
@override
|
||||
String toString() => value;
|
||||
}
|
||||
|
||||
|
||||
@@ -0,0 +1,125 @@
|
||||
// GENERATED CODE - DO NOT MODIFY BY HAND
|
||||
|
||||
part of 'pending_resolve_request.dart';
|
||||
|
||||
// **************************************************************************
|
||||
// CopyWithGenerator
|
||||
// **************************************************************************
|
||||
|
||||
abstract class _$PendingResolveRequestCWProxy {
|
||||
PendingResolveRequest action(PendingResolveRequestActionEnum action);
|
||||
|
||||
PendingResolveRequest instrument(NewInstrument? instrument);
|
||||
|
||||
PendingResolveRequest instrumentId(int? instrumentId);
|
||||
|
||||
/// This function **does support** nullification of nullable fields. All `null` values passed to `non-nullable` fields will be ignored. You can also use `PendingResolveRequest(...).copyWith.fieldName(...)` to override fields one at a time with nullification support.
|
||||
///
|
||||
/// Usage
|
||||
/// ```dart
|
||||
/// PendingResolveRequest(...).copyWith(id: 12, name: "My name")
|
||||
/// ````
|
||||
PendingResolveRequest call({
|
||||
PendingResolveRequestActionEnum action,
|
||||
NewInstrument? instrument,
|
||||
int? instrumentId,
|
||||
});
|
||||
}
|
||||
|
||||
/// Proxy class for `copyWith` functionality. This is a callable class and can be used as follows: `instanceOfPendingResolveRequest.copyWith(...)`. Additionally contains functions for specific fields e.g. `instanceOfPendingResolveRequest.copyWith.fieldName(...)`
|
||||
class _$PendingResolveRequestCWProxyImpl
|
||||
implements _$PendingResolveRequestCWProxy {
|
||||
const _$PendingResolveRequestCWProxyImpl(this._value);
|
||||
|
||||
final PendingResolveRequest _value;
|
||||
|
||||
@override
|
||||
PendingResolveRequest action(PendingResolveRequestActionEnum action) =>
|
||||
this(action: action);
|
||||
|
||||
@override
|
||||
PendingResolveRequest instrument(NewInstrument? instrument) =>
|
||||
this(instrument: instrument);
|
||||
|
||||
@override
|
||||
PendingResolveRequest instrumentId(int? instrumentId) =>
|
||||
this(instrumentId: instrumentId);
|
||||
|
||||
@override
|
||||
/// This function **does support** nullification of nullable fields. All `null` values passed to `non-nullable` fields will be ignored. You can also use `PendingResolveRequest(...).copyWith.fieldName(...)` to override fields one at a time with nullification support.
|
||||
///
|
||||
/// Usage
|
||||
/// ```dart
|
||||
/// PendingResolveRequest(...).copyWith(id: 12, name: "My name")
|
||||
/// ````
|
||||
PendingResolveRequest call({
|
||||
Object? action = const $CopyWithPlaceholder(),
|
||||
Object? instrument = const $CopyWithPlaceholder(),
|
||||
Object? instrumentId = const $CopyWithPlaceholder(),
|
||||
}) {
|
||||
return PendingResolveRequest(
|
||||
action: action == const $CopyWithPlaceholder()
|
||||
? _value.action
|
||||
// ignore: cast_nullable_to_non_nullable
|
||||
: action as PendingResolveRequestActionEnum,
|
||||
instrument: instrument == const $CopyWithPlaceholder()
|
||||
? _value.instrument
|
||||
// ignore: cast_nullable_to_non_nullable
|
||||
: instrument as NewInstrument?,
|
||||
instrumentId: instrumentId == const $CopyWithPlaceholder()
|
||||
? _value.instrumentId
|
||||
// ignore: cast_nullable_to_non_nullable
|
||||
: instrumentId as int?,
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
extension $PendingResolveRequestCopyWith on PendingResolveRequest {
|
||||
/// Returns a callable class that can be used as follows: `instanceOfPendingResolveRequest.copyWith(...)` or like so:`instanceOfPendingResolveRequest.copyWith.fieldName(...)`.
|
||||
// ignore: library_private_types_in_public_api
|
||||
_$PendingResolveRequestCWProxy get copyWith =>
|
||||
_$PendingResolveRequestCWProxyImpl(this);
|
||||
}
|
||||
|
||||
// **************************************************************************
|
||||
// JsonSerializableGenerator
|
||||
// **************************************************************************
|
||||
|
||||
PendingResolveRequest _$PendingResolveRequestFromJson(
|
||||
Map<String, dynamic> json,
|
||||
) => $checkedCreate('PendingResolveRequest', json, ($checkedConvert) {
|
||||
$checkKeys(json, requiredKeys: const ['action']);
|
||||
final val = PendingResolveRequest(
|
||||
action: $checkedConvert(
|
||||
'action',
|
||||
(v) => $enumDecode(
|
||||
_$PendingResolveRequestActionEnumEnumMap,
|
||||
v,
|
||||
unknownValue: PendingResolveRequestActionEnum.unknownDefaultOpenApi,
|
||||
),
|
||||
),
|
||||
instrument: $checkedConvert(
|
||||
'instrument',
|
||||
(v) =>
|
||||
v == null ? null : NewInstrument.fromJson(v as Map<String, dynamic>),
|
||||
),
|
||||
instrumentId: $checkedConvert('instrument_id', (v) => (v as num?)?.toInt()),
|
||||
);
|
||||
return val;
|
||||
}, fieldKeyMap: const {'instrumentId': 'instrument_id'});
|
||||
|
||||
Map<String, dynamic> _$PendingResolveRequestToJson(
|
||||
PendingResolveRequest instance,
|
||||
) => <String, dynamic>{
|
||||
'action': _$PendingResolveRequestActionEnumEnumMap[instance.action]!,
|
||||
'instrument': ?instance.instrument?.toJson(),
|
||||
'instrument_id': ?instance.instrumentId,
|
||||
};
|
||||
|
||||
const _$PendingResolveRequestActionEnumEnumMap = {
|
||||
PendingResolveRequestActionEnum.link: 'link',
|
||||
PendingResolveRequestActionEnum.create: 'create',
|
||||
PendingResolveRequestActionEnum.ignore: 'ignore',
|
||||
PendingResolveRequestActionEnum.unknownDefaultOpenApi:
|
||||
'unknown_default_open_api',
|
||||
};
|
||||
@@ -0,0 +1,138 @@
|
||||
//
|
||||
// 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 'pending_resolve_result.g.dart';
|
||||
|
||||
|
||||
@CopyWith()
|
||||
@JsonSerializable(
|
||||
checked: true,
|
||||
createToJson: true,
|
||||
disallowUnrecognizedKeys: false,
|
||||
explicitToJson: true,
|
||||
)
|
||||
class PendingResolveResult {
|
||||
/// Returns a new [PendingResolveResult] instance.
|
||||
PendingResolveResult({
|
||||
|
||||
required this.aliasCreated,
|
||||
|
||||
required this.eventsBound,
|
||||
|
||||
required this.id,
|
||||
|
||||
this.instrumentId,
|
||||
|
||||
required this.metricsRefreshed,
|
||||
|
||||
required this.status,
|
||||
});
|
||||
|
||||
@JsonKey(
|
||||
|
||||
name: r'alias_created',
|
||||
required: true,
|
||||
includeIfNull: false,
|
||||
)
|
||||
|
||||
|
||||
final bool aliasCreated;
|
||||
|
||||
|
||||
|
||||
@JsonKey(
|
||||
|
||||
name: r'events_bound',
|
||||
required: true,
|
||||
includeIfNull: false,
|
||||
)
|
||||
|
||||
|
||||
final int eventsBound;
|
||||
|
||||
|
||||
|
||||
@JsonKey(
|
||||
|
||||
name: r'id',
|
||||
required: true,
|
||||
includeIfNull: false,
|
||||
)
|
||||
|
||||
|
||||
final int id;
|
||||
|
||||
|
||||
|
||||
@JsonKey(
|
||||
|
||||
name: r'instrument_id',
|
||||
required: false,
|
||||
includeIfNull: false,
|
||||
)
|
||||
|
||||
|
||||
final int? instrumentId;
|
||||
|
||||
|
||||
|
||||
@JsonKey(
|
||||
|
||||
name: r'metrics_refreshed',
|
||||
required: true,
|
||||
includeIfNull: false,
|
||||
)
|
||||
|
||||
|
||||
final bool metricsRefreshed;
|
||||
|
||||
|
||||
|
||||
@JsonKey(
|
||||
|
||||
name: r'status',
|
||||
required: true,
|
||||
includeIfNull: false,
|
||||
)
|
||||
|
||||
|
||||
final String status;
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
@override
|
||||
bool operator ==(Object other) => identical(this, other) || other is PendingResolveResult &&
|
||||
other.aliasCreated == aliasCreated &&
|
||||
other.eventsBound == eventsBound &&
|
||||
other.id == id &&
|
||||
other.instrumentId == instrumentId &&
|
||||
other.metricsRefreshed == metricsRefreshed &&
|
||||
other.status == status;
|
||||
|
||||
@override
|
||||
int get hashCode =>
|
||||
aliasCreated.hashCode +
|
||||
eventsBound.hashCode +
|
||||
id.hashCode +
|
||||
(instrumentId == null ? 0 : instrumentId.hashCode) +
|
||||
metricsRefreshed.hashCode +
|
||||
status.hashCode;
|
||||
|
||||
factory PendingResolveResult.fromJson(Map<String, dynamic> json) => _$PendingResolveResultFromJson(json);
|
||||
|
||||
Map<String, dynamic> toJson() => _$PendingResolveResultToJson(this);
|
||||
|
||||
@override
|
||||
String toString() {
|
||||
return toJson().toString();
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -0,0 +1,168 @@
|
||||
// GENERATED CODE - DO NOT MODIFY BY HAND
|
||||
|
||||
part of 'pending_resolve_result.dart';
|
||||
|
||||
// **************************************************************************
|
||||
// CopyWithGenerator
|
||||
// **************************************************************************
|
||||
|
||||
abstract class _$PendingResolveResultCWProxy {
|
||||
PendingResolveResult aliasCreated(bool aliasCreated);
|
||||
|
||||
PendingResolveResult eventsBound(int eventsBound);
|
||||
|
||||
PendingResolveResult id(int id);
|
||||
|
||||
PendingResolveResult instrumentId(int? instrumentId);
|
||||
|
||||
PendingResolveResult metricsRefreshed(bool metricsRefreshed);
|
||||
|
||||
PendingResolveResult status(String status);
|
||||
|
||||
/// This function **does support** nullification of nullable fields. All `null` values passed to `non-nullable` fields will be ignored. You can also use `PendingResolveResult(...).copyWith.fieldName(...)` to override fields one at a time with nullification support.
|
||||
///
|
||||
/// Usage
|
||||
/// ```dart
|
||||
/// PendingResolveResult(...).copyWith(id: 12, name: "My name")
|
||||
/// ````
|
||||
PendingResolveResult call({
|
||||
bool aliasCreated,
|
||||
int eventsBound,
|
||||
int id,
|
||||
int? instrumentId,
|
||||
bool metricsRefreshed,
|
||||
String status,
|
||||
});
|
||||
}
|
||||
|
||||
/// Proxy class for `copyWith` functionality. This is a callable class and can be used as follows: `instanceOfPendingResolveResult.copyWith(...)`. Additionally contains functions for specific fields e.g. `instanceOfPendingResolveResult.copyWith.fieldName(...)`
|
||||
class _$PendingResolveResultCWProxyImpl
|
||||
implements _$PendingResolveResultCWProxy {
|
||||
const _$PendingResolveResultCWProxyImpl(this._value);
|
||||
|
||||
final PendingResolveResult _value;
|
||||
|
||||
@override
|
||||
PendingResolveResult aliasCreated(bool aliasCreated) =>
|
||||
this(aliasCreated: aliasCreated);
|
||||
|
||||
@override
|
||||
PendingResolveResult eventsBound(int eventsBound) =>
|
||||
this(eventsBound: eventsBound);
|
||||
|
||||
@override
|
||||
PendingResolveResult id(int id) => this(id: id);
|
||||
|
||||
@override
|
||||
PendingResolveResult instrumentId(int? instrumentId) =>
|
||||
this(instrumentId: instrumentId);
|
||||
|
||||
@override
|
||||
PendingResolveResult metricsRefreshed(bool metricsRefreshed) =>
|
||||
this(metricsRefreshed: metricsRefreshed);
|
||||
|
||||
@override
|
||||
PendingResolveResult status(String 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 `PendingResolveResult(...).copyWith.fieldName(...)` to override fields one at a time with nullification support.
|
||||
///
|
||||
/// Usage
|
||||
/// ```dart
|
||||
/// PendingResolveResult(...).copyWith(id: 12, name: "My name")
|
||||
/// ````
|
||||
PendingResolveResult call({
|
||||
Object? aliasCreated = const $CopyWithPlaceholder(),
|
||||
Object? eventsBound = const $CopyWithPlaceholder(),
|
||||
Object? id = const $CopyWithPlaceholder(),
|
||||
Object? instrumentId = const $CopyWithPlaceholder(),
|
||||
Object? metricsRefreshed = const $CopyWithPlaceholder(),
|
||||
Object? status = const $CopyWithPlaceholder(),
|
||||
}) {
|
||||
return PendingResolveResult(
|
||||
aliasCreated: aliasCreated == const $CopyWithPlaceholder()
|
||||
? _value.aliasCreated
|
||||
// ignore: cast_nullable_to_non_nullable
|
||||
: aliasCreated as bool,
|
||||
eventsBound: eventsBound == const $CopyWithPlaceholder()
|
||||
? _value.eventsBound
|
||||
// ignore: cast_nullable_to_non_nullable
|
||||
: eventsBound as int,
|
||||
id: id == const $CopyWithPlaceholder()
|
||||
? _value.id
|
||||
// ignore: cast_nullable_to_non_nullable
|
||||
: id as int,
|
||||
instrumentId: instrumentId == const $CopyWithPlaceholder()
|
||||
? _value.instrumentId
|
||||
// ignore: cast_nullable_to_non_nullable
|
||||
: instrumentId as int?,
|
||||
metricsRefreshed: metricsRefreshed == const $CopyWithPlaceholder()
|
||||
? _value.metricsRefreshed
|
||||
// ignore: cast_nullable_to_non_nullable
|
||||
: metricsRefreshed as bool,
|
||||
status: status == const $CopyWithPlaceholder()
|
||||
? _value.status
|
||||
// ignore: cast_nullable_to_non_nullable
|
||||
: status as String,
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
extension $PendingResolveResultCopyWith on PendingResolveResult {
|
||||
/// Returns a callable class that can be used as follows: `instanceOfPendingResolveResult.copyWith(...)` or like so:`instanceOfPendingResolveResult.copyWith.fieldName(...)`.
|
||||
// ignore: library_private_types_in_public_api
|
||||
_$PendingResolveResultCWProxy get copyWith =>
|
||||
_$PendingResolveResultCWProxyImpl(this);
|
||||
}
|
||||
|
||||
// **************************************************************************
|
||||
// JsonSerializableGenerator
|
||||
// **************************************************************************
|
||||
|
||||
PendingResolveResult _$PendingResolveResultFromJson(
|
||||
Map<String, dynamic> json,
|
||||
) => $checkedCreate(
|
||||
'PendingResolveResult',
|
||||
json,
|
||||
($checkedConvert) {
|
||||
$checkKeys(
|
||||
json,
|
||||
requiredKeys: const [
|
||||
'alias_created',
|
||||
'events_bound',
|
||||
'id',
|
||||
'metrics_refreshed',
|
||||
'status',
|
||||
],
|
||||
);
|
||||
final val = PendingResolveResult(
|
||||
aliasCreated: $checkedConvert('alias_created', (v) => v as bool),
|
||||
eventsBound: $checkedConvert('events_bound', (v) => (v as num).toInt()),
|
||||
id: $checkedConvert('id', (v) => (v as num).toInt()),
|
||||
instrumentId: $checkedConvert(
|
||||
'instrument_id',
|
||||
(v) => (v as num?)?.toInt(),
|
||||
),
|
||||
metricsRefreshed: $checkedConvert('metrics_refreshed', (v) => v as bool),
|
||||
status: $checkedConvert('status', (v) => v as String),
|
||||
);
|
||||
return val;
|
||||
},
|
||||
fieldKeyMap: const {
|
||||
'aliasCreated': 'alias_created',
|
||||
'eventsBound': 'events_bound',
|
||||
'instrumentId': 'instrument_id',
|
||||
'metricsRefreshed': 'metrics_refreshed',
|
||||
},
|
||||
);
|
||||
|
||||
Map<String, dynamic> _$PendingResolveResultToJson(
|
||||
PendingResolveResult instance,
|
||||
) => <String, dynamic>{
|
||||
'alias_created': instance.aliasCreated,
|
||||
'events_bound': instance.eventsBound,
|
||||
'id': instance.id,
|
||||
'instrument_id': ?instance.instrumentId,
|
||||
'metrics_refreshed': instance.metricsRefreshed,
|
||||
'status': instance.status,
|
||||
};
|
||||
@@ -0,0 +1,107 @@
|
||||
//
|
||||
// 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 'price_manual_in.g.dart';
|
||||
|
||||
|
||||
@CopyWith()
|
||||
@JsonSerializable(
|
||||
checked: true,
|
||||
createToJson: true,
|
||||
disallowUnrecognizedKeys: false,
|
||||
explicitToJson: true,
|
||||
)
|
||||
class PriceManualIn {
|
||||
/// Returns a new [PriceManualIn] instance.
|
||||
PriceManualIn({
|
||||
|
||||
required this.currency,
|
||||
|
||||
required this.d,
|
||||
|
||||
this.note,
|
||||
|
||||
required this.price,
|
||||
});
|
||||
|
||||
@JsonKey(
|
||||
|
||||
name: r'currency',
|
||||
required: true,
|
||||
includeIfNull: false,
|
||||
)
|
||||
|
||||
|
||||
final String currency;
|
||||
|
||||
|
||||
|
||||
@JsonKey(
|
||||
|
||||
name: r'd',
|
||||
required: true,
|
||||
includeIfNull: false,
|
||||
)
|
||||
|
||||
|
||||
final DateTime d;
|
||||
|
||||
|
||||
|
||||
@JsonKey(
|
||||
|
||||
name: r'note',
|
||||
required: false,
|
||||
includeIfNull: false,
|
||||
)
|
||||
|
||||
|
||||
final String? note;
|
||||
|
||||
|
||||
|
||||
/// decimal as string
|
||||
@JsonKey(
|
||||
|
||||
name: r'price',
|
||||
required: true,
|
||||
includeIfNull: false,
|
||||
)
|
||||
|
||||
|
||||
final String price;
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
@override
|
||||
bool operator ==(Object other) => identical(this, other) || other is PriceManualIn &&
|
||||
other.currency == currency &&
|
||||
other.d == d &&
|
||||
other.note == note &&
|
||||
other.price == price;
|
||||
|
||||
@override
|
||||
int get hashCode =>
|
||||
currency.hashCode +
|
||||
d.hashCode +
|
||||
(note == null ? 0 : note.hashCode) +
|
||||
price.hashCode;
|
||||
|
||||
factory PriceManualIn.fromJson(Map<String, dynamic> json) => _$PriceManualInFromJson(json);
|
||||
|
||||
Map<String, dynamic> toJson() => _$PriceManualInToJson(this);
|
||||
|
||||
@override
|
||||
String toString() {
|
||||
return toJson().toString();
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -0,0 +1,107 @@
|
||||
// GENERATED CODE - DO NOT MODIFY BY HAND
|
||||
|
||||
part of 'price_manual_in.dart';
|
||||
|
||||
// **************************************************************************
|
||||
// CopyWithGenerator
|
||||
// **************************************************************************
|
||||
|
||||
abstract class _$PriceManualInCWProxy {
|
||||
PriceManualIn currency(String currency);
|
||||
|
||||
PriceManualIn d(DateTime d);
|
||||
|
||||
PriceManualIn note(String? note);
|
||||
|
||||
PriceManualIn price(String price);
|
||||
|
||||
/// This function **does support** nullification of nullable fields. All `null` values passed to `non-nullable` fields will be ignored. You can also use `PriceManualIn(...).copyWith.fieldName(...)` to override fields one at a time with nullification support.
|
||||
///
|
||||
/// Usage
|
||||
/// ```dart
|
||||
/// PriceManualIn(...).copyWith(id: 12, name: "My name")
|
||||
/// ````
|
||||
PriceManualIn call({String currency, DateTime d, String? note, String price});
|
||||
}
|
||||
|
||||
/// Proxy class for `copyWith` functionality. This is a callable class and can be used as follows: `instanceOfPriceManualIn.copyWith(...)`. Additionally contains functions for specific fields e.g. `instanceOfPriceManualIn.copyWith.fieldName(...)`
|
||||
class _$PriceManualInCWProxyImpl implements _$PriceManualInCWProxy {
|
||||
const _$PriceManualInCWProxyImpl(this._value);
|
||||
|
||||
final PriceManualIn _value;
|
||||
|
||||
@override
|
||||
PriceManualIn currency(String currency) => this(currency: currency);
|
||||
|
||||
@override
|
||||
PriceManualIn d(DateTime d) => this(d: d);
|
||||
|
||||
@override
|
||||
PriceManualIn note(String? note) => this(note: note);
|
||||
|
||||
@override
|
||||
PriceManualIn price(String price) => this(price: price);
|
||||
|
||||
@override
|
||||
/// This function **does support** nullification of nullable fields. All `null` values passed to `non-nullable` fields will be ignored. You can also use `PriceManualIn(...).copyWith.fieldName(...)` to override fields one at a time with nullification support.
|
||||
///
|
||||
/// Usage
|
||||
/// ```dart
|
||||
/// PriceManualIn(...).copyWith(id: 12, name: "My name")
|
||||
/// ````
|
||||
PriceManualIn call({
|
||||
Object? currency = const $CopyWithPlaceholder(),
|
||||
Object? d = const $CopyWithPlaceholder(),
|
||||
Object? note = const $CopyWithPlaceholder(),
|
||||
Object? price = const $CopyWithPlaceholder(),
|
||||
}) {
|
||||
return PriceManualIn(
|
||||
currency: currency == const $CopyWithPlaceholder()
|
||||
? _value.currency
|
||||
// ignore: cast_nullable_to_non_nullable
|
||||
: currency as String,
|
||||
d: d == const $CopyWithPlaceholder()
|
||||
? _value.d
|
||||
// ignore: cast_nullable_to_non_nullable
|
||||
: d as DateTime,
|
||||
note: note == const $CopyWithPlaceholder()
|
||||
? _value.note
|
||||
// ignore: cast_nullable_to_non_nullable
|
||||
: note as String?,
|
||||
price: price == const $CopyWithPlaceholder()
|
||||
? _value.price
|
||||
// ignore: cast_nullable_to_non_nullable
|
||||
: price as String,
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
extension $PriceManualInCopyWith on PriceManualIn {
|
||||
/// Returns a callable class that can be used as follows: `instanceOfPriceManualIn.copyWith(...)` or like so:`instanceOfPriceManualIn.copyWith.fieldName(...)`.
|
||||
// ignore: library_private_types_in_public_api
|
||||
_$PriceManualInCWProxy get copyWith => _$PriceManualInCWProxyImpl(this);
|
||||
}
|
||||
|
||||
// **************************************************************************
|
||||
// JsonSerializableGenerator
|
||||
// **************************************************************************
|
||||
|
||||
PriceManualIn _$PriceManualInFromJson(Map<String, dynamic> json) =>
|
||||
$checkedCreate('PriceManualIn', json, ($checkedConvert) {
|
||||
$checkKeys(json, requiredKeys: const ['currency', 'd', 'price']);
|
||||
final val = PriceManualIn(
|
||||
currency: $checkedConvert('currency', (v) => v as String),
|
||||
d: $checkedConvert('d', (v) => DateTime.parse(v as String)),
|
||||
note: $checkedConvert('note', (v) => v as String?),
|
||||
price: $checkedConvert('price', (v) => v as String),
|
||||
);
|
||||
return val;
|
||||
});
|
||||
|
||||
Map<String, dynamic> _$PriceManualInToJson(PriceManualIn instance) =>
|
||||
<String, dynamic>{
|
||||
'currency': instance.currency,
|
||||
'd': instance.d.toIso8601String(),
|
||||
'note': ?instance.note,
|
||||
'price': instance.price,
|
||||
};
|
||||
@@ -0,0 +1,139 @@
|
||||
//
|
||||
// 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 'price_manual_out.g.dart';
|
||||
|
||||
|
||||
@CopyWith()
|
||||
@JsonSerializable(
|
||||
checked: true,
|
||||
createToJson: true,
|
||||
disallowUnrecognizedKeys: false,
|
||||
explicitToJson: true,
|
||||
)
|
||||
class PriceManualOut {
|
||||
/// Returns a new [PriceManualOut] instance.
|
||||
PriceManualOut({
|
||||
|
||||
required this.currency,
|
||||
|
||||
required this.d,
|
||||
|
||||
required this.id,
|
||||
|
||||
required this.instrumentId,
|
||||
|
||||
required this.note,
|
||||
|
||||
required this.price,
|
||||
});
|
||||
|
||||
@JsonKey(
|
||||
|
||||
name: r'currency',
|
||||
required: true,
|
||||
includeIfNull: false,
|
||||
)
|
||||
|
||||
|
||||
final String currency;
|
||||
|
||||
|
||||
|
||||
@JsonKey(
|
||||
|
||||
name: r'd',
|
||||
required: true,
|
||||
includeIfNull: false,
|
||||
)
|
||||
|
||||
|
||||
final DateTime d;
|
||||
|
||||
|
||||
|
||||
@JsonKey(
|
||||
|
||||
name: r'id',
|
||||
required: true,
|
||||
includeIfNull: false,
|
||||
)
|
||||
|
||||
|
||||
final int id;
|
||||
|
||||
|
||||
|
||||
@JsonKey(
|
||||
|
||||
name: r'instrument_id',
|
||||
required: true,
|
||||
includeIfNull: false,
|
||||
)
|
||||
|
||||
|
||||
final int instrumentId;
|
||||
|
||||
|
||||
|
||||
@JsonKey(
|
||||
|
||||
name: r'note',
|
||||
required: true,
|
||||
includeIfNull: true,
|
||||
)
|
||||
|
||||
|
||||
final String? note;
|
||||
|
||||
|
||||
|
||||
/// decimal as string
|
||||
@JsonKey(
|
||||
|
||||
name: r'price',
|
||||
required: true,
|
||||
includeIfNull: false,
|
||||
)
|
||||
|
||||
|
||||
final String price;
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
@override
|
||||
bool operator ==(Object other) => identical(this, other) || other is PriceManualOut &&
|
||||
other.currency == currency &&
|
||||
other.d == d &&
|
||||
other.id == id &&
|
||||
other.instrumentId == instrumentId &&
|
||||
other.note == note &&
|
||||
other.price == price;
|
||||
|
||||
@override
|
||||
int get hashCode =>
|
||||
currency.hashCode +
|
||||
d.hashCode +
|
||||
id.hashCode +
|
||||
instrumentId.hashCode +
|
||||
(note == null ? 0 : note.hashCode) +
|
||||
price.hashCode;
|
||||
|
||||
factory PriceManualOut.fromJson(Map<String, dynamic> json) => _$PriceManualOutFromJson(json);
|
||||
|
||||
Map<String, dynamic> toJson() => _$PriceManualOutToJson(this);
|
||||
|
||||
@override
|
||||
String toString() {
|
||||
return toJson().toString();
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -0,0 +1,152 @@
|
||||
// GENERATED CODE - DO NOT MODIFY BY HAND
|
||||
|
||||
part of 'price_manual_out.dart';
|
||||
|
||||
// **************************************************************************
|
||||
// CopyWithGenerator
|
||||
// **************************************************************************
|
||||
|
||||
abstract class _$PriceManualOutCWProxy {
|
||||
PriceManualOut currency(String currency);
|
||||
|
||||
PriceManualOut d(DateTime d);
|
||||
|
||||
PriceManualOut id(int id);
|
||||
|
||||
PriceManualOut instrumentId(int instrumentId);
|
||||
|
||||
PriceManualOut note(String? note);
|
||||
|
||||
PriceManualOut price(String price);
|
||||
|
||||
/// This function **does support** nullification of nullable fields. All `null` values passed to `non-nullable` fields will be ignored. You can also use `PriceManualOut(...).copyWith.fieldName(...)` to override fields one at a time with nullification support.
|
||||
///
|
||||
/// Usage
|
||||
/// ```dart
|
||||
/// PriceManualOut(...).copyWith(id: 12, name: "My name")
|
||||
/// ````
|
||||
PriceManualOut call({
|
||||
String currency,
|
||||
DateTime d,
|
||||
int id,
|
||||
int instrumentId,
|
||||
String? note,
|
||||
String price,
|
||||
});
|
||||
}
|
||||
|
||||
/// Proxy class for `copyWith` functionality. This is a callable class and can be used as follows: `instanceOfPriceManualOut.copyWith(...)`. Additionally contains functions for specific fields e.g. `instanceOfPriceManualOut.copyWith.fieldName(...)`
|
||||
class _$PriceManualOutCWProxyImpl implements _$PriceManualOutCWProxy {
|
||||
const _$PriceManualOutCWProxyImpl(this._value);
|
||||
|
||||
final PriceManualOut _value;
|
||||
|
||||
@override
|
||||
PriceManualOut currency(String currency) => this(currency: currency);
|
||||
|
||||
@override
|
||||
PriceManualOut d(DateTime d) => this(d: d);
|
||||
|
||||
@override
|
||||
PriceManualOut id(int id) => this(id: id);
|
||||
|
||||
@override
|
||||
PriceManualOut instrumentId(int instrumentId) =>
|
||||
this(instrumentId: instrumentId);
|
||||
|
||||
@override
|
||||
PriceManualOut note(String? note) => this(note: note);
|
||||
|
||||
@override
|
||||
PriceManualOut price(String price) => this(price: price);
|
||||
|
||||
@override
|
||||
/// This function **does support** nullification of nullable fields. All `null` values passed to `non-nullable` fields will be ignored. You can also use `PriceManualOut(...).copyWith.fieldName(...)` to override fields one at a time with nullification support.
|
||||
///
|
||||
/// Usage
|
||||
/// ```dart
|
||||
/// PriceManualOut(...).copyWith(id: 12, name: "My name")
|
||||
/// ````
|
||||
PriceManualOut call({
|
||||
Object? currency = const $CopyWithPlaceholder(),
|
||||
Object? d = const $CopyWithPlaceholder(),
|
||||
Object? id = const $CopyWithPlaceholder(),
|
||||
Object? instrumentId = const $CopyWithPlaceholder(),
|
||||
Object? note = const $CopyWithPlaceholder(),
|
||||
Object? price = const $CopyWithPlaceholder(),
|
||||
}) {
|
||||
return PriceManualOut(
|
||||
currency: currency == const $CopyWithPlaceholder()
|
||||
? _value.currency
|
||||
// ignore: cast_nullable_to_non_nullable
|
||||
: currency as String,
|
||||
d: d == const $CopyWithPlaceholder()
|
||||
? _value.d
|
||||
// ignore: cast_nullable_to_non_nullable
|
||||
: d as DateTime,
|
||||
id: id == const $CopyWithPlaceholder()
|
||||
? _value.id
|
||||
// ignore: cast_nullable_to_non_nullable
|
||||
: id as int,
|
||||
instrumentId: instrumentId == const $CopyWithPlaceholder()
|
||||
? _value.instrumentId
|
||||
// ignore: cast_nullable_to_non_nullable
|
||||
: instrumentId as int,
|
||||
note: note == const $CopyWithPlaceholder()
|
||||
? _value.note
|
||||
// ignore: cast_nullable_to_non_nullable
|
||||
: note as String?,
|
||||
price: price == const $CopyWithPlaceholder()
|
||||
? _value.price
|
||||
// ignore: cast_nullable_to_non_nullable
|
||||
: price as String,
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
extension $PriceManualOutCopyWith on PriceManualOut {
|
||||
/// Returns a callable class that can be used as follows: `instanceOfPriceManualOut.copyWith(...)` or like so:`instanceOfPriceManualOut.copyWith.fieldName(...)`.
|
||||
// ignore: library_private_types_in_public_api
|
||||
_$PriceManualOutCWProxy get copyWith => _$PriceManualOutCWProxyImpl(this);
|
||||
}
|
||||
|
||||
// **************************************************************************
|
||||
// JsonSerializableGenerator
|
||||
// **************************************************************************
|
||||
|
||||
PriceManualOut _$PriceManualOutFromJson(Map<String, dynamic> json) =>
|
||||
$checkedCreate('PriceManualOut', json, ($checkedConvert) {
|
||||
$checkKeys(
|
||||
json,
|
||||
requiredKeys: const [
|
||||
'currency',
|
||||
'd',
|
||||
'id',
|
||||
'instrument_id',
|
||||
'note',
|
||||
'price',
|
||||
],
|
||||
);
|
||||
final val = PriceManualOut(
|
||||
currency: $checkedConvert('currency', (v) => v as String),
|
||||
d: $checkedConvert('d', (v) => DateTime.parse(v as String)),
|
||||
id: $checkedConvert('id', (v) => (v as num).toInt()),
|
||||
instrumentId: $checkedConvert(
|
||||
'instrument_id',
|
||||
(v) => (v as num).toInt(),
|
||||
),
|
||||
note: $checkedConvert('note', (v) => v as String?),
|
||||
price: $checkedConvert('price', (v) => v as String),
|
||||
);
|
||||
return val;
|
||||
}, fieldKeyMap: const {'instrumentId': 'instrument_id'});
|
||||
|
||||
Map<String, dynamic> _$PriceManualOutToJson(PriceManualOut instance) =>
|
||||
<String, dynamic>{
|
||||
'currency': instance.currency,
|
||||
'd': instance.d.toIso8601String(),
|
||||
'id': instance.id,
|
||||
'instrument_id': instance.instrumentId,
|
||||
'note': instance.note,
|
||||
'price': instance.price,
|
||||
};
|
||||
@@ -27,6 +27,8 @@ class PricePoint {
|
||||
required this.currency,
|
||||
|
||||
required this.d,
|
||||
|
||||
this.source_ = 'daily',
|
||||
});
|
||||
|
||||
/// decimal as string
|
||||
@@ -79,6 +81,18 @@ class PricePoint {
|
||||
|
||||
|
||||
|
||||
@JsonKey(
|
||||
defaultValue: 'daily',
|
||||
name: r'source',
|
||||
required: false,
|
||||
includeIfNull: false,
|
||||
)
|
||||
|
||||
|
||||
final String? source_;
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
@override
|
||||
@@ -86,14 +100,16 @@ class PricePoint {
|
||||
other.accruedInterest == accruedInterest &&
|
||||
other.close == close &&
|
||||
other.currency == currency &&
|
||||
other.d == d;
|
||||
other.d == d &&
|
||||
other.source_ == source_;
|
||||
|
||||
@override
|
||||
int get hashCode =>
|
||||
(accruedInterest == null ? 0 : accruedInterest.hashCode) +
|
||||
close.hashCode +
|
||||
currency.hashCode +
|
||||
d.hashCode;
|
||||
d.hashCode +
|
||||
source_.hashCode;
|
||||
|
||||
factory PricePoint.fromJson(Map<String, dynamic> json) => _$PricePointFromJson(json);
|
||||
|
||||
|
||||
@@ -15,6 +15,8 @@ abstract class _$PricePointCWProxy {
|
||||
|
||||
PricePoint d(DateTime d);
|
||||
|
||||
PricePoint 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 `PricePoint(...).copyWith.fieldName(...)` to override fields one at a time with nullification support.
|
||||
///
|
||||
/// Usage
|
||||
@@ -26,6 +28,7 @@ abstract class _$PricePointCWProxy {
|
||||
String close,
|
||||
String currency,
|
||||
DateTime d,
|
||||
String? source_,
|
||||
});
|
||||
}
|
||||
|
||||
@@ -48,6 +51,9 @@ class _$PricePointCWProxyImpl implements _$PricePointCWProxy {
|
||||
@override
|
||||
PricePoint d(DateTime d) => this(d: d);
|
||||
|
||||
@override
|
||||
PricePoint 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 `PricePoint(...).copyWith.fieldName(...)` to override fields one at a time with nullification support.
|
||||
///
|
||||
@@ -60,6 +66,7 @@ class _$PricePointCWProxyImpl implements _$PricePointCWProxy {
|
||||
Object? close = const $CopyWithPlaceholder(),
|
||||
Object? currency = const $CopyWithPlaceholder(),
|
||||
Object? d = const $CopyWithPlaceholder(),
|
||||
Object? source_ = const $CopyWithPlaceholder(),
|
||||
}) {
|
||||
return PricePoint(
|
||||
accruedInterest: accruedInterest == const $CopyWithPlaceholder()
|
||||
@@ -78,6 +85,10 @@ class _$PricePointCWProxyImpl implements _$PricePointCWProxy {
|
||||
? _value.d
|
||||
// ignore: cast_nullable_to_non_nullable
|
||||
: d as DateTime,
|
||||
source_: source_ == const $CopyWithPlaceholder()
|
||||
? _value.source_
|
||||
// ignore: cast_nullable_to_non_nullable
|
||||
: source_ as String?,
|
||||
);
|
||||
}
|
||||
}
|
||||
@@ -105,10 +116,14 @@ PricePoint _$PricePointFromJson(Map<String, dynamic> json) => $checkedCreate(
|
||||
close: $checkedConvert('close', (v) => v as String),
|
||||
currency: $checkedConvert('currency', (v) => v as String),
|
||||
d: $checkedConvert('d', (v) => DateTime.parse(v as String)),
|
||||
source_: $checkedConvert('source', (v) => v as String? ?? 'daily'),
|
||||
);
|
||||
return val;
|
||||
},
|
||||
fieldKeyMap: const {'accruedInterest': 'accrued_interest'},
|
||||
fieldKeyMap: const {
|
||||
'accruedInterest': 'accrued_interest',
|
||||
'source_': 'source',
|
||||
},
|
||||
);
|
||||
|
||||
Map<String, dynamic> _$PricePointToJson(PricePoint instance) =>
|
||||
@@ -117,4 +132,5 @@ Map<String, dynamic> _$PricePointToJson(PricePoint instance) =>
|
||||
'close': instance.close,
|
||||
'currency': instance.currency,
|
||||
'd': instance.d.toIso8601String(),
|
||||
'source': ?instance.source_,
|
||||
};
|
||||
|
||||
@@ -0,0 +1,176 @@
|
||||
//
|
||||
// AUTO-GENERATED FILE, DO NOT MODIFY!
|
||||
//
|
||||
|
||||
// ignore_for_file: unused_element
|
||||
import 'package:fintracker_api/src/model/trade_out.dart';
|
||||
import 'package:copy_with_extension/copy_with_extension.dart';
|
||||
import 'package:json_annotation/json_annotation.dart';
|
||||
|
||||
part 'rebalance_bucket_out.g.dart';
|
||||
|
||||
|
||||
@CopyWith()
|
||||
@JsonSerializable(
|
||||
checked: true,
|
||||
createToJson: true,
|
||||
disallowUnrecognizedKeys: false,
|
||||
explicitToJson: true,
|
||||
)
|
||||
class RebalanceBucketOut {
|
||||
/// Returns a new [RebalanceBucketOut] instance.
|
||||
RebalanceBucketOut({
|
||||
|
||||
required this.bucket,
|
||||
|
||||
required this.currentValueRub,
|
||||
|
||||
required this.currentWeight,
|
||||
|
||||
required this.deltaValueRub,
|
||||
|
||||
required this.drift,
|
||||
|
||||
required this.targetWeight,
|
||||
|
||||
required this.trades,
|
||||
|
||||
required this.withinBand,
|
||||
});
|
||||
|
||||
@JsonKey(
|
||||
|
||||
name: r'bucket',
|
||||
required: true,
|
||||
includeIfNull: false,
|
||||
)
|
||||
|
||||
|
||||
final String bucket;
|
||||
|
||||
|
||||
|
||||
/// decimal as string
|
||||
@JsonKey(
|
||||
|
||||
name: r'current_value_rub',
|
||||
required: true,
|
||||
includeIfNull: false,
|
||||
)
|
||||
|
||||
|
||||
final String currentValueRub;
|
||||
|
||||
|
||||
|
||||
/// decimal as string
|
||||
@JsonKey(
|
||||
|
||||
name: r'current_weight',
|
||||
required: true,
|
||||
includeIfNull: false,
|
||||
)
|
||||
|
||||
|
||||
final String currentWeight;
|
||||
|
||||
|
||||
|
||||
/// decimal as string
|
||||
@JsonKey(
|
||||
|
||||
name: r'delta_value_rub',
|
||||
required: true,
|
||||
includeIfNull: false,
|
||||
)
|
||||
|
||||
|
||||
final String deltaValueRub;
|
||||
|
||||
|
||||
|
||||
/// decimal as string
|
||||
@JsonKey(
|
||||
|
||||
name: r'drift',
|
||||
required: true,
|
||||
includeIfNull: true,
|
||||
)
|
||||
|
||||
|
||||
final String? drift;
|
||||
|
||||
|
||||
|
||||
/// decimal as string
|
||||
@JsonKey(
|
||||
|
||||
name: r'target_weight',
|
||||
required: true,
|
||||
includeIfNull: true,
|
||||
)
|
||||
|
||||
|
||||
final String? targetWeight;
|
||||
|
||||
|
||||
|
||||
@JsonKey(
|
||||
|
||||
name: r'trades',
|
||||
required: true,
|
||||
includeIfNull: false,
|
||||
)
|
||||
|
||||
|
||||
final List<TradeOut> trades;
|
||||
|
||||
|
||||
|
||||
@JsonKey(
|
||||
|
||||
name: r'within_band',
|
||||
required: true,
|
||||
includeIfNull: false,
|
||||
)
|
||||
|
||||
|
||||
final bool withinBand;
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
@override
|
||||
bool operator ==(Object other) => identical(this, other) || other is RebalanceBucketOut &&
|
||||
other.bucket == bucket &&
|
||||
other.currentValueRub == currentValueRub &&
|
||||
other.currentWeight == currentWeight &&
|
||||
other.deltaValueRub == deltaValueRub &&
|
||||
other.drift == drift &&
|
||||
other.targetWeight == targetWeight &&
|
||||
other.trades == trades &&
|
||||
other.withinBand == withinBand;
|
||||
|
||||
@override
|
||||
int get hashCode =>
|
||||
bucket.hashCode +
|
||||
currentValueRub.hashCode +
|
||||
currentWeight.hashCode +
|
||||
deltaValueRub.hashCode +
|
||||
(drift == null ? 0 : drift.hashCode) +
|
||||
(targetWeight == null ? 0 : targetWeight.hashCode) +
|
||||
trades.hashCode +
|
||||
withinBand.hashCode;
|
||||
|
||||
factory RebalanceBucketOut.fromJson(Map<String, dynamic> json) => _$RebalanceBucketOutFromJson(json);
|
||||
|
||||
Map<String, dynamic> toJson() => _$RebalanceBucketOutToJson(this);
|
||||
|
||||
@override
|
||||
String toString() {
|
||||
return toJson().toString();
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -0,0 +1,201 @@
|
||||
// GENERATED CODE - DO NOT MODIFY BY HAND
|
||||
|
||||
part of 'rebalance_bucket_out.dart';
|
||||
|
||||
// **************************************************************************
|
||||
// CopyWithGenerator
|
||||
// **************************************************************************
|
||||
|
||||
abstract class _$RebalanceBucketOutCWProxy {
|
||||
RebalanceBucketOut bucket(String bucket);
|
||||
|
||||
RebalanceBucketOut currentValueRub(String currentValueRub);
|
||||
|
||||
RebalanceBucketOut currentWeight(String currentWeight);
|
||||
|
||||
RebalanceBucketOut deltaValueRub(String deltaValueRub);
|
||||
|
||||
RebalanceBucketOut drift(String? drift);
|
||||
|
||||
RebalanceBucketOut targetWeight(String? targetWeight);
|
||||
|
||||
RebalanceBucketOut trades(List<TradeOut> trades);
|
||||
|
||||
RebalanceBucketOut withinBand(bool withinBand);
|
||||
|
||||
/// This function **does support** nullification of nullable fields. All `null` values passed to `non-nullable` fields will be ignored. You can also use `RebalanceBucketOut(...).copyWith.fieldName(...)` to override fields one at a time with nullification support.
|
||||
///
|
||||
/// Usage
|
||||
/// ```dart
|
||||
/// RebalanceBucketOut(...).copyWith(id: 12, name: "My name")
|
||||
/// ````
|
||||
RebalanceBucketOut call({
|
||||
String bucket,
|
||||
String currentValueRub,
|
||||
String currentWeight,
|
||||
String deltaValueRub,
|
||||
String? drift,
|
||||
String? targetWeight,
|
||||
List<TradeOut> trades,
|
||||
bool withinBand,
|
||||
});
|
||||
}
|
||||
|
||||
/// Proxy class for `copyWith` functionality. This is a callable class and can be used as follows: `instanceOfRebalanceBucketOut.copyWith(...)`. Additionally contains functions for specific fields e.g. `instanceOfRebalanceBucketOut.copyWith.fieldName(...)`
|
||||
class _$RebalanceBucketOutCWProxyImpl implements _$RebalanceBucketOutCWProxy {
|
||||
const _$RebalanceBucketOutCWProxyImpl(this._value);
|
||||
|
||||
final RebalanceBucketOut _value;
|
||||
|
||||
@override
|
||||
RebalanceBucketOut bucket(String bucket) => this(bucket: bucket);
|
||||
|
||||
@override
|
||||
RebalanceBucketOut currentValueRub(String currentValueRub) =>
|
||||
this(currentValueRub: currentValueRub);
|
||||
|
||||
@override
|
||||
RebalanceBucketOut currentWeight(String currentWeight) =>
|
||||
this(currentWeight: currentWeight);
|
||||
|
||||
@override
|
||||
RebalanceBucketOut deltaValueRub(String deltaValueRub) =>
|
||||
this(deltaValueRub: deltaValueRub);
|
||||
|
||||
@override
|
||||
RebalanceBucketOut drift(String? drift) => this(drift: drift);
|
||||
|
||||
@override
|
||||
RebalanceBucketOut targetWeight(String? targetWeight) =>
|
||||
this(targetWeight: targetWeight);
|
||||
|
||||
@override
|
||||
RebalanceBucketOut trades(List<TradeOut> trades) => this(trades: trades);
|
||||
|
||||
@override
|
||||
RebalanceBucketOut withinBand(bool withinBand) =>
|
||||
this(withinBand: withinBand);
|
||||
|
||||
@override
|
||||
/// This function **does support** nullification of nullable fields. All `null` values passed to `non-nullable` fields will be ignored. You can also use `RebalanceBucketOut(...).copyWith.fieldName(...)` to override fields one at a time with nullification support.
|
||||
///
|
||||
/// Usage
|
||||
/// ```dart
|
||||
/// RebalanceBucketOut(...).copyWith(id: 12, name: "My name")
|
||||
/// ````
|
||||
RebalanceBucketOut call({
|
||||
Object? bucket = const $CopyWithPlaceholder(),
|
||||
Object? currentValueRub = const $CopyWithPlaceholder(),
|
||||
Object? currentWeight = const $CopyWithPlaceholder(),
|
||||
Object? deltaValueRub = const $CopyWithPlaceholder(),
|
||||
Object? drift = const $CopyWithPlaceholder(),
|
||||
Object? targetWeight = const $CopyWithPlaceholder(),
|
||||
Object? trades = const $CopyWithPlaceholder(),
|
||||
Object? withinBand = const $CopyWithPlaceholder(),
|
||||
}) {
|
||||
return RebalanceBucketOut(
|
||||
bucket: bucket == const $CopyWithPlaceholder()
|
||||
? _value.bucket
|
||||
// ignore: cast_nullable_to_non_nullable
|
||||
: bucket as String,
|
||||
currentValueRub: currentValueRub == const $CopyWithPlaceholder()
|
||||
? _value.currentValueRub
|
||||
// ignore: cast_nullable_to_non_nullable
|
||||
: currentValueRub as String,
|
||||
currentWeight: currentWeight == const $CopyWithPlaceholder()
|
||||
? _value.currentWeight
|
||||
// ignore: cast_nullable_to_non_nullable
|
||||
: currentWeight as String,
|
||||
deltaValueRub: deltaValueRub == const $CopyWithPlaceholder()
|
||||
? _value.deltaValueRub
|
||||
// ignore: cast_nullable_to_non_nullable
|
||||
: deltaValueRub as String,
|
||||
drift: drift == const $CopyWithPlaceholder()
|
||||
? _value.drift
|
||||
// ignore: cast_nullable_to_non_nullable
|
||||
: drift as String?,
|
||||
targetWeight: targetWeight == const $CopyWithPlaceholder()
|
||||
? _value.targetWeight
|
||||
// ignore: cast_nullable_to_non_nullable
|
||||
: targetWeight as String?,
|
||||
trades: trades == const $CopyWithPlaceholder()
|
||||
? _value.trades
|
||||
// ignore: cast_nullable_to_non_nullable
|
||||
: trades as List<TradeOut>,
|
||||
withinBand: withinBand == const $CopyWithPlaceholder()
|
||||
? _value.withinBand
|
||||
// ignore: cast_nullable_to_non_nullable
|
||||
: withinBand as bool,
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
extension $RebalanceBucketOutCopyWith on RebalanceBucketOut {
|
||||
/// Returns a callable class that can be used as follows: `instanceOfRebalanceBucketOut.copyWith(...)` or like so:`instanceOfRebalanceBucketOut.copyWith.fieldName(...)`.
|
||||
// ignore: library_private_types_in_public_api
|
||||
_$RebalanceBucketOutCWProxy get copyWith =>
|
||||
_$RebalanceBucketOutCWProxyImpl(this);
|
||||
}
|
||||
|
||||
// **************************************************************************
|
||||
// JsonSerializableGenerator
|
||||
// **************************************************************************
|
||||
|
||||
RebalanceBucketOut _$RebalanceBucketOutFromJson(Map<String, dynamic> json) =>
|
||||
$checkedCreate(
|
||||
'RebalanceBucketOut',
|
||||
json,
|
||||
($checkedConvert) {
|
||||
$checkKeys(
|
||||
json,
|
||||
requiredKeys: const [
|
||||
'bucket',
|
||||
'current_value_rub',
|
||||
'current_weight',
|
||||
'delta_value_rub',
|
||||
'drift',
|
||||
'target_weight',
|
||||
'trades',
|
||||
'within_band',
|
||||
],
|
||||
);
|
||||
final val = RebalanceBucketOut(
|
||||
bucket: $checkedConvert('bucket', (v) => v as String),
|
||||
currentValueRub: $checkedConvert(
|
||||
'current_value_rub',
|
||||
(v) => v as String,
|
||||
),
|
||||
currentWeight: $checkedConvert('current_weight', (v) => v as String),
|
||||
deltaValueRub: $checkedConvert('delta_value_rub', (v) => v as String),
|
||||
drift: $checkedConvert('drift', (v) => v as String?),
|
||||
targetWeight: $checkedConvert('target_weight', (v) => v as String?),
|
||||
trades: $checkedConvert(
|
||||
'trades',
|
||||
(v) => (v as List<dynamic>)
|
||||
.map((e) => TradeOut.fromJson(e as Map<String, dynamic>))
|
||||
.toList(),
|
||||
),
|
||||
withinBand: $checkedConvert('within_band', (v) => v as bool),
|
||||
);
|
||||
return val;
|
||||
},
|
||||
fieldKeyMap: const {
|
||||
'currentValueRub': 'current_value_rub',
|
||||
'currentWeight': 'current_weight',
|
||||
'deltaValueRub': 'delta_value_rub',
|
||||
'targetWeight': 'target_weight',
|
||||
'withinBand': 'within_band',
|
||||
},
|
||||
);
|
||||
|
||||
Map<String, dynamic> _$RebalanceBucketOutToJson(RebalanceBucketOut instance) =>
|
||||
<String, dynamic>{
|
||||
'bucket': instance.bucket,
|
||||
'current_value_rub': instance.currentValueRub,
|
||||
'current_weight': instance.currentWeight,
|
||||
'delta_value_rub': instance.deltaValueRub,
|
||||
'drift': instance.drift,
|
||||
'target_weight': instance.targetWeight,
|
||||
'trades': instance.trades.map((e) => e.toJson()).toList(),
|
||||
'within_band': instance.withinBand,
|
||||
};
|
||||
@@ -0,0 +1,157 @@
|
||||
//
|
||||
// AUTO-GENERATED FILE, DO NOT MODIFY!
|
||||
//
|
||||
|
||||
// ignore_for_file: unused_element
|
||||
import 'package:fintracker_api/src/model/rebalance_bucket_out.dart';
|
||||
import 'package:copy_with_extension/copy_with_extension.dart';
|
||||
import 'package:json_annotation/json_annotation.dart';
|
||||
|
||||
part 'rebalance_out.g.dart';
|
||||
|
||||
|
||||
@CopyWith()
|
||||
@JsonSerializable(
|
||||
checked: true,
|
||||
createToJson: true,
|
||||
disallowUnrecognizedKeys: false,
|
||||
explicitToJson: true,
|
||||
)
|
||||
class RebalanceOut {
|
||||
/// Returns a new [RebalanceOut] instance.
|
||||
RebalanceOut({
|
||||
|
||||
required this.asOf,
|
||||
|
||||
required this.buckets,
|
||||
|
||||
required this.cashAvailableRub,
|
||||
|
||||
required this.dimension,
|
||||
|
||||
required this.portfolioId,
|
||||
|
||||
required this.totalValueRub,
|
||||
|
||||
required this.warnings,
|
||||
});
|
||||
|
||||
@JsonKey(
|
||||
|
||||
name: r'as_of',
|
||||
required: true,
|
||||
includeIfNull: false,
|
||||
)
|
||||
|
||||
|
||||
final DateTime asOf;
|
||||
|
||||
|
||||
|
||||
@JsonKey(
|
||||
|
||||
name: r'buckets',
|
||||
required: true,
|
||||
includeIfNull: false,
|
||||
)
|
||||
|
||||
|
||||
final List<RebalanceBucketOut> buckets;
|
||||
|
||||
|
||||
|
||||
/// decimal as string
|
||||
@JsonKey(
|
||||
|
||||
name: r'cash_available_rub',
|
||||
required: true,
|
||||
includeIfNull: false,
|
||||
)
|
||||
|
||||
|
||||
final String cashAvailableRub;
|
||||
|
||||
|
||||
|
||||
@JsonKey(
|
||||
|
||||
name: r'dimension',
|
||||
required: true,
|
||||
includeIfNull: false,
|
||||
)
|
||||
|
||||
|
||||
final String dimension;
|
||||
|
||||
|
||||
|
||||
@JsonKey(
|
||||
|
||||
name: r'portfolio_id',
|
||||
required: true,
|
||||
includeIfNull: false,
|
||||
)
|
||||
|
||||
|
||||
final int portfolioId;
|
||||
|
||||
|
||||
|
||||
/// decimal as string
|
||||
@JsonKey(
|
||||
|
||||
name: r'total_value_rub',
|
||||
required: true,
|
||||
includeIfNull: false,
|
||||
)
|
||||
|
||||
|
||||
final String totalValueRub;
|
||||
|
||||
|
||||
|
||||
@JsonKey(
|
||||
|
||||
name: r'warnings',
|
||||
required: true,
|
||||
includeIfNull: false,
|
||||
)
|
||||
|
||||
|
||||
final List<String> warnings;
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
@override
|
||||
bool operator ==(Object other) => identical(this, other) || other is RebalanceOut &&
|
||||
other.asOf == asOf &&
|
||||
other.buckets == buckets &&
|
||||
other.cashAvailableRub == cashAvailableRub &&
|
||||
other.dimension == dimension &&
|
||||
other.portfolioId == portfolioId &&
|
||||
other.totalValueRub == totalValueRub &&
|
||||
other.warnings == warnings;
|
||||
|
||||
@override
|
||||
int get hashCode =>
|
||||
asOf.hashCode +
|
||||
buckets.hashCode +
|
||||
cashAvailableRub.hashCode +
|
||||
dimension.hashCode +
|
||||
portfolioId.hashCode +
|
||||
totalValueRub.hashCode +
|
||||
warnings.hashCode;
|
||||
|
||||
factory RebalanceOut.fromJson(Map<String, dynamic> json) => _$RebalanceOutFromJson(json);
|
||||
|
||||
Map<String, dynamic> toJson() => _$RebalanceOutToJson(this);
|
||||
|
||||
@override
|
||||
String toString() {
|
||||
return toJson().toString();
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -0,0 +1,187 @@
|
||||
// GENERATED CODE - DO NOT MODIFY BY HAND
|
||||
|
||||
part of 'rebalance_out.dart';
|
||||
|
||||
// **************************************************************************
|
||||
// CopyWithGenerator
|
||||
// **************************************************************************
|
||||
|
||||
abstract class _$RebalanceOutCWProxy {
|
||||
RebalanceOut asOf(DateTime asOf);
|
||||
|
||||
RebalanceOut buckets(List<RebalanceBucketOut> buckets);
|
||||
|
||||
RebalanceOut cashAvailableRub(String cashAvailableRub);
|
||||
|
||||
RebalanceOut dimension(String dimension);
|
||||
|
||||
RebalanceOut portfolioId(int portfolioId);
|
||||
|
||||
RebalanceOut totalValueRub(String totalValueRub);
|
||||
|
||||
RebalanceOut warnings(List<String> warnings);
|
||||
|
||||
/// This function **does support** nullification of nullable fields. All `null` values passed to `non-nullable` fields will be ignored. You can also use `RebalanceOut(...).copyWith.fieldName(...)` to override fields one at a time with nullification support.
|
||||
///
|
||||
/// Usage
|
||||
/// ```dart
|
||||
/// RebalanceOut(...).copyWith(id: 12, name: "My name")
|
||||
/// ````
|
||||
RebalanceOut call({
|
||||
DateTime asOf,
|
||||
List<RebalanceBucketOut> buckets,
|
||||
String cashAvailableRub,
|
||||
String dimension,
|
||||
int portfolioId,
|
||||
String totalValueRub,
|
||||
List<String> warnings,
|
||||
});
|
||||
}
|
||||
|
||||
/// Proxy class for `copyWith` functionality. This is a callable class and can be used as follows: `instanceOfRebalanceOut.copyWith(...)`. Additionally contains functions for specific fields e.g. `instanceOfRebalanceOut.copyWith.fieldName(...)`
|
||||
class _$RebalanceOutCWProxyImpl implements _$RebalanceOutCWProxy {
|
||||
const _$RebalanceOutCWProxyImpl(this._value);
|
||||
|
||||
final RebalanceOut _value;
|
||||
|
||||
@override
|
||||
RebalanceOut asOf(DateTime asOf) => this(asOf: asOf);
|
||||
|
||||
@override
|
||||
RebalanceOut buckets(List<RebalanceBucketOut> buckets) =>
|
||||
this(buckets: buckets);
|
||||
|
||||
@override
|
||||
RebalanceOut cashAvailableRub(String cashAvailableRub) =>
|
||||
this(cashAvailableRub: cashAvailableRub);
|
||||
|
||||
@override
|
||||
RebalanceOut dimension(String dimension) => this(dimension: dimension);
|
||||
|
||||
@override
|
||||
RebalanceOut portfolioId(int portfolioId) => this(portfolioId: portfolioId);
|
||||
|
||||
@override
|
||||
RebalanceOut totalValueRub(String totalValueRub) =>
|
||||
this(totalValueRub: totalValueRub);
|
||||
|
||||
@override
|
||||
RebalanceOut warnings(List<String> 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 `RebalanceOut(...).copyWith.fieldName(...)` to override fields one at a time with nullification support.
|
||||
///
|
||||
/// Usage
|
||||
/// ```dart
|
||||
/// RebalanceOut(...).copyWith(id: 12, name: "My name")
|
||||
/// ````
|
||||
RebalanceOut call({
|
||||
Object? asOf = const $CopyWithPlaceholder(),
|
||||
Object? buckets = const $CopyWithPlaceholder(),
|
||||
Object? cashAvailableRub = const $CopyWithPlaceholder(),
|
||||
Object? dimension = const $CopyWithPlaceholder(),
|
||||
Object? portfolioId = const $CopyWithPlaceholder(),
|
||||
Object? totalValueRub = const $CopyWithPlaceholder(),
|
||||
Object? warnings = const $CopyWithPlaceholder(),
|
||||
}) {
|
||||
return RebalanceOut(
|
||||
asOf: asOf == const $CopyWithPlaceholder()
|
||||
? _value.asOf
|
||||
// ignore: cast_nullable_to_non_nullable
|
||||
: asOf as DateTime,
|
||||
buckets: buckets == const $CopyWithPlaceholder()
|
||||
? _value.buckets
|
||||
// ignore: cast_nullable_to_non_nullable
|
||||
: buckets as List<RebalanceBucketOut>,
|
||||
cashAvailableRub: cashAvailableRub == const $CopyWithPlaceholder()
|
||||
? _value.cashAvailableRub
|
||||
// ignore: cast_nullable_to_non_nullable
|
||||
: cashAvailableRub as String,
|
||||
dimension: dimension == const $CopyWithPlaceholder()
|
||||
? _value.dimension
|
||||
// ignore: cast_nullable_to_non_nullable
|
||||
: dimension as String,
|
||||
portfolioId: portfolioId == const $CopyWithPlaceholder()
|
||||
? _value.portfolioId
|
||||
// ignore: cast_nullable_to_non_nullable
|
||||
: portfolioId as int,
|
||||
totalValueRub: totalValueRub == const $CopyWithPlaceholder()
|
||||
? _value.totalValueRub
|
||||
// ignore: cast_nullable_to_non_nullable
|
||||
: totalValueRub as String,
|
||||
warnings: warnings == const $CopyWithPlaceholder()
|
||||
? _value.warnings
|
||||
// ignore: cast_nullable_to_non_nullable
|
||||
: warnings as List<String>,
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
extension $RebalanceOutCopyWith on RebalanceOut {
|
||||
/// Returns a callable class that can be used as follows: `instanceOfRebalanceOut.copyWith(...)` or like so:`instanceOfRebalanceOut.copyWith.fieldName(...)`.
|
||||
// ignore: library_private_types_in_public_api
|
||||
_$RebalanceOutCWProxy get copyWith => _$RebalanceOutCWProxyImpl(this);
|
||||
}
|
||||
|
||||
// **************************************************************************
|
||||
// JsonSerializableGenerator
|
||||
// **************************************************************************
|
||||
|
||||
RebalanceOut _$RebalanceOutFromJson(
|
||||
Map<String, dynamic> json,
|
||||
) => $checkedCreate(
|
||||
'RebalanceOut',
|
||||
json,
|
||||
($checkedConvert) {
|
||||
$checkKeys(
|
||||
json,
|
||||
requiredKeys: const [
|
||||
'as_of',
|
||||
'buckets',
|
||||
'cash_available_rub',
|
||||
'dimension',
|
||||
'portfolio_id',
|
||||
'total_value_rub',
|
||||
'warnings',
|
||||
],
|
||||
);
|
||||
final val = RebalanceOut(
|
||||
asOf: $checkedConvert('as_of', (v) => DateTime.parse(v as String)),
|
||||
buckets: $checkedConvert(
|
||||
'buckets',
|
||||
(v) => (v as List<dynamic>)
|
||||
.map((e) => RebalanceBucketOut.fromJson(e as Map<String, dynamic>))
|
||||
.toList(),
|
||||
),
|
||||
cashAvailableRub: $checkedConvert(
|
||||
'cash_available_rub',
|
||||
(v) => v as String,
|
||||
),
|
||||
dimension: $checkedConvert('dimension', (v) => v as String),
|
||||
portfolioId: $checkedConvert('portfolio_id', (v) => (v as num).toInt()),
|
||||
totalValueRub: $checkedConvert('total_value_rub', (v) => v as String),
|
||||
warnings: $checkedConvert(
|
||||
'warnings',
|
||||
(v) => (v as List<dynamic>).map((e) => e as String).toList(),
|
||||
),
|
||||
);
|
||||
return val;
|
||||
},
|
||||
fieldKeyMap: const {
|
||||
'asOf': 'as_of',
|
||||
'cashAvailableRub': 'cash_available_rub',
|
||||
'portfolioId': 'portfolio_id',
|
||||
'totalValueRub': 'total_value_rub',
|
||||
},
|
||||
);
|
||||
|
||||
Map<String, dynamic> _$RebalanceOutToJson(RebalanceOut instance) =>
|
||||
<String, dynamic>{
|
||||
'as_of': instance.asOf.toIso8601String(),
|
||||
'buckets': instance.buckets.map((e) => e.toJson()).toList(),
|
||||
'cash_available_rub': instance.cashAvailableRub,
|
||||
'dimension': instance.dimension,
|
||||
'portfolio_id': instance.portfolioId,
|
||||
'total_value_rub': instance.totalValueRub,
|
||||
'warnings': instance.warnings,
|
||||
};
|
||||
@@ -0,0 +1,125 @@
|
||||
//
|
||||
// AUTO-GENERATED FILE, DO NOT MODIFY!
|
||||
//
|
||||
|
||||
// ignore_for_file: unused_element
|
||||
import 'package:copy_with_extension/copy_with_extension.dart';
|
||||
import 'package:json_annotation/json_annotation.dart';
|
||||
|
||||
part 'reconciliation_cash.g.dart';
|
||||
|
||||
|
||||
@CopyWith()
|
||||
@JsonSerializable(
|
||||
checked: true,
|
||||
createToJson: true,
|
||||
disallowUnrecognizedKeys: false,
|
||||
explicitToJson: true,
|
||||
)
|
||||
class ReconciliationCash {
|
||||
/// Returns a new [ReconciliationCash] instance.
|
||||
ReconciliationCash({
|
||||
|
||||
required this.balanceDerived,
|
||||
|
||||
required this.balanceReport,
|
||||
|
||||
required this.currency,
|
||||
|
||||
required this.delta,
|
||||
|
||||
required this.matches,
|
||||
});
|
||||
|
||||
/// decimal as string
|
||||
@JsonKey(
|
||||
|
||||
name: r'balance_derived',
|
||||
required: true,
|
||||
includeIfNull: true,
|
||||
)
|
||||
|
||||
|
||||
final String? balanceDerived;
|
||||
|
||||
|
||||
|
||||
/// decimal as string
|
||||
@JsonKey(
|
||||
|
||||
name: r'balance_report',
|
||||
required: true,
|
||||
includeIfNull: false,
|
||||
)
|
||||
|
||||
|
||||
final String balanceReport;
|
||||
|
||||
|
||||
|
||||
@JsonKey(
|
||||
|
||||
name: r'currency',
|
||||
required: true,
|
||||
includeIfNull: false,
|
||||
)
|
||||
|
||||
|
||||
final String currency;
|
||||
|
||||
|
||||
|
||||
/// decimal as string
|
||||
@JsonKey(
|
||||
|
||||
name: r'delta',
|
||||
required: true,
|
||||
includeIfNull: true,
|
||||
)
|
||||
|
||||
|
||||
final String? delta;
|
||||
|
||||
|
||||
|
||||
@JsonKey(
|
||||
|
||||
name: r'matches',
|
||||
required: true,
|
||||
includeIfNull: false,
|
||||
)
|
||||
|
||||
|
||||
final bool matches;
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
@override
|
||||
bool operator ==(Object other) => identical(this, other) || other is ReconciliationCash &&
|
||||
other.balanceDerived == balanceDerived &&
|
||||
other.balanceReport == balanceReport &&
|
||||
other.currency == currency &&
|
||||
other.delta == delta &&
|
||||
other.matches == matches;
|
||||
|
||||
@override
|
||||
int get hashCode =>
|
||||
(balanceDerived == null ? 0 : balanceDerived.hashCode) +
|
||||
balanceReport.hashCode +
|
||||
currency.hashCode +
|
||||
(delta == null ? 0 : delta.hashCode) +
|
||||
matches.hashCode;
|
||||
|
||||
factory ReconciliationCash.fromJson(Map<String, dynamic> json) => _$ReconciliationCashFromJson(json);
|
||||
|
||||
Map<String, dynamic> toJson() => _$ReconciliationCashToJson(this);
|
||||
|
||||
@override
|
||||
String toString() {
|
||||
return toJson().toString();
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -0,0 +1,148 @@
|
||||
// GENERATED CODE - DO NOT MODIFY BY HAND
|
||||
|
||||
part of 'reconciliation_cash.dart';
|
||||
|
||||
// **************************************************************************
|
||||
// CopyWithGenerator
|
||||
// **************************************************************************
|
||||
|
||||
abstract class _$ReconciliationCashCWProxy {
|
||||
ReconciliationCash balanceDerived(String? balanceDerived);
|
||||
|
||||
ReconciliationCash balanceReport(String balanceReport);
|
||||
|
||||
ReconciliationCash currency(String currency);
|
||||
|
||||
ReconciliationCash delta(String? delta);
|
||||
|
||||
ReconciliationCash matches(bool matches);
|
||||
|
||||
/// This function **does support** nullification of nullable fields. All `null` values passed to `non-nullable` fields will be ignored. You can also use `ReconciliationCash(...).copyWith.fieldName(...)` to override fields one at a time with nullification support.
|
||||
///
|
||||
/// Usage
|
||||
/// ```dart
|
||||
/// ReconciliationCash(...).copyWith(id: 12, name: "My name")
|
||||
/// ````
|
||||
ReconciliationCash call({
|
||||
String? balanceDerived,
|
||||
String balanceReport,
|
||||
String currency,
|
||||
String? delta,
|
||||
bool matches,
|
||||
});
|
||||
}
|
||||
|
||||
/// Proxy class for `copyWith` functionality. This is a callable class and can be used as follows: `instanceOfReconciliationCash.copyWith(...)`. Additionally contains functions for specific fields e.g. `instanceOfReconciliationCash.copyWith.fieldName(...)`
|
||||
class _$ReconciliationCashCWProxyImpl implements _$ReconciliationCashCWProxy {
|
||||
const _$ReconciliationCashCWProxyImpl(this._value);
|
||||
|
||||
final ReconciliationCash _value;
|
||||
|
||||
@override
|
||||
ReconciliationCash balanceDerived(String? balanceDerived) =>
|
||||
this(balanceDerived: balanceDerived);
|
||||
|
||||
@override
|
||||
ReconciliationCash balanceReport(String balanceReport) =>
|
||||
this(balanceReport: balanceReport);
|
||||
|
||||
@override
|
||||
ReconciliationCash currency(String currency) => this(currency: currency);
|
||||
|
||||
@override
|
||||
ReconciliationCash delta(String? delta) => this(delta: delta);
|
||||
|
||||
@override
|
||||
ReconciliationCash matches(bool matches) => this(matches: matches);
|
||||
|
||||
@override
|
||||
/// This function **does support** nullification of nullable fields. All `null` values passed to `non-nullable` fields will be ignored. You can also use `ReconciliationCash(...).copyWith.fieldName(...)` to override fields one at a time with nullification support.
|
||||
///
|
||||
/// Usage
|
||||
/// ```dart
|
||||
/// ReconciliationCash(...).copyWith(id: 12, name: "My name")
|
||||
/// ````
|
||||
ReconciliationCash call({
|
||||
Object? balanceDerived = const $CopyWithPlaceholder(),
|
||||
Object? balanceReport = const $CopyWithPlaceholder(),
|
||||
Object? currency = const $CopyWithPlaceholder(),
|
||||
Object? delta = const $CopyWithPlaceholder(),
|
||||
Object? matches = const $CopyWithPlaceholder(),
|
||||
}) {
|
||||
return ReconciliationCash(
|
||||
balanceDerived: balanceDerived == const $CopyWithPlaceholder()
|
||||
? _value.balanceDerived
|
||||
// ignore: cast_nullable_to_non_nullable
|
||||
: balanceDerived as String?,
|
||||
balanceReport: balanceReport == const $CopyWithPlaceholder()
|
||||
? _value.balanceReport
|
||||
// ignore: cast_nullable_to_non_nullable
|
||||
: balanceReport as String,
|
||||
currency: currency == const $CopyWithPlaceholder()
|
||||
? _value.currency
|
||||
// ignore: cast_nullable_to_non_nullable
|
||||
: currency as String,
|
||||
delta: delta == const $CopyWithPlaceholder()
|
||||
? _value.delta
|
||||
// ignore: cast_nullable_to_non_nullable
|
||||
: delta as String?,
|
||||
matches: matches == const $CopyWithPlaceholder()
|
||||
? _value.matches
|
||||
// ignore: cast_nullable_to_non_nullable
|
||||
: matches as bool,
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
extension $ReconciliationCashCopyWith on ReconciliationCash {
|
||||
/// Returns a callable class that can be used as follows: `instanceOfReconciliationCash.copyWith(...)` or like so:`instanceOfReconciliationCash.copyWith.fieldName(...)`.
|
||||
// ignore: library_private_types_in_public_api
|
||||
_$ReconciliationCashCWProxy get copyWith =>
|
||||
_$ReconciliationCashCWProxyImpl(this);
|
||||
}
|
||||
|
||||
// **************************************************************************
|
||||
// JsonSerializableGenerator
|
||||
// **************************************************************************
|
||||
|
||||
ReconciliationCash _$ReconciliationCashFromJson(Map<String, dynamic> json) =>
|
||||
$checkedCreate(
|
||||
'ReconciliationCash',
|
||||
json,
|
||||
($checkedConvert) {
|
||||
$checkKeys(
|
||||
json,
|
||||
requiredKeys: const [
|
||||
'balance_derived',
|
||||
'balance_report',
|
||||
'currency',
|
||||
'delta',
|
||||
'matches',
|
||||
],
|
||||
);
|
||||
final val = ReconciliationCash(
|
||||
balanceDerived: $checkedConvert(
|
||||
'balance_derived',
|
||||
(v) => v as String?,
|
||||
),
|
||||
balanceReport: $checkedConvert('balance_report', (v) => v as String),
|
||||
currency: $checkedConvert('currency', (v) => v as String),
|
||||
delta: $checkedConvert('delta', (v) => v as String?),
|
||||
matches: $checkedConvert('matches', (v) => v as bool),
|
||||
);
|
||||
return val;
|
||||
},
|
||||
fieldKeyMap: const {
|
||||
'balanceDerived': 'balance_derived',
|
||||
'balanceReport': 'balance_report',
|
||||
},
|
||||
);
|
||||
|
||||
Map<String, dynamic> _$ReconciliationCashToJson(ReconciliationCash instance) =>
|
||||
<String, dynamic>{
|
||||
'balance_derived': instance.balanceDerived,
|
||||
'balance_report': instance.balanceReport,
|
||||
'currency': instance.currency,
|
||||
'delta': instance.delta,
|
||||
'matches': instance.matches,
|
||||
};
|
||||
@@ -0,0 +1,108 @@
|
||||
//
|
||||
// AUTO-GENERATED FILE, DO NOT MODIFY!
|
||||
//
|
||||
|
||||
// ignore_for_file: unused_element
|
||||
import 'package:fintracker_api/src/model/reconciliation_cash.dart';
|
||||
import 'package:fintracker_api/src/model/reconciliation_position.dart';
|
||||
import 'package:copy_with_extension/copy_with_extension.dart';
|
||||
import 'package:json_annotation/json_annotation.dart';
|
||||
|
||||
part 'reconciliation_out.g.dart';
|
||||
|
||||
|
||||
@CopyWith()
|
||||
@JsonSerializable(
|
||||
checked: true,
|
||||
createToJson: true,
|
||||
disallowUnrecognizedKeys: false,
|
||||
explicitToJson: true,
|
||||
)
|
||||
class ReconciliationOut {
|
||||
/// Returns a new [ReconciliationOut] instance.
|
||||
ReconciliationOut({
|
||||
|
||||
required this.asOf,
|
||||
|
||||
this.cash,
|
||||
|
||||
this.matches = true,
|
||||
|
||||
this.positions,
|
||||
});
|
||||
|
||||
@JsonKey(
|
||||
|
||||
name: r'as_of',
|
||||
required: true,
|
||||
includeIfNull: true,
|
||||
)
|
||||
|
||||
|
||||
final DateTime? asOf;
|
||||
|
||||
|
||||
|
||||
@JsonKey(
|
||||
|
||||
name: r'cash',
|
||||
required: false,
|
||||
includeIfNull: false,
|
||||
)
|
||||
|
||||
|
||||
final List<ReconciliationCash>? cash;
|
||||
|
||||
|
||||
|
||||
@JsonKey(
|
||||
defaultValue: true,
|
||||
name: r'matches',
|
||||
required: false,
|
||||
includeIfNull: false,
|
||||
)
|
||||
|
||||
|
||||
final bool? matches;
|
||||
|
||||
|
||||
|
||||
@JsonKey(
|
||||
|
||||
name: r'positions',
|
||||
required: false,
|
||||
includeIfNull: false,
|
||||
)
|
||||
|
||||
|
||||
final List<ReconciliationPosition>? positions;
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
@override
|
||||
bool operator ==(Object other) => identical(this, other) || other is ReconciliationOut &&
|
||||
other.asOf == asOf &&
|
||||
other.cash == cash &&
|
||||
other.matches == matches &&
|
||||
other.positions == positions;
|
||||
|
||||
@override
|
||||
int get hashCode =>
|
||||
(asOf == null ? 0 : asOf.hashCode) +
|
||||
cash.hashCode +
|
||||
matches.hashCode +
|
||||
positions.hashCode;
|
||||
|
||||
factory ReconciliationOut.fromJson(Map<String, dynamic> json) => _$ReconciliationOutFromJson(json);
|
||||
|
||||
Map<String, dynamic> toJson() => _$ReconciliationOutToJson(this);
|
||||
|
||||
@override
|
||||
String toString() {
|
||||
return toJson().toString();
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -0,0 +1,132 @@
|
||||
// GENERATED CODE - DO NOT MODIFY BY HAND
|
||||
|
||||
part of 'reconciliation_out.dart';
|
||||
|
||||
// **************************************************************************
|
||||
// CopyWithGenerator
|
||||
// **************************************************************************
|
||||
|
||||
abstract class _$ReconciliationOutCWProxy {
|
||||
ReconciliationOut asOf(DateTime? asOf);
|
||||
|
||||
ReconciliationOut cash(List<ReconciliationCash>? cash);
|
||||
|
||||
ReconciliationOut matches(bool? matches);
|
||||
|
||||
ReconciliationOut positions(List<ReconciliationPosition>? positions);
|
||||
|
||||
/// This function **does support** nullification of nullable fields. All `null` values passed to `non-nullable` fields will be ignored. You can also use `ReconciliationOut(...).copyWith.fieldName(...)` to override fields one at a time with nullification support.
|
||||
///
|
||||
/// Usage
|
||||
/// ```dart
|
||||
/// ReconciliationOut(...).copyWith(id: 12, name: "My name")
|
||||
/// ````
|
||||
ReconciliationOut call({
|
||||
DateTime? asOf,
|
||||
List<ReconciliationCash>? cash,
|
||||
bool? matches,
|
||||
List<ReconciliationPosition>? positions,
|
||||
});
|
||||
}
|
||||
|
||||
/// Proxy class for `copyWith` functionality. This is a callable class and can be used as follows: `instanceOfReconciliationOut.copyWith(...)`. Additionally contains functions for specific fields e.g. `instanceOfReconciliationOut.copyWith.fieldName(...)`
|
||||
class _$ReconciliationOutCWProxyImpl implements _$ReconciliationOutCWProxy {
|
||||
const _$ReconciliationOutCWProxyImpl(this._value);
|
||||
|
||||
final ReconciliationOut _value;
|
||||
|
||||
@override
|
||||
ReconciliationOut asOf(DateTime? asOf) => this(asOf: asOf);
|
||||
|
||||
@override
|
||||
ReconciliationOut cash(List<ReconciliationCash>? cash) => this(cash: cash);
|
||||
|
||||
@override
|
||||
ReconciliationOut matches(bool? matches) => this(matches: matches);
|
||||
|
||||
@override
|
||||
ReconciliationOut positions(List<ReconciliationPosition>? positions) =>
|
||||
this(positions: positions);
|
||||
|
||||
@override
|
||||
/// This function **does support** nullification of nullable fields. All `null` values passed to `non-nullable` fields will be ignored. You can also use `ReconciliationOut(...).copyWith.fieldName(...)` to override fields one at a time with nullification support.
|
||||
///
|
||||
/// Usage
|
||||
/// ```dart
|
||||
/// ReconciliationOut(...).copyWith(id: 12, name: "My name")
|
||||
/// ````
|
||||
ReconciliationOut call({
|
||||
Object? asOf = const $CopyWithPlaceholder(),
|
||||
Object? cash = const $CopyWithPlaceholder(),
|
||||
Object? matches = const $CopyWithPlaceholder(),
|
||||
Object? positions = const $CopyWithPlaceholder(),
|
||||
}) {
|
||||
return ReconciliationOut(
|
||||
asOf: asOf == const $CopyWithPlaceholder()
|
||||
? _value.asOf
|
||||
// ignore: cast_nullable_to_non_nullable
|
||||
: asOf as DateTime?,
|
||||
cash: cash == const $CopyWithPlaceholder()
|
||||
? _value.cash
|
||||
// ignore: cast_nullable_to_non_nullable
|
||||
: cash as List<ReconciliationCash>?,
|
||||
matches: matches == const $CopyWithPlaceholder()
|
||||
? _value.matches
|
||||
// ignore: cast_nullable_to_non_nullable
|
||||
: matches as bool?,
|
||||
positions: positions == const $CopyWithPlaceholder()
|
||||
? _value.positions
|
||||
// ignore: cast_nullable_to_non_nullable
|
||||
: positions as List<ReconciliationPosition>?,
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
extension $ReconciliationOutCopyWith on ReconciliationOut {
|
||||
/// Returns a callable class that can be used as follows: `instanceOfReconciliationOut.copyWith(...)` or like so:`instanceOfReconciliationOut.copyWith.fieldName(...)`.
|
||||
// ignore: library_private_types_in_public_api
|
||||
_$ReconciliationOutCWProxy get copyWith =>
|
||||
_$ReconciliationOutCWProxyImpl(this);
|
||||
}
|
||||
|
||||
// **************************************************************************
|
||||
// JsonSerializableGenerator
|
||||
// **************************************************************************
|
||||
|
||||
ReconciliationOut _$ReconciliationOutFromJson(Map<String, dynamic> json) =>
|
||||
$checkedCreate('ReconciliationOut', json, ($checkedConvert) {
|
||||
$checkKeys(json, requiredKeys: const ['as_of']);
|
||||
final val = ReconciliationOut(
|
||||
asOf: $checkedConvert(
|
||||
'as_of',
|
||||
(v) => v == null ? null : DateTime.parse(v as String),
|
||||
),
|
||||
cash: $checkedConvert(
|
||||
'cash',
|
||||
(v) => (v as List<dynamic>?)
|
||||
?.map(
|
||||
(e) => ReconciliationCash.fromJson(e as Map<String, dynamic>),
|
||||
)
|
||||
.toList(),
|
||||
),
|
||||
matches: $checkedConvert('matches', (v) => v as bool? ?? true),
|
||||
positions: $checkedConvert(
|
||||
'positions',
|
||||
(v) => (v as List<dynamic>?)
|
||||
?.map(
|
||||
(e) =>
|
||||
ReconciliationPosition.fromJson(e as Map<String, dynamic>),
|
||||
)
|
||||
.toList(),
|
||||
),
|
||||
);
|
||||
return val;
|
||||
}, fieldKeyMap: const {'asOf': 'as_of'});
|
||||
|
||||
Map<String, dynamic> _$ReconciliationOutToJson(ReconciliationOut instance) =>
|
||||
<String, dynamic>{
|
||||
'as_of': instance.asOf?.toIso8601String(),
|
||||
'cash': ?instance.cash?.map((e) => e.toJson()).toList(),
|
||||
'matches': ?instance.matches,
|
||||
'positions': ?instance.positions?.map((e) => e.toJson()).toList(),
|
||||
};
|
||||
@@ -0,0 +1,173 @@
|
||||
//
|
||||
// AUTO-GENERATED FILE, DO NOT MODIFY!
|
||||
//
|
||||
|
||||
// ignore_for_file: unused_element
|
||||
import 'package:copy_with_extension/copy_with_extension.dart';
|
||||
import 'package:json_annotation/json_annotation.dart';
|
||||
|
||||
part 'reconciliation_position.g.dart';
|
||||
|
||||
|
||||
@CopyWith()
|
||||
@JsonSerializable(
|
||||
checked: true,
|
||||
createToJson: true,
|
||||
disallowUnrecognizedKeys: false,
|
||||
explicitToJson: true,
|
||||
)
|
||||
class ReconciliationPosition {
|
||||
/// Returns a new [ReconciliationPosition] instance.
|
||||
ReconciliationPosition({
|
||||
|
||||
required this.instrumentId,
|
||||
|
||||
required this.instrumentName,
|
||||
|
||||
required this.isin,
|
||||
|
||||
required this.matches,
|
||||
|
||||
required this.qtyDelta,
|
||||
|
||||
required this.qtyDerived,
|
||||
|
||||
required this.qtyReport,
|
||||
|
||||
required this.ticker,
|
||||
});
|
||||
|
||||
@JsonKey(
|
||||
|
||||
name: r'instrument_id',
|
||||
required: true,
|
||||
includeIfNull: true,
|
||||
)
|
||||
|
||||
|
||||
final int? instrumentId;
|
||||
|
||||
|
||||
|
||||
@JsonKey(
|
||||
|
||||
name: r'instrument_name',
|
||||
required: true,
|
||||
includeIfNull: false,
|
||||
)
|
||||
|
||||
|
||||
final String instrumentName;
|
||||
|
||||
|
||||
|
||||
@JsonKey(
|
||||
|
||||
name: r'isin',
|
||||
required: true,
|
||||
includeIfNull: true,
|
||||
)
|
||||
|
||||
|
||||
final String? isin;
|
||||
|
||||
|
||||
|
||||
@JsonKey(
|
||||
|
||||
name: r'matches',
|
||||
required: true,
|
||||
includeIfNull: false,
|
||||
)
|
||||
|
||||
|
||||
final bool matches;
|
||||
|
||||
|
||||
|
||||
/// decimal as string
|
||||
@JsonKey(
|
||||
|
||||
name: r'qty_delta',
|
||||
required: true,
|
||||
includeIfNull: true,
|
||||
)
|
||||
|
||||
|
||||
final String? qtyDelta;
|
||||
|
||||
|
||||
|
||||
/// decimal as string
|
||||
@JsonKey(
|
||||
|
||||
name: r'qty_derived',
|
||||
required: true,
|
||||
includeIfNull: true,
|
||||
)
|
||||
|
||||
|
||||
final String? qtyDerived;
|
||||
|
||||
|
||||
|
||||
/// decimal as string
|
||||
@JsonKey(
|
||||
|
||||
name: r'qty_report',
|
||||
required: true,
|
||||
includeIfNull: false,
|
||||
)
|
||||
|
||||
|
||||
final String qtyReport;
|
||||
|
||||
|
||||
|
||||
@JsonKey(
|
||||
|
||||
name: r'ticker',
|
||||
required: true,
|
||||
includeIfNull: true,
|
||||
)
|
||||
|
||||
|
||||
final String? ticker;
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
@override
|
||||
bool operator ==(Object other) => identical(this, other) || other is ReconciliationPosition &&
|
||||
other.instrumentId == instrumentId &&
|
||||
other.instrumentName == instrumentName &&
|
||||
other.isin == isin &&
|
||||
other.matches == matches &&
|
||||
other.qtyDelta == qtyDelta &&
|
||||
other.qtyDerived == qtyDerived &&
|
||||
other.qtyReport == qtyReport &&
|
||||
other.ticker == ticker;
|
||||
|
||||
@override
|
||||
int get hashCode =>
|
||||
(instrumentId == null ? 0 : instrumentId.hashCode) +
|
||||
instrumentName.hashCode +
|
||||
(isin == null ? 0 : isin.hashCode) +
|
||||
matches.hashCode +
|
||||
(qtyDelta == null ? 0 : qtyDelta.hashCode) +
|
||||
(qtyDerived == null ? 0 : qtyDerived.hashCode) +
|
||||
qtyReport.hashCode +
|
||||
(ticker == null ? 0 : ticker.hashCode);
|
||||
|
||||
factory ReconciliationPosition.fromJson(Map<String, dynamic> json) => _$ReconciliationPositionFromJson(json);
|
||||
|
||||
Map<String, dynamic> toJson() => _$ReconciliationPositionToJson(this);
|
||||
|
||||
@override
|
||||
String toString() {
|
||||
return toJson().toString();
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -0,0 +1,198 @@
|
||||
// GENERATED CODE - DO NOT MODIFY BY HAND
|
||||
|
||||
part of 'reconciliation_position.dart';
|
||||
|
||||
// **************************************************************************
|
||||
// CopyWithGenerator
|
||||
// **************************************************************************
|
||||
|
||||
abstract class _$ReconciliationPositionCWProxy {
|
||||
ReconciliationPosition instrumentId(int? instrumentId);
|
||||
|
||||
ReconciliationPosition instrumentName(String instrumentName);
|
||||
|
||||
ReconciliationPosition isin(String? isin);
|
||||
|
||||
ReconciliationPosition matches(bool matches);
|
||||
|
||||
ReconciliationPosition qtyDelta(String? qtyDelta);
|
||||
|
||||
ReconciliationPosition qtyDerived(String? qtyDerived);
|
||||
|
||||
ReconciliationPosition qtyReport(String qtyReport);
|
||||
|
||||
ReconciliationPosition ticker(String? ticker);
|
||||
|
||||
/// This function **does support** nullification of nullable fields. All `null` values passed to `non-nullable` fields will be ignored. You can also use `ReconciliationPosition(...).copyWith.fieldName(...)` to override fields one at a time with nullification support.
|
||||
///
|
||||
/// Usage
|
||||
/// ```dart
|
||||
/// ReconciliationPosition(...).copyWith(id: 12, name: "My name")
|
||||
/// ````
|
||||
ReconciliationPosition call({
|
||||
int? instrumentId,
|
||||
String instrumentName,
|
||||
String? isin,
|
||||
bool matches,
|
||||
String? qtyDelta,
|
||||
String? qtyDerived,
|
||||
String qtyReport,
|
||||
String? ticker,
|
||||
});
|
||||
}
|
||||
|
||||
/// Proxy class for `copyWith` functionality. This is a callable class and can be used as follows: `instanceOfReconciliationPosition.copyWith(...)`. Additionally contains functions for specific fields e.g. `instanceOfReconciliationPosition.copyWith.fieldName(...)`
|
||||
class _$ReconciliationPositionCWProxyImpl
|
||||
implements _$ReconciliationPositionCWProxy {
|
||||
const _$ReconciliationPositionCWProxyImpl(this._value);
|
||||
|
||||
final ReconciliationPosition _value;
|
||||
|
||||
@override
|
||||
ReconciliationPosition instrumentId(int? instrumentId) =>
|
||||
this(instrumentId: instrumentId);
|
||||
|
||||
@override
|
||||
ReconciliationPosition instrumentName(String instrumentName) =>
|
||||
this(instrumentName: instrumentName);
|
||||
|
||||
@override
|
||||
ReconciliationPosition isin(String? isin) => this(isin: isin);
|
||||
|
||||
@override
|
||||
ReconciliationPosition matches(bool matches) => this(matches: matches);
|
||||
|
||||
@override
|
||||
ReconciliationPosition qtyDelta(String? qtyDelta) => this(qtyDelta: qtyDelta);
|
||||
|
||||
@override
|
||||
ReconciliationPosition qtyDerived(String? qtyDerived) =>
|
||||
this(qtyDerived: qtyDerived);
|
||||
|
||||
@override
|
||||
ReconciliationPosition qtyReport(String qtyReport) =>
|
||||
this(qtyReport: qtyReport);
|
||||
|
||||
@override
|
||||
ReconciliationPosition ticker(String? ticker) => this(ticker: ticker);
|
||||
|
||||
@override
|
||||
/// This function **does support** nullification of nullable fields. All `null` values passed to `non-nullable` fields will be ignored. You can also use `ReconciliationPosition(...).copyWith.fieldName(...)` to override fields one at a time with nullification support.
|
||||
///
|
||||
/// Usage
|
||||
/// ```dart
|
||||
/// ReconciliationPosition(...).copyWith(id: 12, name: "My name")
|
||||
/// ````
|
||||
ReconciliationPosition call({
|
||||
Object? instrumentId = const $CopyWithPlaceholder(),
|
||||
Object? instrumentName = const $CopyWithPlaceholder(),
|
||||
Object? isin = const $CopyWithPlaceholder(),
|
||||
Object? matches = const $CopyWithPlaceholder(),
|
||||
Object? qtyDelta = const $CopyWithPlaceholder(),
|
||||
Object? qtyDerived = const $CopyWithPlaceholder(),
|
||||
Object? qtyReport = const $CopyWithPlaceholder(),
|
||||
Object? ticker = const $CopyWithPlaceholder(),
|
||||
}) {
|
||||
return ReconciliationPosition(
|
||||
instrumentId: instrumentId == const $CopyWithPlaceholder()
|
||||
? _value.instrumentId
|
||||
// ignore: cast_nullable_to_non_nullable
|
||||
: instrumentId as int?,
|
||||
instrumentName: instrumentName == const $CopyWithPlaceholder()
|
||||
? _value.instrumentName
|
||||
// ignore: cast_nullable_to_non_nullable
|
||||
: instrumentName as String,
|
||||
isin: isin == const $CopyWithPlaceholder()
|
||||
? _value.isin
|
||||
// ignore: cast_nullable_to_non_nullable
|
||||
: isin as String?,
|
||||
matches: matches == const $CopyWithPlaceholder()
|
||||
? _value.matches
|
||||
// ignore: cast_nullable_to_non_nullable
|
||||
: matches as bool,
|
||||
qtyDelta: qtyDelta == const $CopyWithPlaceholder()
|
||||
? _value.qtyDelta
|
||||
// ignore: cast_nullable_to_non_nullable
|
||||
: qtyDelta as String?,
|
||||
qtyDerived: qtyDerived == const $CopyWithPlaceholder()
|
||||
? _value.qtyDerived
|
||||
// ignore: cast_nullable_to_non_nullable
|
||||
: qtyDerived as String?,
|
||||
qtyReport: qtyReport == const $CopyWithPlaceholder()
|
||||
? _value.qtyReport
|
||||
// ignore: cast_nullable_to_non_nullable
|
||||
: qtyReport as String,
|
||||
ticker: ticker == const $CopyWithPlaceholder()
|
||||
? _value.ticker
|
||||
// ignore: cast_nullable_to_non_nullable
|
||||
: ticker as String?,
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
extension $ReconciliationPositionCopyWith on ReconciliationPosition {
|
||||
/// Returns a callable class that can be used as follows: `instanceOfReconciliationPosition.copyWith(...)` or like so:`instanceOfReconciliationPosition.copyWith.fieldName(...)`.
|
||||
// ignore: library_private_types_in_public_api
|
||||
_$ReconciliationPositionCWProxy get copyWith =>
|
||||
_$ReconciliationPositionCWProxyImpl(this);
|
||||
}
|
||||
|
||||
// **************************************************************************
|
||||
// JsonSerializableGenerator
|
||||
// **************************************************************************
|
||||
|
||||
ReconciliationPosition _$ReconciliationPositionFromJson(
|
||||
Map<String, dynamic> json,
|
||||
) => $checkedCreate(
|
||||
'ReconciliationPosition',
|
||||
json,
|
||||
($checkedConvert) {
|
||||
$checkKeys(
|
||||
json,
|
||||
requiredKeys: const [
|
||||
'instrument_id',
|
||||
'instrument_name',
|
||||
'isin',
|
||||
'matches',
|
||||
'qty_delta',
|
||||
'qty_derived',
|
||||
'qty_report',
|
||||
'ticker',
|
||||
],
|
||||
);
|
||||
final val = ReconciliationPosition(
|
||||
instrumentId: $checkedConvert(
|
||||
'instrument_id',
|
||||
(v) => (v as num?)?.toInt(),
|
||||
),
|
||||
instrumentName: $checkedConvert('instrument_name', (v) => v as String),
|
||||
isin: $checkedConvert('isin', (v) => v as String?),
|
||||
matches: $checkedConvert('matches', (v) => v as bool),
|
||||
qtyDelta: $checkedConvert('qty_delta', (v) => v as String?),
|
||||
qtyDerived: $checkedConvert('qty_derived', (v) => v as String?),
|
||||
qtyReport: $checkedConvert('qty_report', (v) => v as String),
|
||||
ticker: $checkedConvert('ticker', (v) => v as String?),
|
||||
);
|
||||
return val;
|
||||
},
|
||||
fieldKeyMap: const {
|
||||
'instrumentId': 'instrument_id',
|
||||
'instrumentName': 'instrument_name',
|
||||
'qtyDelta': 'qty_delta',
|
||||
'qtyDerived': 'qty_derived',
|
||||
'qtyReport': 'qty_report',
|
||||
},
|
||||
);
|
||||
|
||||
Map<String, dynamic> _$ReconciliationPositionToJson(
|
||||
ReconciliationPosition instance,
|
||||
) => <String, dynamic>{
|
||||
'instrument_id': instance.instrumentId,
|
||||
'instrument_name': instance.instrumentName,
|
||||
'isin': instance.isin,
|
||||
'matches': instance.matches,
|
||||
'qty_delta': instance.qtyDelta,
|
||||
'qty_derived': instance.qtyDerived,
|
||||
'qty_report': instance.qtyReport,
|
||||
'ticker': instance.ticker,
|
||||
};
|
||||
@@ -0,0 +1,302 @@
|
||||
//
|
||||
// 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 'sample_event_out.g.dart';
|
||||
|
||||
|
||||
@CopyWith()
|
||||
@JsonSerializable(
|
||||
checked: true,
|
||||
createToJson: true,
|
||||
disallowUnrecognizedKeys: false,
|
||||
explicitToJson: true,
|
||||
)
|
||||
class SampleEventOut {
|
||||
/// Returns a new [SampleEventOut] instance.
|
||||
SampleEventOut({
|
||||
|
||||
required this.amount,
|
||||
|
||||
required this.currency,
|
||||
|
||||
required this.dedupeKey,
|
||||
|
||||
this.description,
|
||||
|
||||
this.fee,
|
||||
|
||||
this.instrumentId,
|
||||
|
||||
this.instrumentKey,
|
||||
|
||||
this.instrumentName,
|
||||
|
||||
required this.isDuplicate,
|
||||
|
||||
required this.kind,
|
||||
|
||||
required this.lineNo,
|
||||
|
||||
this.price,
|
||||
|
||||
this.quantity,
|
||||
|
||||
this.settleDate,
|
||||
|
||||
required this.tradeDate,
|
||||
|
||||
this.tradeNo,
|
||||
});
|
||||
|
||||
/// decimal as string
|
||||
@JsonKey(
|
||||
|
||||
name: r'amount',
|
||||
required: true,
|
||||
includeIfNull: false,
|
||||
)
|
||||
|
||||
|
||||
final String amount;
|
||||
|
||||
|
||||
|
||||
@JsonKey(
|
||||
|
||||
name: r'currency',
|
||||
required: true,
|
||||
includeIfNull: false,
|
||||
)
|
||||
|
||||
|
||||
final String currency;
|
||||
|
||||
|
||||
|
||||
@JsonKey(
|
||||
|
||||
name: r'dedupe_key',
|
||||
required: true,
|
||||
includeIfNull: false,
|
||||
)
|
||||
|
||||
|
||||
final String dedupeKey;
|
||||
|
||||
|
||||
|
||||
@JsonKey(
|
||||
|
||||
name: r'description',
|
||||
required: false,
|
||||
includeIfNull: false,
|
||||
)
|
||||
|
||||
|
||||
final String? description;
|
||||
|
||||
|
||||
|
||||
/// decimal as string
|
||||
@JsonKey(
|
||||
|
||||
name: r'fee',
|
||||
required: false,
|
||||
includeIfNull: false,
|
||||
)
|
||||
|
||||
|
||||
final String? fee;
|
||||
|
||||
|
||||
|
||||
@JsonKey(
|
||||
|
||||
name: r'instrument_id',
|
||||
required: false,
|
||||
includeIfNull: false,
|
||||
)
|
||||
|
||||
|
||||
final int? instrumentId;
|
||||
|
||||
|
||||
|
||||
@JsonKey(
|
||||
|
||||
name: r'instrument_key',
|
||||
required: false,
|
||||
includeIfNull: false,
|
||||
)
|
||||
|
||||
|
||||
final String? instrumentKey;
|
||||
|
||||
|
||||
|
||||
@JsonKey(
|
||||
|
||||
name: r'instrument_name',
|
||||
required: false,
|
||||
includeIfNull: false,
|
||||
)
|
||||
|
||||
|
||||
final String? instrumentName;
|
||||
|
||||
|
||||
|
||||
@JsonKey(
|
||||
|
||||
name: r'is_duplicate',
|
||||
required: true,
|
||||
includeIfNull: false,
|
||||
)
|
||||
|
||||
|
||||
final bool isDuplicate;
|
||||
|
||||
|
||||
|
||||
@JsonKey(
|
||||
|
||||
name: r'kind',
|
||||
required: true,
|
||||
includeIfNull: false,
|
||||
)
|
||||
|
||||
|
||||
final String kind;
|
||||
|
||||
|
||||
|
||||
@JsonKey(
|
||||
|
||||
name: r'line_no',
|
||||
required: true,
|
||||
includeIfNull: false,
|
||||
)
|
||||
|
||||
|
||||
final int lineNo;
|
||||
|
||||
|
||||
|
||||
/// decimal as string
|
||||
@JsonKey(
|
||||
|
||||
name: r'price',
|
||||
required: false,
|
||||
includeIfNull: false,
|
||||
)
|
||||
|
||||
|
||||
final String? price;
|
||||
|
||||
|
||||
|
||||
/// decimal as string
|
||||
@JsonKey(
|
||||
|
||||
name: r'quantity',
|
||||
required: false,
|
||||
includeIfNull: false,
|
||||
)
|
||||
|
||||
|
||||
final String? quantity;
|
||||
|
||||
|
||||
|
||||
@JsonKey(
|
||||
|
||||
name: r'settle_date',
|
||||
required: false,
|
||||
includeIfNull: false,
|
||||
)
|
||||
|
||||
|
||||
final DateTime? settleDate;
|
||||
|
||||
|
||||
|
||||
@JsonKey(
|
||||
|
||||
name: r'trade_date',
|
||||
required: true,
|
||||
includeIfNull: false,
|
||||
)
|
||||
|
||||
|
||||
final DateTime tradeDate;
|
||||
|
||||
|
||||
|
||||
@JsonKey(
|
||||
|
||||
name: r'trade_no',
|
||||
required: false,
|
||||
includeIfNull: false,
|
||||
)
|
||||
|
||||
|
||||
final String? tradeNo;
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
@override
|
||||
bool operator ==(Object other) => identical(this, other) || other is SampleEventOut &&
|
||||
other.amount == amount &&
|
||||
other.currency == currency &&
|
||||
other.dedupeKey == dedupeKey &&
|
||||
other.description == description &&
|
||||
other.fee == fee &&
|
||||
other.instrumentId == instrumentId &&
|
||||
other.instrumentKey == instrumentKey &&
|
||||
other.instrumentName == instrumentName &&
|
||||
other.isDuplicate == isDuplicate &&
|
||||
other.kind == kind &&
|
||||
other.lineNo == lineNo &&
|
||||
other.price == price &&
|
||||
other.quantity == quantity &&
|
||||
other.settleDate == settleDate &&
|
||||
other.tradeDate == tradeDate &&
|
||||
other.tradeNo == tradeNo;
|
||||
|
||||
@override
|
||||
int get hashCode =>
|
||||
amount.hashCode +
|
||||
currency.hashCode +
|
||||
dedupeKey.hashCode +
|
||||
(description == null ? 0 : description.hashCode) +
|
||||
(fee == null ? 0 : fee.hashCode) +
|
||||
(instrumentId == null ? 0 : instrumentId.hashCode) +
|
||||
(instrumentKey == null ? 0 : instrumentKey.hashCode) +
|
||||
(instrumentName == null ? 0 : instrumentName.hashCode) +
|
||||
isDuplicate.hashCode +
|
||||
kind.hashCode +
|
||||
lineNo.hashCode +
|
||||
(price == null ? 0 : price.hashCode) +
|
||||
(quantity == null ? 0 : quantity.hashCode) +
|
||||
(settleDate == null ? 0 : settleDate.hashCode) +
|
||||
tradeDate.hashCode +
|
||||
(tradeNo == null ? 0 : tradeNo.hashCode);
|
||||
|
||||
factory SampleEventOut.fromJson(Map<String, dynamic> json) => _$SampleEventOutFromJson(json);
|
||||
|
||||
Map<String, dynamic> toJson() => _$SampleEventOutToJson(this);
|
||||
|
||||
@override
|
||||
String toString() {
|
||||
return toJson().toString();
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -0,0 +1,312 @@
|
||||
// GENERATED CODE - DO NOT MODIFY BY HAND
|
||||
|
||||
part of 'sample_event_out.dart';
|
||||
|
||||
// **************************************************************************
|
||||
// CopyWithGenerator
|
||||
// **************************************************************************
|
||||
|
||||
abstract class _$SampleEventOutCWProxy {
|
||||
SampleEventOut amount(String amount);
|
||||
|
||||
SampleEventOut currency(String currency);
|
||||
|
||||
SampleEventOut dedupeKey(String dedupeKey);
|
||||
|
||||
SampleEventOut description(String? description);
|
||||
|
||||
SampleEventOut fee(String? fee);
|
||||
|
||||
SampleEventOut instrumentId(int? instrumentId);
|
||||
|
||||
SampleEventOut instrumentKey(String? instrumentKey);
|
||||
|
||||
SampleEventOut instrumentName(String? instrumentName);
|
||||
|
||||
SampleEventOut isDuplicate(bool isDuplicate);
|
||||
|
||||
SampleEventOut kind(String kind);
|
||||
|
||||
SampleEventOut lineNo(int lineNo);
|
||||
|
||||
SampleEventOut price(String? price);
|
||||
|
||||
SampleEventOut quantity(String? quantity);
|
||||
|
||||
SampleEventOut settleDate(DateTime? settleDate);
|
||||
|
||||
SampleEventOut tradeDate(DateTime tradeDate);
|
||||
|
||||
SampleEventOut tradeNo(String? tradeNo);
|
||||
|
||||
/// This function **does support** nullification of nullable fields. All `null` values passed to `non-nullable` fields will be ignored. You can also use `SampleEventOut(...).copyWith.fieldName(...)` to override fields one at a time with nullification support.
|
||||
///
|
||||
/// Usage
|
||||
/// ```dart
|
||||
/// SampleEventOut(...).copyWith(id: 12, name: "My name")
|
||||
/// ````
|
||||
SampleEventOut call({
|
||||
String amount,
|
||||
String currency,
|
||||
String dedupeKey,
|
||||
String? description,
|
||||
String? fee,
|
||||
int? instrumentId,
|
||||
String? instrumentKey,
|
||||
String? instrumentName,
|
||||
bool isDuplicate,
|
||||
String kind,
|
||||
int lineNo,
|
||||
String? price,
|
||||
String? quantity,
|
||||
DateTime? settleDate,
|
||||
DateTime tradeDate,
|
||||
String? tradeNo,
|
||||
});
|
||||
}
|
||||
|
||||
/// Proxy class for `copyWith` functionality. This is a callable class and can be used as follows: `instanceOfSampleEventOut.copyWith(...)`. Additionally contains functions for specific fields e.g. `instanceOfSampleEventOut.copyWith.fieldName(...)`
|
||||
class _$SampleEventOutCWProxyImpl implements _$SampleEventOutCWProxy {
|
||||
const _$SampleEventOutCWProxyImpl(this._value);
|
||||
|
||||
final SampleEventOut _value;
|
||||
|
||||
@override
|
||||
SampleEventOut amount(String amount) => this(amount: amount);
|
||||
|
||||
@override
|
||||
SampleEventOut currency(String currency) => this(currency: currency);
|
||||
|
||||
@override
|
||||
SampleEventOut dedupeKey(String dedupeKey) => this(dedupeKey: dedupeKey);
|
||||
|
||||
@override
|
||||
SampleEventOut description(String? description) =>
|
||||
this(description: description);
|
||||
|
||||
@override
|
||||
SampleEventOut fee(String? fee) => this(fee: fee);
|
||||
|
||||
@override
|
||||
SampleEventOut instrumentId(int? instrumentId) =>
|
||||
this(instrumentId: instrumentId);
|
||||
|
||||
@override
|
||||
SampleEventOut instrumentKey(String? instrumentKey) =>
|
||||
this(instrumentKey: instrumentKey);
|
||||
|
||||
@override
|
||||
SampleEventOut instrumentName(String? instrumentName) =>
|
||||
this(instrumentName: instrumentName);
|
||||
|
||||
@override
|
||||
SampleEventOut isDuplicate(bool isDuplicate) =>
|
||||
this(isDuplicate: isDuplicate);
|
||||
|
||||
@override
|
||||
SampleEventOut kind(String kind) => this(kind: kind);
|
||||
|
||||
@override
|
||||
SampleEventOut lineNo(int lineNo) => this(lineNo: lineNo);
|
||||
|
||||
@override
|
||||
SampleEventOut price(String? price) => this(price: price);
|
||||
|
||||
@override
|
||||
SampleEventOut quantity(String? quantity) => this(quantity: quantity);
|
||||
|
||||
@override
|
||||
SampleEventOut settleDate(DateTime? settleDate) =>
|
||||
this(settleDate: settleDate);
|
||||
|
||||
@override
|
||||
SampleEventOut tradeDate(DateTime tradeDate) => this(tradeDate: tradeDate);
|
||||
|
||||
@override
|
||||
SampleEventOut tradeNo(String? tradeNo) => this(tradeNo: tradeNo);
|
||||
|
||||
@override
|
||||
/// This function **does support** nullification of nullable fields. All `null` values passed to `non-nullable` fields will be ignored. You can also use `SampleEventOut(...).copyWith.fieldName(...)` to override fields one at a time with nullification support.
|
||||
///
|
||||
/// Usage
|
||||
/// ```dart
|
||||
/// SampleEventOut(...).copyWith(id: 12, name: "My name")
|
||||
/// ````
|
||||
SampleEventOut call({
|
||||
Object? amount = const $CopyWithPlaceholder(),
|
||||
Object? currency = const $CopyWithPlaceholder(),
|
||||
Object? dedupeKey = const $CopyWithPlaceholder(),
|
||||
Object? description = const $CopyWithPlaceholder(),
|
||||
Object? fee = const $CopyWithPlaceholder(),
|
||||
Object? instrumentId = const $CopyWithPlaceholder(),
|
||||
Object? instrumentKey = const $CopyWithPlaceholder(),
|
||||
Object? instrumentName = const $CopyWithPlaceholder(),
|
||||
Object? isDuplicate = const $CopyWithPlaceholder(),
|
||||
Object? kind = const $CopyWithPlaceholder(),
|
||||
Object? lineNo = const $CopyWithPlaceholder(),
|
||||
Object? price = const $CopyWithPlaceholder(),
|
||||
Object? quantity = const $CopyWithPlaceholder(),
|
||||
Object? settleDate = const $CopyWithPlaceholder(),
|
||||
Object? tradeDate = const $CopyWithPlaceholder(),
|
||||
Object? tradeNo = const $CopyWithPlaceholder(),
|
||||
}) {
|
||||
return SampleEventOut(
|
||||
amount: amount == const $CopyWithPlaceholder()
|
||||
? _value.amount
|
||||
// ignore: cast_nullable_to_non_nullable
|
||||
: amount as String,
|
||||
currency: currency == const $CopyWithPlaceholder()
|
||||
? _value.currency
|
||||
// ignore: cast_nullable_to_non_nullable
|
||||
: currency as String,
|
||||
dedupeKey: dedupeKey == const $CopyWithPlaceholder()
|
||||
? _value.dedupeKey
|
||||
// ignore: cast_nullable_to_non_nullable
|
||||
: dedupeKey as String,
|
||||
description: description == const $CopyWithPlaceholder()
|
||||
? _value.description
|
||||
// ignore: cast_nullable_to_non_nullable
|
||||
: description as String?,
|
||||
fee: fee == const $CopyWithPlaceholder()
|
||||
? _value.fee
|
||||
// ignore: cast_nullable_to_non_nullable
|
||||
: fee as String?,
|
||||
instrumentId: instrumentId == const $CopyWithPlaceholder()
|
||||
? _value.instrumentId
|
||||
// ignore: cast_nullable_to_non_nullable
|
||||
: instrumentId as int?,
|
||||
instrumentKey: instrumentKey == const $CopyWithPlaceholder()
|
||||
? _value.instrumentKey
|
||||
// ignore: cast_nullable_to_non_nullable
|
||||
: instrumentKey as String?,
|
||||
instrumentName: instrumentName == const $CopyWithPlaceholder()
|
||||
? _value.instrumentName
|
||||
// ignore: cast_nullable_to_non_nullable
|
||||
: instrumentName as String?,
|
||||
isDuplicate: isDuplicate == const $CopyWithPlaceholder()
|
||||
? _value.isDuplicate
|
||||
// ignore: cast_nullable_to_non_nullable
|
||||
: isDuplicate as bool,
|
||||
kind: kind == const $CopyWithPlaceholder()
|
||||
? _value.kind
|
||||
// ignore: cast_nullable_to_non_nullable
|
||||
: kind as String,
|
||||
lineNo: lineNo == const $CopyWithPlaceholder()
|
||||
? _value.lineNo
|
||||
// ignore: cast_nullable_to_non_nullable
|
||||
: lineNo as int,
|
||||
price: price == const $CopyWithPlaceholder()
|
||||
? _value.price
|
||||
// ignore: cast_nullable_to_non_nullable
|
||||
: price as String?,
|
||||
quantity: quantity == const $CopyWithPlaceholder()
|
||||
? _value.quantity
|
||||
// ignore: cast_nullable_to_non_nullable
|
||||
: quantity as String?,
|
||||
settleDate: settleDate == const $CopyWithPlaceholder()
|
||||
? _value.settleDate
|
||||
// ignore: cast_nullable_to_non_nullable
|
||||
: settleDate as DateTime?,
|
||||
tradeDate: tradeDate == const $CopyWithPlaceholder()
|
||||
? _value.tradeDate
|
||||
// ignore: cast_nullable_to_non_nullable
|
||||
: tradeDate as DateTime,
|
||||
tradeNo: tradeNo == const $CopyWithPlaceholder()
|
||||
? _value.tradeNo
|
||||
// ignore: cast_nullable_to_non_nullable
|
||||
: tradeNo as String?,
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
extension $SampleEventOutCopyWith on SampleEventOut {
|
||||
/// Returns a callable class that can be used as follows: `instanceOfSampleEventOut.copyWith(...)` or like so:`instanceOfSampleEventOut.copyWith.fieldName(...)`.
|
||||
// ignore: library_private_types_in_public_api
|
||||
_$SampleEventOutCWProxy get copyWith => _$SampleEventOutCWProxyImpl(this);
|
||||
}
|
||||
|
||||
// **************************************************************************
|
||||
// JsonSerializableGenerator
|
||||
// **************************************************************************
|
||||
|
||||
SampleEventOut _$SampleEventOutFromJson(Map<String, dynamic> json) =>
|
||||
$checkedCreate(
|
||||
'SampleEventOut',
|
||||
json,
|
||||
($checkedConvert) {
|
||||
$checkKeys(
|
||||
json,
|
||||
requiredKeys: const [
|
||||
'amount',
|
||||
'currency',
|
||||
'dedupe_key',
|
||||
'is_duplicate',
|
||||
'kind',
|
||||
'line_no',
|
||||
'trade_date',
|
||||
],
|
||||
);
|
||||
final val = SampleEventOut(
|
||||
amount: $checkedConvert('amount', (v) => v as String),
|
||||
currency: $checkedConvert('currency', (v) => v as String),
|
||||
dedupeKey: $checkedConvert('dedupe_key', (v) => v as String),
|
||||
description: $checkedConvert('description', (v) => v as String?),
|
||||
fee: $checkedConvert('fee', (v) => v as String?),
|
||||
instrumentId: $checkedConvert(
|
||||
'instrument_id',
|
||||
(v) => (v as num?)?.toInt(),
|
||||
),
|
||||
instrumentKey: $checkedConvert('instrument_key', (v) => v as String?),
|
||||
instrumentName: $checkedConvert(
|
||||
'instrument_name',
|
||||
(v) => v as String?,
|
||||
),
|
||||
isDuplicate: $checkedConvert('is_duplicate', (v) => v as bool),
|
||||
kind: $checkedConvert('kind', (v) => v as String),
|
||||
lineNo: $checkedConvert('line_no', (v) => (v as num).toInt()),
|
||||
price: $checkedConvert('price', (v) => v as String?),
|
||||
quantity: $checkedConvert('quantity', (v) => v as String?),
|
||||
settleDate: $checkedConvert(
|
||||
'settle_date',
|
||||
(v) => v == null ? null : DateTime.parse(v as String),
|
||||
),
|
||||
tradeDate: $checkedConvert(
|
||||
'trade_date',
|
||||
(v) => DateTime.parse(v as String),
|
||||
),
|
||||
tradeNo: $checkedConvert('trade_no', (v) => v as String?),
|
||||
);
|
||||
return val;
|
||||
},
|
||||
fieldKeyMap: const {
|
||||
'dedupeKey': 'dedupe_key',
|
||||
'instrumentId': 'instrument_id',
|
||||
'instrumentKey': 'instrument_key',
|
||||
'instrumentName': 'instrument_name',
|
||||
'isDuplicate': 'is_duplicate',
|
||||
'lineNo': 'line_no',
|
||||
'settleDate': 'settle_date',
|
||||
'tradeDate': 'trade_date',
|
||||
'tradeNo': 'trade_no',
|
||||
},
|
||||
);
|
||||
|
||||
Map<String, dynamic> _$SampleEventOutToJson(SampleEventOut instance) =>
|
||||
<String, dynamic>{
|
||||
'amount': instance.amount,
|
||||
'currency': instance.currency,
|
||||
'dedupe_key': instance.dedupeKey,
|
||||
'description': ?instance.description,
|
||||
'fee': ?instance.fee,
|
||||
'instrument_id': ?instance.instrumentId,
|
||||
'instrument_key': ?instance.instrumentKey,
|
||||
'instrument_name': ?instance.instrumentName,
|
||||
'is_duplicate': instance.isDuplicate,
|
||||
'kind': instance.kind,
|
||||
'line_no': instance.lineNo,
|
||||
'price': ?instance.price,
|
||||
'quantity': ?instance.quantity,
|
||||
'settle_date': ?instance.settleDate?.toIso8601String(),
|
||||
'trade_date': instance.tradeDate.toIso8601String(),
|
||||
'trade_no': ?instance.tradeNo,
|
||||
};
|
||||
@@ -0,0 +1,108 @@
|
||||
//
|
||||
// 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 'target_in.g.dart';
|
||||
|
||||
|
||||
@CopyWith()
|
||||
@JsonSerializable(
|
||||
checked: true,
|
||||
createToJson: true,
|
||||
disallowUnrecognizedKeys: false,
|
||||
explicitToJson: true,
|
||||
)
|
||||
class TargetIn {
|
||||
/// Returns a new [TargetIn] instance.
|
||||
TargetIn({
|
||||
|
||||
this.band,
|
||||
|
||||
required this.bucket,
|
||||
|
||||
this.note,
|
||||
|
||||
required this.targetWeight,
|
||||
});
|
||||
|
||||
/// decimal as string
|
||||
@JsonKey(
|
||||
|
||||
name: r'band',
|
||||
required: false,
|
||||
includeIfNull: false,
|
||||
)
|
||||
|
||||
|
||||
final String? band;
|
||||
|
||||
|
||||
|
||||
@JsonKey(
|
||||
|
||||
name: r'bucket',
|
||||
required: true,
|
||||
includeIfNull: false,
|
||||
)
|
||||
|
||||
|
||||
final String bucket;
|
||||
|
||||
|
||||
|
||||
@JsonKey(
|
||||
|
||||
name: r'note',
|
||||
required: false,
|
||||
includeIfNull: false,
|
||||
)
|
||||
|
||||
|
||||
final String? note;
|
||||
|
||||
|
||||
|
||||
/// decimal as string
|
||||
@JsonKey(
|
||||
|
||||
name: r'target_weight',
|
||||
required: true,
|
||||
includeIfNull: false,
|
||||
)
|
||||
|
||||
|
||||
final String targetWeight;
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
@override
|
||||
bool operator ==(Object other) => identical(this, other) || other is TargetIn &&
|
||||
other.band == band &&
|
||||
other.bucket == bucket &&
|
||||
other.note == note &&
|
||||
other.targetWeight == targetWeight;
|
||||
|
||||
@override
|
||||
int get hashCode =>
|
||||
(band == null ? 0 : band.hashCode) +
|
||||
bucket.hashCode +
|
||||
(note == null ? 0 : note.hashCode) +
|
||||
targetWeight.hashCode;
|
||||
|
||||
factory TargetIn.fromJson(Map<String, dynamic> json) => _$TargetInFromJson(json);
|
||||
|
||||
Map<String, dynamic> toJson() => _$TargetInToJson(this);
|
||||
|
||||
@override
|
||||
String toString() {
|
||||
return toJson().toString();
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -0,0 +1,112 @@
|
||||
// GENERATED CODE - DO NOT MODIFY BY HAND
|
||||
|
||||
part of 'target_in.dart';
|
||||
|
||||
// **************************************************************************
|
||||
// CopyWithGenerator
|
||||
// **************************************************************************
|
||||
|
||||
abstract class _$TargetInCWProxy {
|
||||
TargetIn band(String? band);
|
||||
|
||||
TargetIn bucket(String bucket);
|
||||
|
||||
TargetIn note(String? note);
|
||||
|
||||
TargetIn targetWeight(String targetWeight);
|
||||
|
||||
/// This function **does support** nullification of nullable fields. All `null` values passed to `non-nullable` fields will be ignored. You can also use `TargetIn(...).copyWith.fieldName(...)` to override fields one at a time with nullification support.
|
||||
///
|
||||
/// Usage
|
||||
/// ```dart
|
||||
/// TargetIn(...).copyWith(id: 12, name: "My name")
|
||||
/// ````
|
||||
TargetIn call({
|
||||
String? band,
|
||||
String bucket,
|
||||
String? note,
|
||||
String targetWeight,
|
||||
});
|
||||
}
|
||||
|
||||
/// Proxy class for `copyWith` functionality. This is a callable class and can be used as follows: `instanceOfTargetIn.copyWith(...)`. Additionally contains functions for specific fields e.g. `instanceOfTargetIn.copyWith.fieldName(...)`
|
||||
class _$TargetInCWProxyImpl implements _$TargetInCWProxy {
|
||||
const _$TargetInCWProxyImpl(this._value);
|
||||
|
||||
final TargetIn _value;
|
||||
|
||||
@override
|
||||
TargetIn band(String? band) => this(band: band);
|
||||
|
||||
@override
|
||||
TargetIn bucket(String bucket) => this(bucket: bucket);
|
||||
|
||||
@override
|
||||
TargetIn note(String? note) => this(note: note);
|
||||
|
||||
@override
|
||||
TargetIn targetWeight(String targetWeight) =>
|
||||
this(targetWeight: targetWeight);
|
||||
|
||||
@override
|
||||
/// This function **does support** nullification of nullable fields. All `null` values passed to `non-nullable` fields will be ignored. You can also use `TargetIn(...).copyWith.fieldName(...)` to override fields one at a time with nullification support.
|
||||
///
|
||||
/// Usage
|
||||
/// ```dart
|
||||
/// TargetIn(...).copyWith(id: 12, name: "My name")
|
||||
/// ````
|
||||
TargetIn call({
|
||||
Object? band = const $CopyWithPlaceholder(),
|
||||
Object? bucket = const $CopyWithPlaceholder(),
|
||||
Object? note = const $CopyWithPlaceholder(),
|
||||
Object? targetWeight = const $CopyWithPlaceholder(),
|
||||
}) {
|
||||
return TargetIn(
|
||||
band: band == const $CopyWithPlaceholder()
|
||||
? _value.band
|
||||
// ignore: cast_nullable_to_non_nullable
|
||||
: band as String?,
|
||||
bucket: bucket == const $CopyWithPlaceholder()
|
||||
? _value.bucket
|
||||
// ignore: cast_nullable_to_non_nullable
|
||||
: bucket as String,
|
||||
note: note == const $CopyWithPlaceholder()
|
||||
? _value.note
|
||||
// ignore: cast_nullable_to_non_nullable
|
||||
: note as String?,
|
||||
targetWeight: targetWeight == const $CopyWithPlaceholder()
|
||||
? _value.targetWeight
|
||||
// ignore: cast_nullable_to_non_nullable
|
||||
: targetWeight as String,
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
extension $TargetInCopyWith on TargetIn {
|
||||
/// Returns a callable class that can be used as follows: `instanceOfTargetIn.copyWith(...)` or like so:`instanceOfTargetIn.copyWith.fieldName(...)`.
|
||||
// ignore: library_private_types_in_public_api
|
||||
_$TargetInCWProxy get copyWith => _$TargetInCWProxyImpl(this);
|
||||
}
|
||||
|
||||
// **************************************************************************
|
||||
// JsonSerializableGenerator
|
||||
// **************************************************************************
|
||||
|
||||
TargetIn _$TargetInFromJson(Map<String, dynamic> json) =>
|
||||
$checkedCreate('TargetIn', json, ($checkedConvert) {
|
||||
$checkKeys(json, requiredKeys: const ['bucket', 'target_weight']);
|
||||
final val = TargetIn(
|
||||
band: $checkedConvert('band', (v) => v as String?),
|
||||
bucket: $checkedConvert('bucket', (v) => v as String),
|
||||
note: $checkedConvert('note', (v) => v as String?),
|
||||
targetWeight: $checkedConvert('target_weight', (v) => v as String),
|
||||
);
|
||||
return val;
|
||||
}, fieldKeyMap: const {'targetWeight': 'target_weight'});
|
||||
|
||||
Map<String, dynamic> _$TargetInToJson(TargetIn instance) => <String, dynamic>{
|
||||
'band': ?instance.band,
|
||||
'bucket': instance.bucket,
|
||||
'note': ?instance.note,
|
||||
'target_weight': instance.targetWeight,
|
||||
};
|
||||
@@ -0,0 +1,108 @@
|
||||
//
|
||||
// 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 'target_out.g.dart';
|
||||
|
||||
|
||||
@CopyWith()
|
||||
@JsonSerializable(
|
||||
checked: true,
|
||||
createToJson: true,
|
||||
disallowUnrecognizedKeys: false,
|
||||
explicitToJson: true,
|
||||
)
|
||||
class TargetOut {
|
||||
/// Returns a new [TargetOut] instance.
|
||||
TargetOut({
|
||||
|
||||
required this.band,
|
||||
|
||||
required this.bucket,
|
||||
|
||||
required this.note,
|
||||
|
||||
required this.targetWeight,
|
||||
});
|
||||
|
||||
/// decimal as string
|
||||
@JsonKey(
|
||||
|
||||
name: r'band',
|
||||
required: true,
|
||||
includeIfNull: true,
|
||||
)
|
||||
|
||||
|
||||
final String? band;
|
||||
|
||||
|
||||
|
||||
@JsonKey(
|
||||
|
||||
name: r'bucket',
|
||||
required: true,
|
||||
includeIfNull: false,
|
||||
)
|
||||
|
||||
|
||||
final String bucket;
|
||||
|
||||
|
||||
|
||||
@JsonKey(
|
||||
|
||||
name: r'note',
|
||||
required: true,
|
||||
includeIfNull: true,
|
||||
)
|
||||
|
||||
|
||||
final String? note;
|
||||
|
||||
|
||||
|
||||
/// decimal as string
|
||||
@JsonKey(
|
||||
|
||||
name: r'target_weight',
|
||||
required: true,
|
||||
includeIfNull: false,
|
||||
)
|
||||
|
||||
|
||||
final String targetWeight;
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
@override
|
||||
bool operator ==(Object other) => identical(this, other) || other is TargetOut &&
|
||||
other.band == band &&
|
||||
other.bucket == bucket &&
|
||||
other.note == note &&
|
||||
other.targetWeight == targetWeight;
|
||||
|
||||
@override
|
||||
int get hashCode =>
|
||||
(band == null ? 0 : band.hashCode) +
|
||||
bucket.hashCode +
|
||||
(note == null ? 0 : note.hashCode) +
|
||||
targetWeight.hashCode;
|
||||
|
||||
factory TargetOut.fromJson(Map<String, dynamic> json) => _$TargetOutFromJson(json);
|
||||
|
||||
Map<String, dynamic> toJson() => _$TargetOutToJson(this);
|
||||
|
||||
@override
|
||||
String toString() {
|
||||
return toJson().toString();
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -0,0 +1,115 @@
|
||||
// GENERATED CODE - DO NOT MODIFY BY HAND
|
||||
|
||||
part of 'target_out.dart';
|
||||
|
||||
// **************************************************************************
|
||||
// CopyWithGenerator
|
||||
// **************************************************************************
|
||||
|
||||
abstract class _$TargetOutCWProxy {
|
||||
TargetOut band(String? band);
|
||||
|
||||
TargetOut bucket(String bucket);
|
||||
|
||||
TargetOut note(String? note);
|
||||
|
||||
TargetOut targetWeight(String targetWeight);
|
||||
|
||||
/// This function **does support** nullification of nullable fields. All `null` values passed to `non-nullable` fields will be ignored. You can also use `TargetOut(...).copyWith.fieldName(...)` to override fields one at a time with nullification support.
|
||||
///
|
||||
/// Usage
|
||||
/// ```dart
|
||||
/// TargetOut(...).copyWith(id: 12, name: "My name")
|
||||
/// ````
|
||||
TargetOut call({
|
||||
String? band,
|
||||
String bucket,
|
||||
String? note,
|
||||
String targetWeight,
|
||||
});
|
||||
}
|
||||
|
||||
/// Proxy class for `copyWith` functionality. This is a callable class and can be used as follows: `instanceOfTargetOut.copyWith(...)`. Additionally contains functions for specific fields e.g. `instanceOfTargetOut.copyWith.fieldName(...)`
|
||||
class _$TargetOutCWProxyImpl implements _$TargetOutCWProxy {
|
||||
const _$TargetOutCWProxyImpl(this._value);
|
||||
|
||||
final TargetOut _value;
|
||||
|
||||
@override
|
||||
TargetOut band(String? band) => this(band: band);
|
||||
|
||||
@override
|
||||
TargetOut bucket(String bucket) => this(bucket: bucket);
|
||||
|
||||
@override
|
||||
TargetOut note(String? note) => this(note: note);
|
||||
|
||||
@override
|
||||
TargetOut targetWeight(String targetWeight) =>
|
||||
this(targetWeight: targetWeight);
|
||||
|
||||
@override
|
||||
/// This function **does support** nullification of nullable fields. All `null` values passed to `non-nullable` fields will be ignored. You can also use `TargetOut(...).copyWith.fieldName(...)` to override fields one at a time with nullification support.
|
||||
///
|
||||
/// Usage
|
||||
/// ```dart
|
||||
/// TargetOut(...).copyWith(id: 12, name: "My name")
|
||||
/// ````
|
||||
TargetOut call({
|
||||
Object? band = const $CopyWithPlaceholder(),
|
||||
Object? bucket = const $CopyWithPlaceholder(),
|
||||
Object? note = const $CopyWithPlaceholder(),
|
||||
Object? targetWeight = const $CopyWithPlaceholder(),
|
||||
}) {
|
||||
return TargetOut(
|
||||
band: band == const $CopyWithPlaceholder()
|
||||
? _value.band
|
||||
// ignore: cast_nullable_to_non_nullable
|
||||
: band as String?,
|
||||
bucket: bucket == const $CopyWithPlaceholder()
|
||||
? _value.bucket
|
||||
// ignore: cast_nullable_to_non_nullable
|
||||
: bucket as String,
|
||||
note: note == const $CopyWithPlaceholder()
|
||||
? _value.note
|
||||
// ignore: cast_nullable_to_non_nullable
|
||||
: note as String?,
|
||||
targetWeight: targetWeight == const $CopyWithPlaceholder()
|
||||
? _value.targetWeight
|
||||
// ignore: cast_nullable_to_non_nullable
|
||||
: targetWeight as String,
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
extension $TargetOutCopyWith on TargetOut {
|
||||
/// Returns a callable class that can be used as follows: `instanceOfTargetOut.copyWith(...)` or like so:`instanceOfTargetOut.copyWith.fieldName(...)`.
|
||||
// ignore: library_private_types_in_public_api
|
||||
_$TargetOutCWProxy get copyWith => _$TargetOutCWProxyImpl(this);
|
||||
}
|
||||
|
||||
// **************************************************************************
|
||||
// JsonSerializableGenerator
|
||||
// **************************************************************************
|
||||
|
||||
TargetOut _$TargetOutFromJson(Map<String, dynamic> json) =>
|
||||
$checkedCreate('TargetOut', json, ($checkedConvert) {
|
||||
$checkKeys(
|
||||
json,
|
||||
requiredKeys: const ['band', 'bucket', 'note', 'target_weight'],
|
||||
);
|
||||
final val = TargetOut(
|
||||
band: $checkedConvert('band', (v) => v as String?),
|
||||
bucket: $checkedConvert('bucket', (v) => v as String),
|
||||
note: $checkedConvert('note', (v) => v as String?),
|
||||
targetWeight: $checkedConvert('target_weight', (v) => v as String),
|
||||
);
|
||||
return val;
|
||||
}, fieldKeyMap: const {'targetWeight': 'target_weight'});
|
||||
|
||||
Map<String, dynamic> _$TargetOutToJson(TargetOut instance) => <String, dynamic>{
|
||||
'band': instance.band,
|
||||
'bucket': instance.bucket,
|
||||
'note': instance.note,
|
||||
'target_weight': instance.targetWeight,
|
||||
};
|
||||
@@ -0,0 +1,76 @@
|
||||
//
|
||||
// AUTO-GENERATED FILE, DO NOT MODIFY!
|
||||
//
|
||||
|
||||
// ignore_for_file: unused_element
|
||||
import 'package:fintracker_api/src/model/target_in.dart';
|
||||
import 'package:copy_with_extension/copy_with_extension.dart';
|
||||
import 'package:json_annotation/json_annotation.dart';
|
||||
|
||||
part 'targets_in.g.dart';
|
||||
|
||||
|
||||
@CopyWith()
|
||||
@JsonSerializable(
|
||||
checked: true,
|
||||
createToJson: true,
|
||||
disallowUnrecognizedKeys: false,
|
||||
explicitToJson: true,
|
||||
)
|
||||
class TargetsIn {
|
||||
/// Returns a new [TargetsIn] instance.
|
||||
TargetsIn({
|
||||
|
||||
required this.dimension,
|
||||
|
||||
required this.targets,
|
||||
});
|
||||
|
||||
/// asset_class | sector | country | currency
|
||||
@JsonKey(
|
||||
|
||||
name: r'dimension',
|
||||
required: true,
|
||||
includeIfNull: false,
|
||||
)
|
||||
|
||||
|
||||
final String dimension;
|
||||
|
||||
|
||||
|
||||
@JsonKey(
|
||||
|
||||
name: r'targets',
|
||||
required: true,
|
||||
includeIfNull: false,
|
||||
)
|
||||
|
||||
|
||||
final List<TargetIn> targets;
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
@override
|
||||
bool operator ==(Object other) => identical(this, other) || other is TargetsIn &&
|
||||
other.dimension == dimension &&
|
||||
other.targets == targets;
|
||||
|
||||
@override
|
||||
int get hashCode =>
|
||||
dimension.hashCode +
|
||||
targets.hashCode;
|
||||
|
||||
factory TargetsIn.fromJson(Map<String, dynamic> json) => _$TargetsInFromJson(json);
|
||||
|
||||
Map<String, dynamic> toJson() => _$TargetsInToJson(this);
|
||||
|
||||
@override
|
||||
String toString() {
|
||||
return toJson().toString();
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -0,0 +1,87 @@
|
||||
// GENERATED CODE - DO NOT MODIFY BY HAND
|
||||
|
||||
part of 'targets_in.dart';
|
||||
|
||||
// **************************************************************************
|
||||
// CopyWithGenerator
|
||||
// **************************************************************************
|
||||
|
||||
abstract class _$TargetsInCWProxy {
|
||||
TargetsIn dimension(String dimension);
|
||||
|
||||
TargetsIn targets(List<TargetIn> targets);
|
||||
|
||||
/// This function **does support** nullification of nullable fields. All `null` values passed to `non-nullable` fields will be ignored. You can also use `TargetsIn(...).copyWith.fieldName(...)` to override fields one at a time with nullification support.
|
||||
///
|
||||
/// Usage
|
||||
/// ```dart
|
||||
/// TargetsIn(...).copyWith(id: 12, name: "My name")
|
||||
/// ````
|
||||
TargetsIn call({String dimension, List<TargetIn> targets});
|
||||
}
|
||||
|
||||
/// Proxy class for `copyWith` functionality. This is a callable class and can be used as follows: `instanceOfTargetsIn.copyWith(...)`. Additionally contains functions for specific fields e.g. `instanceOfTargetsIn.copyWith.fieldName(...)`
|
||||
class _$TargetsInCWProxyImpl implements _$TargetsInCWProxy {
|
||||
const _$TargetsInCWProxyImpl(this._value);
|
||||
|
||||
final TargetsIn _value;
|
||||
|
||||
@override
|
||||
TargetsIn dimension(String dimension) => this(dimension: dimension);
|
||||
|
||||
@override
|
||||
TargetsIn targets(List<TargetIn> targets) => this(targets: targets);
|
||||
|
||||
@override
|
||||
/// This function **does support** nullification of nullable fields. All `null` values passed to `non-nullable` fields will be ignored. You can also use `TargetsIn(...).copyWith.fieldName(...)` to override fields one at a time with nullification support.
|
||||
///
|
||||
/// Usage
|
||||
/// ```dart
|
||||
/// TargetsIn(...).copyWith(id: 12, name: "My name")
|
||||
/// ````
|
||||
TargetsIn call({
|
||||
Object? dimension = const $CopyWithPlaceholder(),
|
||||
Object? targets = const $CopyWithPlaceholder(),
|
||||
}) {
|
||||
return TargetsIn(
|
||||
dimension: dimension == const $CopyWithPlaceholder()
|
||||
? _value.dimension
|
||||
// ignore: cast_nullable_to_non_nullable
|
||||
: dimension as String,
|
||||
targets: targets == const $CopyWithPlaceholder()
|
||||
? _value.targets
|
||||
// ignore: cast_nullable_to_non_nullable
|
||||
: targets as List<TargetIn>,
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
extension $TargetsInCopyWith on TargetsIn {
|
||||
/// Returns a callable class that can be used as follows: `instanceOfTargetsIn.copyWith(...)` or like so:`instanceOfTargetsIn.copyWith.fieldName(...)`.
|
||||
// ignore: library_private_types_in_public_api
|
||||
_$TargetsInCWProxy get copyWith => _$TargetsInCWProxyImpl(this);
|
||||
}
|
||||
|
||||
// **************************************************************************
|
||||
// JsonSerializableGenerator
|
||||
// **************************************************************************
|
||||
|
||||
TargetsIn _$TargetsInFromJson(Map<String, dynamic> json) =>
|
||||
$checkedCreate('TargetsIn', json, ($checkedConvert) {
|
||||
$checkKeys(json, requiredKeys: const ['dimension', 'targets']);
|
||||
final val = TargetsIn(
|
||||
dimension: $checkedConvert('dimension', (v) => v as String),
|
||||
targets: $checkedConvert(
|
||||
'targets',
|
||||
(v) => (v as List<dynamic>)
|
||||
.map((e) => TargetIn.fromJson(e as Map<String, dynamic>))
|
||||
.toList(),
|
||||
),
|
||||
);
|
||||
return val;
|
||||
});
|
||||
|
||||
Map<String, dynamic> _$TargetsInToJson(TargetsIn instance) => <String, dynamic>{
|
||||
'dimension': instance.dimension,
|
||||
'targets': instance.targets.map((e) => e.toJson()).toList(),
|
||||
};
|
||||
@@ -0,0 +1,108 @@
|
||||
//
|
||||
// AUTO-GENERATED FILE, DO NOT MODIFY!
|
||||
//
|
||||
|
||||
// ignore_for_file: unused_element
|
||||
import 'package:fintracker_api/src/model/target_out.dart';
|
||||
import 'package:copy_with_extension/copy_with_extension.dart';
|
||||
import 'package:json_annotation/json_annotation.dart';
|
||||
|
||||
part 'targets_out.g.dart';
|
||||
|
||||
|
||||
@CopyWith()
|
||||
@JsonSerializable(
|
||||
checked: true,
|
||||
createToJson: true,
|
||||
disallowUnrecognizedKeys: false,
|
||||
explicitToJson: true,
|
||||
)
|
||||
class TargetsOut {
|
||||
/// Returns a new [TargetsOut] instance.
|
||||
TargetsOut({
|
||||
|
||||
required this.dimension,
|
||||
|
||||
required this.portfolioId,
|
||||
|
||||
required this.targets,
|
||||
|
||||
required this.weightsSum,
|
||||
});
|
||||
|
||||
@JsonKey(
|
||||
|
||||
name: r'dimension',
|
||||
required: true,
|
||||
includeIfNull: false,
|
||||
)
|
||||
|
||||
|
||||
final String dimension;
|
||||
|
||||
|
||||
|
||||
@JsonKey(
|
||||
|
||||
name: r'portfolio_id',
|
||||
required: true,
|
||||
includeIfNull: false,
|
||||
)
|
||||
|
||||
|
||||
final int portfolioId;
|
||||
|
||||
|
||||
|
||||
@JsonKey(
|
||||
|
||||
name: r'targets',
|
||||
required: true,
|
||||
includeIfNull: false,
|
||||
)
|
||||
|
||||
|
||||
final List<TargetOut> targets;
|
||||
|
||||
|
||||
|
||||
/// decimal as string
|
||||
@JsonKey(
|
||||
|
||||
name: r'weights_sum',
|
||||
required: true,
|
||||
includeIfNull: false,
|
||||
)
|
||||
|
||||
|
||||
final String weightsSum;
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
@override
|
||||
bool operator ==(Object other) => identical(this, other) || other is TargetsOut &&
|
||||
other.dimension == dimension &&
|
||||
other.portfolioId == portfolioId &&
|
||||
other.targets == targets &&
|
||||
other.weightsSum == weightsSum;
|
||||
|
||||
@override
|
||||
int get hashCode =>
|
||||
dimension.hashCode +
|
||||
portfolioId.hashCode +
|
||||
targets.hashCode +
|
||||
weightsSum.hashCode;
|
||||
|
||||
factory TargetsOut.fromJson(Map<String, dynamic> json) => _$TargetsOutFromJson(json);
|
||||
|
||||
Map<String, dynamic> toJson() => _$TargetsOutToJson(this);
|
||||
|
||||
@override
|
||||
String toString() {
|
||||
return toJson().toString();
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user