chore(app): сгенерированный Dart-клиент с методами аналитики
just gen-client после новых роутов.
This commit is contained in:
@@ -10,10 +10,13 @@ export 'package:fintracker_api/src/auth/oauth.dart';
|
||||
|
||||
|
||||
export 'package:fintracker_api/src/api/accounts_api.dart';
|
||||
export 'package:fintracker_api/src/api/analytics_api.dart';
|
||||
export 'package:fintracker_api/src/api/auth_api.dart';
|
||||
export 'package:fintracker_api/src/api/cashflow_api.dart';
|
||||
export 'package:fintracker_api/src/api/categories_api.dart';
|
||||
export 'package:fintracker_api/src/api/events_api.dart';
|
||||
export 'package:fintracker_api/src/api/health_api.dart';
|
||||
export 'package:fintracker_api/src/api/instruments_api.dart';
|
||||
export 'package:fintracker_api/src/api/metrics_api.dart';
|
||||
export 'package:fintracker_api/src/api/networth_api.dart';
|
||||
export 'package:fintracker_api/src/api/rules_api.dart';
|
||||
@@ -25,20 +28,32 @@ export 'package:fintracker_api/src/model/account_kind.dart';
|
||||
export 'package:fintracker_api/src/model/account_out.dart';
|
||||
export 'package:fintracker_api/src/model/account_patch.dart';
|
||||
export 'package:fintracker_api/src/model/account_role.dart';
|
||||
export 'package:fintracker_api/src/model/allocation_bucket.dart';
|
||||
export 'package:fintracker_api/src/model/allocation_dimension.dart';
|
||||
export 'package:fintracker_api/src/model/broker.dart';
|
||||
export 'package:fintracker_api/src/model/cash_flow_month.dart';
|
||||
export 'package:fintracker_api/src/model/category_out.dart';
|
||||
export 'package:fintracker_api/src/model/data_quality_row.dart';
|
||||
export 'package:fintracker_api/src/model/event_kind.dart';
|
||||
export 'package:fintracker_api/src/model/event_out.dart';
|
||||
export 'package:fintracker_api/src/model/event_page.dart';
|
||||
export 'package:fintracker_api/src/model/event_source.dart';
|
||||
export 'package:fintracker_api/src/model/event_status.dart';
|
||||
export 'package:fintracker_api/src/model/flow_type.dart';
|
||||
export 'package:fintracker_api/src/model/health.dart';
|
||||
export 'package:fintracker_api/src/model/holding_out.dart';
|
||||
export 'package:fintracker_api/src/model/instrument_detail.dart';
|
||||
export 'package:fintracker_api/src/model/instrument_out.dart';
|
||||
export 'package:fintracker_api/src/model/job_status.dart';
|
||||
export 'package:fintracker_api/src/model/login_request.dart';
|
||||
export 'package:fintracker_api/src/model/lot_out.dart';
|
||||
export 'package:fintracker_api/src/model/net_worth_breakdown.dart';
|
||||
export 'package:fintracker_api/src/model/net_worth_day.dart';
|
||||
export 'package:fintracker_api/src/model/price_point.dart';
|
||||
export 'package:fintracker_api/src/model/problem.dart';
|
||||
export 'package:fintracker_api/src/model/refresh_log_out.dart';
|
||||
export 'package:fintracker_api/src/model/refresh_request.dart';
|
||||
export 'package:fintracker_api/src/model/returns_out.dart';
|
||||
export 'package:fintracker_api/src/model/rule_create.dart';
|
||||
export 'package:fintracker_api/src/model/rule_kind.dart';
|
||||
export 'package:fintracker_api/src/model/rule_match_type.dart';
|
||||
@@ -46,12 +61,15 @@ export 'package:fintracker_api/src/model/rule_out.dart';
|
||||
export 'package:fintracker_api/src/model/rule_patch.dart';
|
||||
export 'package:fintracker_api/src/model/run_status.dart';
|
||||
export 'package:fintracker_api/src/model/runway_out.dart';
|
||||
export 'package:fintracker_api/src/model/scope_out.dart';
|
||||
export 'package:fintracker_api/src/model/source_status.dart';
|
||||
export 'package:fintracker_api/src/model/spending_row.dart';
|
||||
export 'package:fintracker_api/src/model/summary_out.dart';
|
||||
export 'package:fintracker_api/src/model/sync_job_out.dart';
|
||||
export 'package:fintracker_api/src/model/sync_run_out.dart';
|
||||
export 'package:fintracker_api/src/model/token_pair.dart';
|
||||
export 'package:fintracker_api/src/model/transaction_out.dart';
|
||||
export 'package:fintracker_api/src/model/transaction_page.dart';
|
||||
export 'package:fintracker_api/src/model/user_out.dart';
|
||||
export 'package:fintracker_api/src/model/value_day.dart';
|
||||
|
||||
|
||||
@@ -8,10 +8,13 @@ import 'package:fintracker_api/src/auth/basic_auth.dart';
|
||||
import 'package:fintracker_api/src/auth/bearer_auth.dart';
|
||||
import 'package:fintracker_api/src/auth/oauth.dart';
|
||||
import 'package:fintracker_api/src/api/accounts_api.dart';
|
||||
import 'package:fintracker_api/src/api/analytics_api.dart';
|
||||
import 'package:fintracker_api/src/api/auth_api.dart';
|
||||
import 'package:fintracker_api/src/api/cashflow_api.dart';
|
||||
import 'package:fintracker_api/src/api/categories_api.dart';
|
||||
import 'package:fintracker_api/src/api/events_api.dart';
|
||||
import 'package:fintracker_api/src/api/health_api.dart';
|
||||
import 'package:fintracker_api/src/api/instruments_api.dart';
|
||||
import 'package:fintracker_api/src/api/metrics_api.dart';
|
||||
import 'package:fintracker_api/src/api/networth_api.dart';
|
||||
import 'package:fintracker_api/src/api/rules_api.dart';
|
||||
@@ -115,6 +118,12 @@ class FintrackerApi {
|
||||
return AccountsApi(dio);
|
||||
}
|
||||
|
||||
/// Get AnalyticsApi instance, base route and serializer can be overridden by a given but be careful,
|
||||
/// by doing that all interceptors will not be executed
|
||||
AnalyticsApi getAnalyticsApi() {
|
||||
return AnalyticsApi(dio);
|
||||
}
|
||||
|
||||
/// Get AuthApi instance, base route and serializer can be overridden by a given but be careful,
|
||||
/// by doing that all interceptors will not be executed
|
||||
AuthApi getAuthApi() {
|
||||
@@ -133,12 +142,24 @@ class FintrackerApi {
|
||||
return CategoriesApi(dio);
|
||||
}
|
||||
|
||||
/// Get EventsApi instance, base route and serializer can be overridden by a given but be careful,
|
||||
/// by doing that all interceptors will not be executed
|
||||
EventsApi getEventsApi() {
|
||||
return EventsApi(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 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 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() {
|
||||
|
||||
@@ -0,0 +1,527 @@
|
||||
//
|
||||
// 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/allocation_bucket.dart';
|
||||
import 'package:fintracker_api/src/model/allocation_dimension.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';
|
||||
import 'package:fintracker_api/src/model/scope_out.dart';
|
||||
import 'package:fintracker_api/src/model/summary_out.dart';
|
||||
import 'package:fintracker_api/src/model/value_day.dart';
|
||||
|
||||
class AnalyticsApi {
|
||||
|
||||
final Dio _dio;
|
||||
|
||||
const AnalyticsApi(this._dio);
|
||||
|
||||
/// Allocation
|
||||
/// Buckets of one dimension (or all four), largest first.
|
||||
///
|
||||
/// Parameters:
|
||||
/// * [scope] - all | account:<id> | portfolio:<id>
|
||||
/// * [dimension]
|
||||
/// * [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<AllocationBucket>] as data
|
||||
/// Throws [DioException] if API call or serialization fails
|
||||
Future<Response<List<AllocationBucket>>> analyticsAllocation({
|
||||
String? scope = 'all',
|
||||
AllocationDimension? dimension,
|
||||
CancelToken? cancelToken,
|
||||
Map<String, dynamic>? headers,
|
||||
Map<String, dynamic>? extra,
|
||||
ValidateStatus? validateStatus,
|
||||
ProgressCallback? onSendProgress,
|
||||
ProgressCallback? onReceiveProgress,
|
||||
}) async {
|
||||
final _path = r'/api/v1/analytics/allocation';
|
||||
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 (dimension != null) r'dimension': dimension,
|
||||
};
|
||||
|
||||
final _response = await _dio.request<Object>(
|
||||
_path,
|
||||
options: _options,
|
||||
queryParameters: _queryParameters,
|
||||
cancelToken: cancelToken,
|
||||
onSendProgress: onSendProgress,
|
||||
onReceiveProgress: onReceiveProgress,
|
||||
);
|
||||
|
||||
List<AllocationBucket>? _responseData;
|
||||
|
||||
try {
|
||||
final rawData = _response.data;
|
||||
_responseData = rawData == null ? null : deserialize<List<AllocationBucket>, AllocationBucket>(rawData, 'List<AllocationBucket>', growable: true);
|
||||
|
||||
} catch (error, stackTrace) {
|
||||
throw DioException(
|
||||
requestOptions: _response.requestOptions,
|
||||
response: _response,
|
||||
type: DioExceptionType.unknown,
|
||||
error: error,
|
||||
stackTrace: stackTrace,
|
||||
);
|
||||
}
|
||||
|
||||
return Response<List<AllocationBucket>>(
|
||||
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.
|
||||
///
|
||||
/// 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<HoldingOut>] as data
|
||||
/// Throws [DioException] if API call or serialization fails
|
||||
Future<Response<List<HoldingOut>>> analyticsHoldings({
|
||||
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/holdings';
|
||||
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<HoldingOut>? _responseData;
|
||||
|
||||
try {
|
||||
final rawData = _response.data;
|
||||
_responseData = rawData == null ? null : deserialize<List<HoldingOut>, HoldingOut>(rawData, 'List<HoldingOut>', growable: true);
|
||||
|
||||
} catch (error, stackTrace) {
|
||||
throw DioException(
|
||||
requestOptions: _response.requestOptions,
|
||||
response: _response,
|
||||
type: DioExceptionType.unknown,
|
||||
error: error,
|
||||
stackTrace: stackTrace,
|
||||
);
|
||||
}
|
||||
|
||||
return Response<List<HoldingOut>>(
|
||||
data: _responseData,
|
||||
headers: _response.headers,
|
||||
isRedirect: _response.isRedirect,
|
||||
requestOptions: _response.requestOptions,
|
||||
redirects: _response.redirects,
|
||||
statusCode: _response.statusCode,
|
||||
statusMessage: _response.statusMessage,
|
||||
extra: _response.extra,
|
||||
);
|
||||
}
|
||||
|
||||
/// Returns
|
||||
/// XIRR and TWR per period, shortest first.
|
||||
///
|
||||
/// 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<ReturnsOut>] as data
|
||||
/// Throws [DioException] if API call or serialization fails
|
||||
Future<Response<List<ReturnsOut>>> analyticsReturns({
|
||||
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/returns';
|
||||
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<ReturnsOut>? _responseData;
|
||||
|
||||
try {
|
||||
final rawData = _response.data;
|
||||
_responseData = rawData == null ? null : deserialize<List<ReturnsOut>, ReturnsOut>(rawData, 'List<ReturnsOut>', growable: true);
|
||||
|
||||
} catch (error, stackTrace) {
|
||||
throw DioException(
|
||||
requestOptions: _response.requestOptions,
|
||||
response: _response,
|
||||
type: DioExceptionType.unknown,
|
||||
error: error,
|
||||
stackTrace: stackTrace,
|
||||
);
|
||||
}
|
||||
|
||||
return Response<List<ReturnsOut>>(
|
||||
data: _responseData,
|
||||
headers: _response.headers,
|
||||
isRedirect: _response.isRedirect,
|
||||
requestOptions: _response.requestOptions,
|
||||
redirects: _response.redirects,
|
||||
statusCode: _response.statusCode,
|
||||
statusMessage: _response.statusMessage,
|
||||
extra: _response.extra,
|
||||
);
|
||||
}
|
||||
|
||||
/// Scopes
|
||||
/// Every set of accounts the metrics were built for.
|
||||
///
|
||||
/// 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<ScopeOut>] as data
|
||||
/// Throws [DioException] if API call or serialization fails
|
||||
Future<Response<List<ScopeOut>>> analyticsScopes({
|
||||
CancelToken? cancelToken,
|
||||
Map<String, dynamic>? headers,
|
||||
Map<String, dynamic>? extra,
|
||||
ValidateStatus? validateStatus,
|
||||
ProgressCallback? onSendProgress,
|
||||
ProgressCallback? onReceiveProgress,
|
||||
}) async {
|
||||
final _path = r'/api/v1/analytics/scopes';
|
||||
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<ScopeOut>? _responseData;
|
||||
|
||||
try {
|
||||
final rawData = _response.data;
|
||||
_responseData = rawData == null ? null : deserialize<List<ScopeOut>, ScopeOut>(rawData, 'List<ScopeOut>', growable: true);
|
||||
|
||||
} catch (error, stackTrace) {
|
||||
throw DioException(
|
||||
requestOptions: _response.requestOptions,
|
||||
response: _response,
|
||||
type: DioExceptionType.unknown,
|
||||
error: error,
|
||||
stackTrace: stackTrace,
|
||||
);
|
||||
}
|
||||
|
||||
return Response<List<ScopeOut>>(
|
||||
data: _responseData,
|
||||
headers: _response.headers,
|
||||
isRedirect: _response.isRedirect,
|
||||
requestOptions: _response.requestOptions,
|
||||
redirects: _response.redirects,
|
||||
statusCode: _response.statusCode,
|
||||
statusMessage: _response.statusMessage,
|
||||
extra: _response.extra,
|
||||
);
|
||||
}
|
||||
|
||||
/// Summary
|
||||
/// One screen's worth: the latest day, the totals it adds up to, and the returns.
|
||||
///
|
||||
/// 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 [SummaryOut] as data
|
||||
/// Throws [DioException] if API call or serialization fails
|
||||
Future<Response<SummaryOut>> analyticsSummary({
|
||||
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/summary';
|
||||
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,
|
||||
);
|
||||
|
||||
SummaryOut? _responseData;
|
||||
|
||||
try {
|
||||
final rawData = _response.data;
|
||||
_responseData = rawData == null ? null : deserialize<SummaryOut, SummaryOut>(rawData, 'SummaryOut', growable: true);
|
||||
|
||||
} catch (error, stackTrace) {
|
||||
throw DioException(
|
||||
requestOptions: _response.requestOptions,
|
||||
response: _response,
|
||||
type: DioExceptionType.unknown,
|
||||
error: error,
|
||||
stackTrace: stackTrace,
|
||||
);
|
||||
}
|
||||
|
||||
return Response<SummaryOut>(
|
||||
data: _responseData,
|
||||
headers: _response.headers,
|
||||
isRedirect: _response.isRedirect,
|
||||
requestOptions: _response.requestOptions,
|
||||
redirects: _response.redirects,
|
||||
statusCode: _response.statusCode,
|
||||
statusMessage: _response.statusMessage,
|
||||
extra: _response.extra,
|
||||
);
|
||||
}
|
||||
|
||||
/// Value Series
|
||||
/// Daily portfolio value; defaults to the last 365 days.
|
||||
///
|
||||
/// Parameters:
|
||||
/// * [scope] - all | account:<id> | portfolio:<id>
|
||||
/// * [from]
|
||||
/// * [to]
|
||||
/// * [cancelToken] - A [CancelToken] that can be used to cancel the operation
|
||||
/// * [headers] - Can be used to add additional headers to the request
|
||||
/// * [extras] - Can be used to add flags to the request
|
||||
/// * [validateStatus] - A [ValidateStatus] callback that can be used to determine request success based on the HTTP status of the response
|
||||
/// * [onSendProgress] - A [ProgressCallback] that can be used to get the send progress
|
||||
/// * [onReceiveProgress] - A [ProgressCallback] that can be used to get the receive progress
|
||||
///
|
||||
/// Returns a [Future] containing a [Response] with a [List<ValueDay>] as data
|
||||
/// Throws [DioException] if API call or serialization fails
|
||||
Future<Response<List<ValueDay>>> analyticsValueSeries({
|
||||
String? scope = 'all',
|
||||
DateTime? from,
|
||||
DateTime? to,
|
||||
CancelToken? cancelToken,
|
||||
Map<String, dynamic>? headers,
|
||||
Map<String, dynamic>? extra,
|
||||
ValidateStatus? validateStatus,
|
||||
ProgressCallback? onSendProgress,
|
||||
ProgressCallback? onReceiveProgress,
|
||||
}) async {
|
||||
final _path = r'/api/v1/analytics/value-series';
|
||||
final _options = Options(
|
||||
method: r'GET',
|
||||
headers: <String, dynamic>{
|
||||
...?headers,
|
||||
},
|
||||
extra: <String, dynamic>{
|
||||
'secure': <Map<String, String>>[
|
||||
{
|
||||
'type': 'http',
|
||||
'scheme': 'bearer',
|
||||
'name': 'HTTPBearer',
|
||||
},
|
||||
],
|
||||
...?extra,
|
||||
},
|
||||
validateStatus: validateStatus,
|
||||
);
|
||||
|
||||
final _queryParameters = <String, dynamic>{
|
||||
if (scope != null) r'scope': scope,
|
||||
if (from != null) r'from': from,
|
||||
if (to != null) r'to': to,
|
||||
};
|
||||
|
||||
final _response = await _dio.request<Object>(
|
||||
_path,
|
||||
options: _options,
|
||||
queryParameters: _queryParameters,
|
||||
cancelToken: cancelToken,
|
||||
onSendProgress: onSendProgress,
|
||||
onReceiveProgress: onReceiveProgress,
|
||||
);
|
||||
|
||||
List<ValueDay>? _responseData;
|
||||
|
||||
try {
|
||||
final rawData = _response.data;
|
||||
_responseData = rawData == null ? null : deserialize<List<ValueDay>, ValueDay>(rawData, 'List<ValueDay>', growable: true);
|
||||
|
||||
} catch (error, stackTrace) {
|
||||
throw DioException(
|
||||
requestOptions: _response.requestOptions,
|
||||
response: _response,
|
||||
type: DioExceptionType.unknown,
|
||||
error: error,
|
||||
stackTrace: stackTrace,
|
||||
);
|
||||
}
|
||||
|
||||
return Response<List<ValueDay>>(
|
||||
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,133 @@
|
||||
//
|
||||
// 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/event_kind.dart';
|
||||
import 'package:fintracker_api/src/model/event_page.dart';
|
||||
import 'package:fintracker_api/src/model/event_status.dart';
|
||||
import 'package:fintracker_api/src/model/problem.dart';
|
||||
|
||||
class EventsApi {
|
||||
|
||||
final Dio _dio;
|
||||
|
||||
const EventsApi(this._dio);
|
||||
|
||||
/// List
|
||||
/// One page of ledger events, newest first, with RUB amounts at each own date's rate.
|
||||
///
|
||||
/// Parameters:
|
||||
/// * [from]
|
||||
/// * [to]
|
||||
/// * [accountId]
|
||||
/// * [instrumentId]
|
||||
/// * [kind]
|
||||
/// * [status]
|
||||
/// * [externalFlow] - only the events XIRR reads as boundary flows
|
||||
/// * [q] - substring of description or ticker
|
||||
/// * [page]
|
||||
/// * [pageSize]
|
||||
/// * [cancelToken] - A [CancelToken] that can be used to cancel the operation
|
||||
/// * [headers] - Can be used to add additional headers to the request
|
||||
/// * [extras] - Can be used to add flags to the request
|
||||
/// * [validateStatus] - A [ValidateStatus] callback that can be used to determine request success based on the HTTP status of the response
|
||||
/// * [onSendProgress] - A [ProgressCallback] that can be used to get the send progress
|
||||
/// * [onReceiveProgress] - A [ProgressCallback] that can be used to get the receive progress
|
||||
///
|
||||
/// Returns a [Future] containing a [Response] with a [EventPage] as data
|
||||
/// Throws [DioException] if API call or serialization fails
|
||||
Future<Response<EventPage>> eventsList({
|
||||
DateTime? from,
|
||||
DateTime? to,
|
||||
int? accountId,
|
||||
int? instrumentId,
|
||||
EventKind? kind,
|
||||
EventStatus? status,
|
||||
bool? externalFlow,
|
||||
String? q,
|
||||
int? page = 1,
|
||||
int? pageSize = 50,
|
||||
CancelToken? cancelToken,
|
||||
Map<String, dynamic>? headers,
|
||||
Map<String, dynamic>? extra,
|
||||
ValidateStatus? validateStatus,
|
||||
ProgressCallback? onSendProgress,
|
||||
ProgressCallback? onReceiveProgress,
|
||||
}) async {
|
||||
final _path = r'/api/v1/events';
|
||||
final _options = Options(
|
||||
method: r'GET',
|
||||
headers: <String, dynamic>{
|
||||
...?headers,
|
||||
},
|
||||
extra: <String, dynamic>{
|
||||
'secure': <Map<String, String>>[
|
||||
{
|
||||
'type': 'http',
|
||||
'scheme': 'bearer',
|
||||
'name': 'HTTPBearer',
|
||||
},
|
||||
],
|
||||
...?extra,
|
||||
},
|
||||
validateStatus: validateStatus,
|
||||
);
|
||||
|
||||
final _queryParameters = <String, dynamic>{
|
||||
if (from != null) r'from': from,
|
||||
if (to != null) r'to': to,
|
||||
if (accountId != null) r'account_id': accountId,
|
||||
if (instrumentId != null) r'instrument_id': instrumentId,
|
||||
if (kind != null) r'kind': kind,
|
||||
if (status != null) r'status': status,
|
||||
if (externalFlow != null) r'external_flow': externalFlow,
|
||||
if (q != null) r'q': q,
|
||||
if (page != null) r'page': page,
|
||||
if (pageSize != null) r'page_size': pageSize,
|
||||
};
|
||||
|
||||
final _response = await _dio.request<Object>(
|
||||
_path,
|
||||
options: _options,
|
||||
queryParameters: _queryParameters,
|
||||
cancelToken: cancelToken,
|
||||
onSendProgress: onSendProgress,
|
||||
onReceiveProgress: onReceiveProgress,
|
||||
);
|
||||
|
||||
EventPage? _responseData;
|
||||
|
||||
try {
|
||||
final rawData = _response.data;
|
||||
_responseData = rawData == null ? null : deserialize<EventPage, EventPage>(rawData, 'EventPage', growable: true);
|
||||
|
||||
} catch (error, stackTrace) {
|
||||
throw DioException(
|
||||
requestOptions: _response.requestOptions,
|
||||
response: _response,
|
||||
type: DioExceptionType.unknown,
|
||||
error: error,
|
||||
stackTrace: stackTrace,
|
||||
);
|
||||
}
|
||||
|
||||
return Response<EventPage>(
|
||||
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,202 @@
|
||||
//
|
||||
// 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/instrument_detail.dart';
|
||||
import 'package:fintracker_api/src/model/instrument_out.dart';
|
||||
import 'package:fintracker_api/src/model/problem.dart';
|
||||
|
||||
class InstrumentsApi {
|
||||
|
||||
final Dio _dio;
|
||||
|
||||
const InstrumentsApi(this._dio);
|
||||
|
||||
/// Get
|
||||
/// One instrument with its position, open lots, events and price history.
|
||||
///
|
||||
/// Parameters:
|
||||
/// * [instrumentId]
|
||||
/// * [scope] - all | account:<id> | portfolio:<id>
|
||||
/// * [pricesFrom]
|
||||
/// * [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 [InstrumentDetail] as data
|
||||
/// Throws [DioException] if API call or serialization fails
|
||||
Future<Response<InstrumentDetail>> instrumentsGet({
|
||||
required int instrumentId,
|
||||
String? scope = 'all',
|
||||
DateTime? pricesFrom,
|
||||
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}'.replaceAll('{' r'instrument_id' '}', instrumentId.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 (scope != null) r'scope': scope,
|
||||
if (pricesFrom != null) r'prices_from': pricesFrom,
|
||||
};
|
||||
|
||||
final _response = await _dio.request<Object>(
|
||||
_path,
|
||||
options: _options,
|
||||
queryParameters: _queryParameters,
|
||||
cancelToken: cancelToken,
|
||||
onSendProgress: onSendProgress,
|
||||
onReceiveProgress: onReceiveProgress,
|
||||
);
|
||||
|
||||
InstrumentDetail? _responseData;
|
||||
|
||||
try {
|
||||
final rawData = _response.data;
|
||||
_responseData = rawData == null ? null : deserialize<InstrumentDetail, InstrumentDetail>(rawData, 'InstrumentDetail', growable: true);
|
||||
|
||||
} catch (error, stackTrace) {
|
||||
throw DioException(
|
||||
requestOptions: _response.requestOptions,
|
||||
response: _response,
|
||||
type: DioExceptionType.unknown,
|
||||
error: error,
|
||||
stackTrace: stackTrace,
|
||||
);
|
||||
}
|
||||
|
||||
return Response<InstrumentDetail>(
|
||||
data: _responseData,
|
||||
headers: _response.headers,
|
||||
isRedirect: _response.isRedirect,
|
||||
requestOptions: _response.requestOptions,
|
||||
redirects: _response.redirects,
|
||||
statusCode: _response.statusCode,
|
||||
statusMessage: _response.statusMessage,
|
||||
extra: _response.extra,
|
||||
);
|
||||
}
|
||||
|
||||
/// List
|
||||
///
|
||||
///
|
||||
/// Parameters:
|
||||
/// * [q] - substring of ticker, name or ISIN
|
||||
/// * [assetClass] - share | bond | etf | fund | currency | index | …
|
||||
/// * [heldOnly] - only instruments with an open lot
|
||||
/// * [limit]
|
||||
/// * [cancelToken] - A [CancelToken] that can be used to cancel the operation
|
||||
/// * [headers] - Can be used to add additional headers to the request
|
||||
/// * [extras] - Can be used to add flags to the request
|
||||
/// * [validateStatus] - A [ValidateStatus] callback that can be used to determine request success based on the HTTP status of the response
|
||||
/// * [onSendProgress] - A [ProgressCallback] that can be used to get the send progress
|
||||
/// * [onReceiveProgress] - A [ProgressCallback] that can be used to get the receive progress
|
||||
///
|
||||
/// Returns a [Future] containing a [Response] with a [List<InstrumentOut>] as data
|
||||
/// Throws [DioException] if API call or serialization fails
|
||||
Future<Response<List<InstrumentOut>>> instrumentsList({
|
||||
String? q,
|
||||
String? assetClass,
|
||||
bool? heldOnly = false,
|
||||
int? limit = 100,
|
||||
CancelToken? cancelToken,
|
||||
Map<String, dynamic>? headers,
|
||||
Map<String, dynamic>? extra,
|
||||
ValidateStatus? validateStatus,
|
||||
ProgressCallback? onSendProgress,
|
||||
ProgressCallback? onReceiveProgress,
|
||||
}) async {
|
||||
final _path = r'/api/v1/instruments';
|
||||
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 (q != null) r'q': q,
|
||||
if (assetClass != null) r'asset_class': assetClass,
|
||||
if (heldOnly != null) r'held_only': heldOnly,
|
||||
if (limit != null) r'limit': limit,
|
||||
};
|
||||
|
||||
final _response = await _dio.request<Object>(
|
||||
_path,
|
||||
options: _options,
|
||||
queryParameters: _queryParameters,
|
||||
cancelToken: cancelToken,
|
||||
onSendProgress: onSendProgress,
|
||||
onReceiveProgress: onReceiveProgress,
|
||||
);
|
||||
|
||||
List<InstrumentOut>? _responseData;
|
||||
|
||||
try {
|
||||
final rawData = _response.data;
|
||||
_responseData = rawData == null ? null : deserialize<List<InstrumentOut>, InstrumentOut>(rawData, 'List<InstrumentOut>', growable: true);
|
||||
|
||||
} catch (error, stackTrace) {
|
||||
throw DioException(
|
||||
requestOptions: _response.requestOptions,
|
||||
response: _response,
|
||||
type: DioExceptionType.unknown,
|
||||
error: error,
|
||||
stackTrace: stackTrace,
|
||||
);
|
||||
}
|
||||
|
||||
return Response<List<InstrumentOut>>(
|
||||
data: _responseData,
|
||||
headers: _response.headers,
|
||||
isRedirect: _response.isRedirect,
|
||||
requestOptions: _response.requestOptions,
|
||||
redirects: _response.redirects,
|
||||
statusCode: _response.statusCode,
|
||||
statusMessage: _response.statusMessage,
|
||||
extra: _response.extra,
|
||||
);
|
||||
}
|
||||
|
||||
}
|
||||
@@ -1,28 +1,40 @@
|
||||
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/allocation_bucket.dart';
|
||||
import 'package:fintracker_api/src/model/cash_flow_month.dart';
|
||||
import 'package:fintracker_api/src/model/category_out.dart';
|
||||
import 'package:fintracker_api/src/model/data_quality_row.dart';
|
||||
import 'package:fintracker_api/src/model/event_out.dart';
|
||||
import 'package:fintracker_api/src/model/event_page.dart';
|
||||
import 'package:fintracker_api/src/model/health.dart';
|
||||
import 'package:fintracker_api/src/model/holding_out.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/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/price_point.dart';
|
||||
import 'package:fintracker_api/src/model/problem.dart';
|
||||
import 'package:fintracker_api/src/model/refresh_log_out.dart';
|
||||
import 'package:fintracker_api/src/model/refresh_request.dart';
|
||||
import 'package:fintracker_api/src/model/returns_out.dart';
|
||||
import 'package:fintracker_api/src/model/rule_create.dart';
|
||||
import 'package:fintracker_api/src/model/rule_out.dart';
|
||||
import 'package:fintracker_api/src/model/rule_patch.dart';
|
||||
import 'package:fintracker_api/src/model/runway_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/token_pair.dart';
|
||||
import 'package:fintracker_api/src/model/transaction_out.dart';
|
||||
import 'package:fintracker_api/src/model/transaction_page.dart';
|
||||
import 'package:fintracker_api/src/model/user_out.dart';
|
||||
import 'package:fintracker_api/src/model/value_day.dart';
|
||||
|
||||
final _regList = RegExp(r'^List<(.*)>$');
|
||||
final _regSet = RegExp(r'^Set<(.*)>$');
|
||||
@@ -54,6 +66,11 @@ final _regMap = RegExp(r'^Map<String,(.*)>$');
|
||||
case 'AccountRole':
|
||||
|
||||
|
||||
case 'AllocationBucket':
|
||||
return AllocationBucket.fromJson(value as Map<String, dynamic>) as ReturnType;
|
||||
case 'AllocationDimension':
|
||||
|
||||
|
||||
case 'Broker':
|
||||
|
||||
|
||||
@@ -63,29 +80,51 @@ final _regMap = RegExp(r'^Map<String,(.*)>$');
|
||||
return CategoryOut.fromJson(value as Map<String, dynamic>) as ReturnType;
|
||||
case 'DataQualityRow':
|
||||
return DataQualityRow.fromJson(value as Map<String, dynamic>) as ReturnType;
|
||||
case 'EventKind':
|
||||
|
||||
|
||||
case 'EventOut':
|
||||
return EventOut.fromJson(value as Map<String, dynamic>) as ReturnType;
|
||||
case 'EventPage':
|
||||
return EventPage.fromJson(value as Map<String, dynamic>) as ReturnType;
|
||||
case 'EventSource':
|
||||
|
||||
|
||||
case 'EventStatus':
|
||||
|
||||
|
||||
case 'FlowType':
|
||||
|
||||
|
||||
case 'Health':
|
||||
return Health.fromJson(value as Map<String, dynamic>) as ReturnType;
|
||||
case 'HoldingOut':
|
||||
return HoldingOut.fromJson(value as Map<String, dynamic>) as ReturnType;
|
||||
case 'InstrumentDetail':
|
||||
return InstrumentDetail.fromJson(value as Map<String, dynamic>) as ReturnType;
|
||||
case 'InstrumentOut':
|
||||
return InstrumentOut.fromJson(value as Map<String, dynamic>) as ReturnType;
|
||||
case 'JobStatus':
|
||||
|
||||
|
||||
case 'LoginRequest':
|
||||
return LoginRequest.fromJson(value as Map<String, dynamic>) as ReturnType;
|
||||
case 'LotOut':
|
||||
return LotOut.fromJson(value as Map<String, dynamic>) as ReturnType;
|
||||
case 'NetWorthBreakdown':
|
||||
return NetWorthBreakdown.fromJson(value as Map<String, dynamic>) as ReturnType;
|
||||
case 'NetWorthDay':
|
||||
return NetWorthDay.fromJson(value as Map<String, dynamic>) as ReturnType;
|
||||
case 'PricePoint':
|
||||
return PricePoint.fromJson(value as Map<String, dynamic>) as ReturnType;
|
||||
case 'Problem':
|
||||
return Problem.fromJson(value as Map<String, dynamic>) as ReturnType;
|
||||
case 'RefreshLogOut':
|
||||
return RefreshLogOut.fromJson(value as Map<String, dynamic>) as ReturnType;
|
||||
case 'RefreshRequest':
|
||||
return RefreshRequest.fromJson(value as Map<String, dynamic>) as ReturnType;
|
||||
case 'ReturnsOut':
|
||||
return ReturnsOut.fromJson(value as Map<String, dynamic>) as ReturnType;
|
||||
case 'RuleCreate':
|
||||
return RuleCreate.fromJson(value as Map<String, dynamic>) as ReturnType;
|
||||
case 'RuleKind':
|
||||
@@ -103,10 +142,14 @@ final _regMap = RegExp(r'^Map<String,(.*)>$');
|
||||
|
||||
case 'RunwayOut':
|
||||
return RunwayOut.fromJson(value as Map<String, dynamic>) as ReturnType;
|
||||
case 'ScopeOut':
|
||||
return ScopeOut.fromJson(value as Map<String, dynamic>) as ReturnType;
|
||||
case 'SourceStatus':
|
||||
return SourceStatus.fromJson(value as Map<String, dynamic>) as ReturnType;
|
||||
case 'SpendingRow':
|
||||
return SpendingRow.fromJson(value as Map<String, dynamic>) as ReturnType;
|
||||
case 'SummaryOut':
|
||||
return SummaryOut.fromJson(value as Map<String, dynamic>) as ReturnType;
|
||||
case 'SyncJobOut':
|
||||
return SyncJobOut.fromJson(value as Map<String, dynamic>) as ReturnType;
|
||||
case 'SyncRunOut':
|
||||
@@ -119,6 +162,8 @@ final _regMap = RegExp(r'^Map<String,(.*)>$');
|
||||
return TransactionPage.fromJson(value as Map<String, dynamic>) as ReturnType;
|
||||
case 'UserOut':
|
||||
return UserOut.fromJson(value as Map<String, dynamic>) as ReturnType;
|
||||
case 'ValueDay':
|
||||
return ValueDay.fromJson(value as Map<String, dynamic>) as ReturnType;
|
||||
default:
|
||||
RegExpMatch? match;
|
||||
|
||||
|
||||
@@ -0,0 +1,126 @@
|
||||
//
|
||||
// AUTO-GENERATED FILE, DO NOT MODIFY!
|
||||
//
|
||||
|
||||
// ignore_for_file: unused_element
|
||||
import 'package:fintracker_api/src/model/allocation_dimension.dart';
|
||||
import 'package:copy_with_extension/copy_with_extension.dart';
|
||||
import 'package:json_annotation/json_annotation.dart';
|
||||
|
||||
part 'allocation_bucket.g.dart';
|
||||
|
||||
|
||||
@CopyWith()
|
||||
@JsonSerializable(
|
||||
checked: true,
|
||||
createToJson: true,
|
||||
disallowUnrecognizedKeys: false,
|
||||
explicitToJson: true,
|
||||
)
|
||||
class AllocationBucket {
|
||||
/// Returns a new [AllocationBucket] instance.
|
||||
AllocationBucket({
|
||||
|
||||
required this.bucket,
|
||||
|
||||
required this.dimension,
|
||||
|
||||
required this.holdingCount,
|
||||
|
||||
required this.valueRub,
|
||||
|
||||
required this.weight,
|
||||
});
|
||||
|
||||
@JsonKey(
|
||||
|
||||
name: r'bucket',
|
||||
required: true,
|
||||
includeIfNull: false,
|
||||
)
|
||||
|
||||
|
||||
final String bucket;
|
||||
|
||||
|
||||
|
||||
@JsonKey(
|
||||
|
||||
name: r'dimension',
|
||||
required: true,
|
||||
includeIfNull: false,
|
||||
unknownEnumValue: AllocationDimension.unknownDefaultOpenApi,
|
||||
)
|
||||
|
||||
|
||||
final AllocationDimension dimension;
|
||||
|
||||
|
||||
|
||||
@JsonKey(
|
||||
|
||||
name: r'holding_count',
|
||||
required: true,
|
||||
includeIfNull: false,
|
||||
)
|
||||
|
||||
|
||||
final int holdingCount;
|
||||
|
||||
|
||||
|
||||
/// decimal as string
|
||||
@JsonKey(
|
||||
|
||||
name: r'value_rub',
|
||||
required: true,
|
||||
includeIfNull: false,
|
||||
)
|
||||
|
||||
|
||||
final String valueRub;
|
||||
|
||||
|
||||
|
||||
/// decimal as string
|
||||
@JsonKey(
|
||||
|
||||
name: r'weight',
|
||||
required: true,
|
||||
includeIfNull: false,
|
||||
)
|
||||
|
||||
|
||||
final String weight;
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
@override
|
||||
bool operator ==(Object other) => identical(this, other) || other is AllocationBucket &&
|
||||
other.bucket == bucket &&
|
||||
other.dimension == dimension &&
|
||||
other.holdingCount == holdingCount &&
|
||||
other.valueRub == valueRub &&
|
||||
other.weight == weight;
|
||||
|
||||
@override
|
||||
int get hashCode =>
|
||||
bucket.hashCode +
|
||||
dimension.hashCode +
|
||||
holdingCount.hashCode +
|
||||
valueRub.hashCode +
|
||||
weight.hashCode;
|
||||
|
||||
factory AllocationBucket.fromJson(Map<String, dynamic> json) => _$AllocationBucketFromJson(json);
|
||||
|
||||
Map<String, dynamic> toJson() => _$AllocationBucketToJson(this);
|
||||
|
||||
@override
|
||||
String toString() {
|
||||
return toJson().toString();
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -0,0 +1,157 @@
|
||||
// GENERATED CODE - DO NOT MODIFY BY HAND
|
||||
|
||||
part of 'allocation_bucket.dart';
|
||||
|
||||
// **************************************************************************
|
||||
// CopyWithGenerator
|
||||
// **************************************************************************
|
||||
|
||||
abstract class _$AllocationBucketCWProxy {
|
||||
AllocationBucket bucket(String bucket);
|
||||
|
||||
AllocationBucket dimension(AllocationDimension dimension);
|
||||
|
||||
AllocationBucket holdingCount(int holdingCount);
|
||||
|
||||
AllocationBucket valueRub(String valueRub);
|
||||
|
||||
AllocationBucket weight(String weight);
|
||||
|
||||
/// This function **does support** nullification of nullable fields. All `null` values passed to `non-nullable` fields will be ignored. You can also use `AllocationBucket(...).copyWith.fieldName(...)` to override fields one at a time with nullification support.
|
||||
///
|
||||
/// Usage
|
||||
/// ```dart
|
||||
/// AllocationBucket(...).copyWith(id: 12, name: "My name")
|
||||
/// ````
|
||||
AllocationBucket call({
|
||||
String bucket,
|
||||
AllocationDimension dimension,
|
||||
int holdingCount,
|
||||
String valueRub,
|
||||
String weight,
|
||||
});
|
||||
}
|
||||
|
||||
/// Proxy class for `copyWith` functionality. This is a callable class and can be used as follows: `instanceOfAllocationBucket.copyWith(...)`. Additionally contains functions for specific fields e.g. `instanceOfAllocationBucket.copyWith.fieldName(...)`
|
||||
class _$AllocationBucketCWProxyImpl implements _$AllocationBucketCWProxy {
|
||||
const _$AllocationBucketCWProxyImpl(this._value);
|
||||
|
||||
final AllocationBucket _value;
|
||||
|
||||
@override
|
||||
AllocationBucket bucket(String bucket) => this(bucket: bucket);
|
||||
|
||||
@override
|
||||
AllocationBucket dimension(AllocationDimension dimension) =>
|
||||
this(dimension: dimension);
|
||||
|
||||
@override
|
||||
AllocationBucket holdingCount(int holdingCount) =>
|
||||
this(holdingCount: holdingCount);
|
||||
|
||||
@override
|
||||
AllocationBucket valueRub(String valueRub) => this(valueRub: valueRub);
|
||||
|
||||
@override
|
||||
AllocationBucket weight(String weight) => this(weight: weight);
|
||||
|
||||
@override
|
||||
/// This function **does support** nullification of nullable fields. All `null` values passed to `non-nullable` fields will be ignored. You can also use `AllocationBucket(...).copyWith.fieldName(...)` to override fields one at a time with nullification support.
|
||||
///
|
||||
/// Usage
|
||||
/// ```dart
|
||||
/// AllocationBucket(...).copyWith(id: 12, name: "My name")
|
||||
/// ````
|
||||
AllocationBucket call({
|
||||
Object? bucket = const $CopyWithPlaceholder(),
|
||||
Object? dimension = const $CopyWithPlaceholder(),
|
||||
Object? holdingCount = const $CopyWithPlaceholder(),
|
||||
Object? valueRub = const $CopyWithPlaceholder(),
|
||||
Object? weight = const $CopyWithPlaceholder(),
|
||||
}) {
|
||||
return AllocationBucket(
|
||||
bucket: bucket == const $CopyWithPlaceholder()
|
||||
? _value.bucket
|
||||
// ignore: cast_nullable_to_non_nullable
|
||||
: bucket as String,
|
||||
dimension: dimension == const $CopyWithPlaceholder()
|
||||
? _value.dimension
|
||||
// ignore: cast_nullable_to_non_nullable
|
||||
: dimension as AllocationDimension,
|
||||
holdingCount: holdingCount == const $CopyWithPlaceholder()
|
||||
? _value.holdingCount
|
||||
// ignore: cast_nullable_to_non_nullable
|
||||
: holdingCount as int,
|
||||
valueRub: valueRub == const $CopyWithPlaceholder()
|
||||
? _value.valueRub
|
||||
// ignore: cast_nullable_to_non_nullable
|
||||
: valueRub as String,
|
||||
weight: weight == const $CopyWithPlaceholder()
|
||||
? _value.weight
|
||||
// ignore: cast_nullable_to_non_nullable
|
||||
: weight as String,
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
extension $AllocationBucketCopyWith on AllocationBucket {
|
||||
/// Returns a callable class that can be used as follows: `instanceOfAllocationBucket.copyWith(...)` or like so:`instanceOfAllocationBucket.copyWith.fieldName(...)`.
|
||||
// ignore: library_private_types_in_public_api
|
||||
_$AllocationBucketCWProxy get copyWith => _$AllocationBucketCWProxyImpl(this);
|
||||
}
|
||||
|
||||
// **************************************************************************
|
||||
// JsonSerializableGenerator
|
||||
// **************************************************************************
|
||||
|
||||
AllocationBucket _$AllocationBucketFromJson(
|
||||
Map<String, dynamic> json,
|
||||
) => $checkedCreate(
|
||||
'AllocationBucket',
|
||||
json,
|
||||
($checkedConvert) {
|
||||
$checkKeys(
|
||||
json,
|
||||
requiredKeys: const [
|
||||
'bucket',
|
||||
'dimension',
|
||||
'holding_count',
|
||||
'value_rub',
|
||||
'weight',
|
||||
],
|
||||
);
|
||||
final val = AllocationBucket(
|
||||
bucket: $checkedConvert('bucket', (v) => v as String),
|
||||
dimension: $checkedConvert(
|
||||
'dimension',
|
||||
(v) => $enumDecode(
|
||||
_$AllocationDimensionEnumMap,
|
||||
v,
|
||||
unknownValue: AllocationDimension.unknownDefaultOpenApi,
|
||||
),
|
||||
),
|
||||
holdingCount: $checkedConvert('holding_count', (v) => (v as num).toInt()),
|
||||
valueRub: $checkedConvert('value_rub', (v) => v as String),
|
||||
weight: $checkedConvert('weight', (v) => v as String),
|
||||
);
|
||||
return val;
|
||||
},
|
||||
fieldKeyMap: const {'holdingCount': 'holding_count', 'valueRub': 'value_rub'},
|
||||
);
|
||||
|
||||
Map<String, dynamic> _$AllocationBucketToJson(AllocationBucket instance) =>
|
||||
<String, dynamic>{
|
||||
'bucket': instance.bucket,
|
||||
'dimension': _$AllocationDimensionEnumMap[instance.dimension]!,
|
||||
'holding_count': instance.holdingCount,
|
||||
'value_rub': instance.valueRub,
|
||||
'weight': instance.weight,
|
||||
};
|
||||
|
||||
const _$AllocationDimensionEnumMap = {
|
||||
AllocationDimension.assetClass: 'asset_class',
|
||||
AllocationDimension.sector: 'sector',
|
||||
AllocationDimension.country: 'country',
|
||||
AllocationDimension.currency: 'currency',
|
||||
AllocationDimension.unknownDefaultOpenApi: 'unknown_default_open_api',
|
||||
};
|
||||
@@ -0,0 +1,27 @@
|
||||
//
|
||||
// AUTO-GENERATED FILE, DO NOT MODIFY!
|
||||
//
|
||||
|
||||
// ignore_for_file: unused_element
|
||||
import 'package:json_annotation/json_annotation.dart';
|
||||
|
||||
/// How a portfolio can be sliced. Every dimension covers the SAME total — securities plus cash — so the weights of any one of them add up to 1 and the charts agree.
|
||||
enum AllocationDimension {
|
||||
@JsonValue(r'asset_class')
|
||||
assetClass(r'asset_class'),
|
||||
@JsonValue(r'sector')
|
||||
sector(r'sector'),
|
||||
@JsonValue(r'country')
|
||||
country(r'country'),
|
||||
@JsonValue(r'currency')
|
||||
currency(r'currency'),
|
||||
@JsonValue(r'unknown_default_open_api')
|
||||
unknownDefaultOpenApi(r'unknown_default_open_api');
|
||||
|
||||
const AllocationDimension(this.value);
|
||||
|
||||
final String value;
|
||||
|
||||
@override
|
||||
String toString() => value;
|
||||
}
|
||||
@@ -0,0 +1,52 @@
|
||||
//
|
||||
// AUTO-GENERATED FILE, DO NOT MODIFY!
|
||||
//
|
||||
|
||||
// ignore_for_file: unused_element
|
||||
import 'package:json_annotation/json_annotation.dart';
|
||||
|
||||
enum EventKind {
|
||||
@JsonValue(r'buy')
|
||||
buy(r'buy'),
|
||||
@JsonValue(r'sell')
|
||||
sell(r'sell'),
|
||||
@JsonValue(r'dividend')
|
||||
dividend(r'dividend'),
|
||||
@JsonValue(r'coupon')
|
||||
coupon(r'coupon'),
|
||||
@JsonValue(r'interest')
|
||||
interest(r'interest'),
|
||||
@JsonValue(r'tax')
|
||||
tax(r'tax'),
|
||||
@JsonValue(r'tax_refund')
|
||||
taxRefund(r'tax_refund'),
|
||||
@JsonValue(r'commission')
|
||||
commission(r'commission'),
|
||||
@JsonValue(r'deposit')
|
||||
deposit(r'deposit'),
|
||||
@JsonValue(r'withdrawal')
|
||||
withdrawal(r'withdrawal'),
|
||||
@JsonValue(r'transfer_in')
|
||||
transferIn(r'transfer_in'),
|
||||
@JsonValue(r'transfer_out')
|
||||
transferOut(r'transfer_out'),
|
||||
@JsonValue(r'split')
|
||||
split(r'split'),
|
||||
@JsonValue(r'amortization')
|
||||
amortization(r'amortization'),
|
||||
@JsonValue(r'repayment')
|
||||
repayment(r'repayment'),
|
||||
@JsonValue(r'fx_exchange')
|
||||
fxExchange(r'fx_exchange'),
|
||||
@JsonValue(r'other')
|
||||
other(r'other'),
|
||||
@JsonValue(r'unknown_default_open_api')
|
||||
unknownDefaultOpenApi(r'unknown_default_open_api');
|
||||
|
||||
const EventKind(this.value);
|
||||
|
||||
final String value;
|
||||
|
||||
@override
|
||||
String toString() => value;
|
||||
}
|
||||
@@ -0,0 +1,357 @@
|
||||
//
|
||||
// AUTO-GENERATED FILE, DO NOT MODIFY!
|
||||
//
|
||||
|
||||
// ignore_for_file: unused_element
|
||||
import 'package:fintracker_api/src/model/event_status.dart';
|
||||
import 'package:fintracker_api/src/model/event_kind.dart';
|
||||
import 'package:copy_with_extension/copy_with_extension.dart';
|
||||
import 'package:json_annotation/json_annotation.dart';
|
||||
|
||||
part 'event_out.g.dart';
|
||||
|
||||
|
||||
@CopyWith()
|
||||
@JsonSerializable(
|
||||
checked: true,
|
||||
createToJson: true,
|
||||
disallowUnrecognizedKeys: false,
|
||||
explicitToJson: true,
|
||||
)
|
||||
class EventOut {
|
||||
/// Returns a new [EventOut] instance.
|
||||
EventOut({
|
||||
|
||||
required this.accountId,
|
||||
|
||||
required this.accruedInterest,
|
||||
|
||||
required this.amount,
|
||||
|
||||
required this.amountRub,
|
||||
|
||||
required this.currency,
|
||||
|
||||
required this.description,
|
||||
|
||||
required this.externalFlow,
|
||||
|
||||
required this.fee,
|
||||
|
||||
required this.id,
|
||||
|
||||
required this.instrumentId,
|
||||
|
||||
required this.kind,
|
||||
|
||||
required this.price,
|
||||
|
||||
required this.priceCurrency,
|
||||
|
||||
required this.quantity,
|
||||
|
||||
required this.status,
|
||||
|
||||
required this.tax,
|
||||
|
||||
required this.ticker,
|
||||
|
||||
required this.tradeDate,
|
||||
|
||||
required this.ts,
|
||||
});
|
||||
|
||||
@JsonKey(
|
||||
|
||||
name: r'account_id',
|
||||
required: true,
|
||||
includeIfNull: false,
|
||||
)
|
||||
|
||||
|
||||
final int accountId;
|
||||
|
||||
|
||||
|
||||
/// decimal as string
|
||||
@JsonKey(
|
||||
|
||||
name: r'accrued_interest',
|
||||
required: true,
|
||||
includeIfNull: true,
|
||||
)
|
||||
|
||||
|
||||
final String? accruedInterest;
|
||||
|
||||
|
||||
|
||||
/// 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'description',
|
||||
required: true,
|
||||
includeIfNull: true,
|
||||
)
|
||||
|
||||
|
||||
final String? description;
|
||||
|
||||
|
||||
|
||||
@JsonKey(
|
||||
|
||||
name: r'external_flow',
|
||||
required: true,
|
||||
includeIfNull: false,
|
||||
)
|
||||
|
||||
|
||||
final bool externalFlow;
|
||||
|
||||
|
||||
|
||||
/// decimal as string
|
||||
@JsonKey(
|
||||
|
||||
name: r'fee',
|
||||
required: true,
|
||||
includeIfNull: true,
|
||||
)
|
||||
|
||||
|
||||
final String? fee;
|
||||
|
||||
|
||||
|
||||
@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'kind',
|
||||
required: true,
|
||||
includeIfNull: false,
|
||||
unknownEnumValue: EventKind.unknownDefaultOpenApi,
|
||||
)
|
||||
|
||||
|
||||
final EventKind kind;
|
||||
|
||||
|
||||
|
||||
/// decimal as string
|
||||
@JsonKey(
|
||||
|
||||
name: r'price',
|
||||
required: true,
|
||||
includeIfNull: true,
|
||||
)
|
||||
|
||||
|
||||
final String? price;
|
||||
|
||||
|
||||
|
||||
@JsonKey(
|
||||
|
||||
name: r'price_currency',
|
||||
required: true,
|
||||
includeIfNull: true,
|
||||
)
|
||||
|
||||
|
||||
final String? priceCurrency;
|
||||
|
||||
|
||||
|
||||
/// decimal as string
|
||||
@JsonKey(
|
||||
|
||||
name: r'quantity',
|
||||
required: true,
|
||||
includeIfNull: true,
|
||||
)
|
||||
|
||||
|
||||
final String? quantity;
|
||||
|
||||
|
||||
|
||||
@JsonKey(
|
||||
|
||||
name: r'status',
|
||||
required: true,
|
||||
includeIfNull: false,
|
||||
unknownEnumValue: EventStatus.unknownDefaultOpenApi,
|
||||
)
|
||||
|
||||
|
||||
final EventStatus status;
|
||||
|
||||
|
||||
|
||||
/// decimal as string
|
||||
@JsonKey(
|
||||
|
||||
name: r'tax',
|
||||
required: true,
|
||||
includeIfNull: true,
|
||||
)
|
||||
|
||||
|
||||
final String? tax;
|
||||
|
||||
|
||||
|
||||
@JsonKey(
|
||||
|
||||
name: r'ticker',
|
||||
required: true,
|
||||
includeIfNull: true,
|
||||
)
|
||||
|
||||
|
||||
final String? ticker;
|
||||
|
||||
|
||||
|
||||
@JsonKey(
|
||||
|
||||
name: r'trade_date',
|
||||
required: true,
|
||||
includeIfNull: false,
|
||||
)
|
||||
|
||||
|
||||
final DateTime tradeDate;
|
||||
|
||||
|
||||
|
||||
@JsonKey(
|
||||
|
||||
name: r'ts',
|
||||
required: true,
|
||||
includeIfNull: false,
|
||||
)
|
||||
|
||||
|
||||
final DateTime ts;
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
@override
|
||||
bool operator ==(Object other) => identical(this, other) || other is EventOut &&
|
||||
other.accountId == accountId &&
|
||||
other.accruedInterest == accruedInterest &&
|
||||
other.amount == amount &&
|
||||
other.amountRub == amountRub &&
|
||||
other.currency == currency &&
|
||||
other.description == description &&
|
||||
other.externalFlow == externalFlow &&
|
||||
other.fee == fee &&
|
||||
other.id == id &&
|
||||
other.instrumentId == instrumentId &&
|
||||
other.kind == kind &&
|
||||
other.price == price &&
|
||||
other.priceCurrency == priceCurrency &&
|
||||
other.quantity == quantity &&
|
||||
other.status == status &&
|
||||
other.tax == tax &&
|
||||
other.ticker == ticker &&
|
||||
other.tradeDate == tradeDate &&
|
||||
other.ts == ts;
|
||||
|
||||
@override
|
||||
int get hashCode =>
|
||||
accountId.hashCode +
|
||||
(accruedInterest == null ? 0 : accruedInterest.hashCode) +
|
||||
amount.hashCode +
|
||||
(amountRub == null ? 0 : amountRub.hashCode) +
|
||||
currency.hashCode +
|
||||
(description == null ? 0 : description.hashCode) +
|
||||
externalFlow.hashCode +
|
||||
(fee == null ? 0 : fee.hashCode) +
|
||||
id.hashCode +
|
||||
(instrumentId == null ? 0 : instrumentId.hashCode) +
|
||||
kind.hashCode +
|
||||
(price == null ? 0 : price.hashCode) +
|
||||
(priceCurrency == null ? 0 : priceCurrency.hashCode) +
|
||||
(quantity == null ? 0 : quantity.hashCode) +
|
||||
status.hashCode +
|
||||
(tax == null ? 0 : tax.hashCode) +
|
||||
(ticker == null ? 0 : ticker.hashCode) +
|
||||
tradeDate.hashCode +
|
||||
ts.hashCode;
|
||||
|
||||
factory EventOut.fromJson(Map<String, dynamic> json) => _$EventOutFromJson(json);
|
||||
|
||||
Map<String, dynamic> toJson() => _$EventOutToJson(this);
|
||||
|
||||
@override
|
||||
String toString() {
|
||||
return toJson().toString();
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -0,0 +1,392 @@
|
||||
// GENERATED CODE - DO NOT MODIFY BY HAND
|
||||
|
||||
part of 'event_out.dart';
|
||||
|
||||
// **************************************************************************
|
||||
// CopyWithGenerator
|
||||
// **************************************************************************
|
||||
|
||||
abstract class _$EventOutCWProxy {
|
||||
EventOut accountId(int accountId);
|
||||
|
||||
EventOut accruedInterest(String? accruedInterest);
|
||||
|
||||
EventOut amount(String amount);
|
||||
|
||||
EventOut amountRub(String? amountRub);
|
||||
|
||||
EventOut currency(String currency);
|
||||
|
||||
EventOut description(String? description);
|
||||
|
||||
EventOut externalFlow(bool externalFlow);
|
||||
|
||||
EventOut fee(String? fee);
|
||||
|
||||
EventOut id(int id);
|
||||
|
||||
EventOut instrumentId(int? instrumentId);
|
||||
|
||||
EventOut kind(EventKind kind);
|
||||
|
||||
EventOut price(String? price);
|
||||
|
||||
EventOut priceCurrency(String? priceCurrency);
|
||||
|
||||
EventOut quantity(String? quantity);
|
||||
|
||||
EventOut status(EventStatus status);
|
||||
|
||||
EventOut tax(String? tax);
|
||||
|
||||
EventOut ticker(String? ticker);
|
||||
|
||||
EventOut tradeDate(DateTime tradeDate);
|
||||
|
||||
EventOut ts(DateTime ts);
|
||||
|
||||
/// This function **does support** nullification of nullable fields. All `null` values passed to `non-nullable` fields will be ignored. You can also use `EventOut(...).copyWith.fieldName(...)` to override fields one at a time with nullification support.
|
||||
///
|
||||
/// Usage
|
||||
/// ```dart
|
||||
/// EventOut(...).copyWith(id: 12, name: "My name")
|
||||
/// ````
|
||||
EventOut call({
|
||||
int accountId,
|
||||
String? accruedInterest,
|
||||
String amount,
|
||||
String? amountRub,
|
||||
String currency,
|
||||
String? description,
|
||||
bool externalFlow,
|
||||
String? fee,
|
||||
int id,
|
||||
int? instrumentId,
|
||||
EventKind kind,
|
||||
String? price,
|
||||
String? priceCurrency,
|
||||
String? quantity,
|
||||
EventStatus status,
|
||||
String? tax,
|
||||
String? ticker,
|
||||
DateTime tradeDate,
|
||||
DateTime ts,
|
||||
});
|
||||
}
|
||||
|
||||
/// Proxy class for `copyWith` functionality. This is a callable class and can be used as follows: `instanceOfEventOut.copyWith(...)`. Additionally contains functions for specific fields e.g. `instanceOfEventOut.copyWith.fieldName(...)`
|
||||
class _$EventOutCWProxyImpl implements _$EventOutCWProxy {
|
||||
const _$EventOutCWProxyImpl(this._value);
|
||||
|
||||
final EventOut _value;
|
||||
|
||||
@override
|
||||
EventOut accountId(int accountId) => this(accountId: accountId);
|
||||
|
||||
@override
|
||||
EventOut accruedInterest(String? accruedInterest) =>
|
||||
this(accruedInterest: accruedInterest);
|
||||
|
||||
@override
|
||||
EventOut amount(String amount) => this(amount: amount);
|
||||
|
||||
@override
|
||||
EventOut amountRub(String? amountRub) => this(amountRub: amountRub);
|
||||
|
||||
@override
|
||||
EventOut currency(String currency) => this(currency: currency);
|
||||
|
||||
@override
|
||||
EventOut description(String? description) => this(description: description);
|
||||
|
||||
@override
|
||||
EventOut externalFlow(bool externalFlow) => this(externalFlow: externalFlow);
|
||||
|
||||
@override
|
||||
EventOut fee(String? fee) => this(fee: fee);
|
||||
|
||||
@override
|
||||
EventOut id(int id) => this(id: id);
|
||||
|
||||
@override
|
||||
EventOut instrumentId(int? instrumentId) => this(instrumentId: instrumentId);
|
||||
|
||||
@override
|
||||
EventOut kind(EventKind kind) => this(kind: kind);
|
||||
|
||||
@override
|
||||
EventOut price(String? price) => this(price: price);
|
||||
|
||||
@override
|
||||
EventOut priceCurrency(String? priceCurrency) =>
|
||||
this(priceCurrency: priceCurrency);
|
||||
|
||||
@override
|
||||
EventOut quantity(String? quantity) => this(quantity: quantity);
|
||||
|
||||
@override
|
||||
EventOut status(EventStatus status) => this(status: status);
|
||||
|
||||
@override
|
||||
EventOut tax(String? tax) => this(tax: tax);
|
||||
|
||||
@override
|
||||
EventOut ticker(String? ticker) => this(ticker: ticker);
|
||||
|
||||
@override
|
||||
EventOut tradeDate(DateTime tradeDate) => this(tradeDate: tradeDate);
|
||||
|
||||
@override
|
||||
EventOut ts(DateTime ts) => this(ts: ts);
|
||||
|
||||
@override
|
||||
/// This function **does support** nullification of nullable fields. All `null` values passed to `non-nullable` fields will be ignored. You can also use `EventOut(...).copyWith.fieldName(...)` to override fields one at a time with nullification support.
|
||||
///
|
||||
/// Usage
|
||||
/// ```dart
|
||||
/// EventOut(...).copyWith(id: 12, name: "My name")
|
||||
/// ````
|
||||
EventOut call({
|
||||
Object? accountId = const $CopyWithPlaceholder(),
|
||||
Object? accruedInterest = const $CopyWithPlaceholder(),
|
||||
Object? amount = const $CopyWithPlaceholder(),
|
||||
Object? amountRub = const $CopyWithPlaceholder(),
|
||||
Object? currency = const $CopyWithPlaceholder(),
|
||||
Object? description = const $CopyWithPlaceholder(),
|
||||
Object? externalFlow = const $CopyWithPlaceholder(),
|
||||
Object? fee = const $CopyWithPlaceholder(),
|
||||
Object? id = const $CopyWithPlaceholder(),
|
||||
Object? instrumentId = const $CopyWithPlaceholder(),
|
||||
Object? kind = const $CopyWithPlaceholder(),
|
||||
Object? price = const $CopyWithPlaceholder(),
|
||||
Object? priceCurrency = const $CopyWithPlaceholder(),
|
||||
Object? quantity = const $CopyWithPlaceholder(),
|
||||
Object? status = const $CopyWithPlaceholder(),
|
||||
Object? tax = const $CopyWithPlaceholder(),
|
||||
Object? ticker = const $CopyWithPlaceholder(),
|
||||
Object? tradeDate = const $CopyWithPlaceholder(),
|
||||
Object? ts = const $CopyWithPlaceholder(),
|
||||
}) {
|
||||
return EventOut(
|
||||
accountId: accountId == const $CopyWithPlaceholder()
|
||||
? _value.accountId
|
||||
// ignore: cast_nullable_to_non_nullable
|
||||
: accountId as int,
|
||||
accruedInterest: accruedInterest == const $CopyWithPlaceholder()
|
||||
? _value.accruedInterest
|
||||
// ignore: cast_nullable_to_non_nullable
|
||||
: accruedInterest as String?,
|
||||
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,
|
||||
description: description == const $CopyWithPlaceholder()
|
||||
? _value.description
|
||||
// ignore: cast_nullable_to_non_nullable
|
||||
: description as String?,
|
||||
externalFlow: externalFlow == const $CopyWithPlaceholder()
|
||||
? _value.externalFlow
|
||||
// ignore: cast_nullable_to_non_nullable
|
||||
: externalFlow as bool,
|
||||
fee: fee == const $CopyWithPlaceholder()
|
||||
? _value.fee
|
||||
// ignore: cast_nullable_to_non_nullable
|
||||
: fee as String?,
|
||||
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?,
|
||||
kind: kind == const $CopyWithPlaceholder()
|
||||
? _value.kind
|
||||
// ignore: cast_nullable_to_non_nullable
|
||||
: kind as EventKind,
|
||||
price: price == const $CopyWithPlaceholder()
|
||||
? _value.price
|
||||
// ignore: cast_nullable_to_non_nullable
|
||||
: price as String?,
|
||||
priceCurrency: priceCurrency == const $CopyWithPlaceholder()
|
||||
? _value.priceCurrency
|
||||
// ignore: cast_nullable_to_non_nullable
|
||||
: priceCurrency as String?,
|
||||
quantity: quantity == const $CopyWithPlaceholder()
|
||||
? _value.quantity
|
||||
// ignore: cast_nullable_to_non_nullable
|
||||
: quantity as String?,
|
||||
status: status == const $CopyWithPlaceholder()
|
||||
? _value.status
|
||||
// ignore: cast_nullable_to_non_nullable
|
||||
: status as EventStatus,
|
||||
tax: tax == const $CopyWithPlaceholder()
|
||||
? _value.tax
|
||||
// ignore: cast_nullable_to_non_nullable
|
||||
: tax as String?,
|
||||
ticker: ticker == const $CopyWithPlaceholder()
|
||||
? _value.ticker
|
||||
// ignore: cast_nullable_to_non_nullable
|
||||
: ticker as String?,
|
||||
tradeDate: tradeDate == const $CopyWithPlaceholder()
|
||||
? _value.tradeDate
|
||||
// ignore: cast_nullable_to_non_nullable
|
||||
: tradeDate as DateTime,
|
||||
ts: ts == const $CopyWithPlaceholder()
|
||||
? _value.ts
|
||||
// ignore: cast_nullable_to_non_nullable
|
||||
: ts as DateTime,
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
extension $EventOutCopyWith on EventOut {
|
||||
/// Returns a callable class that can be used as follows: `instanceOfEventOut.copyWith(...)` or like so:`instanceOfEventOut.copyWith.fieldName(...)`.
|
||||
// ignore: library_private_types_in_public_api
|
||||
_$EventOutCWProxy get copyWith => _$EventOutCWProxyImpl(this);
|
||||
}
|
||||
|
||||
// **************************************************************************
|
||||
// JsonSerializableGenerator
|
||||
// **************************************************************************
|
||||
|
||||
EventOut _$EventOutFromJson(Map<String, dynamic> json) => $checkedCreate(
|
||||
'EventOut',
|
||||
json,
|
||||
($checkedConvert) {
|
||||
$checkKeys(
|
||||
json,
|
||||
requiredKeys: const [
|
||||
'account_id',
|
||||
'accrued_interest',
|
||||
'amount',
|
||||
'amount_rub',
|
||||
'currency',
|
||||
'description',
|
||||
'external_flow',
|
||||
'fee',
|
||||
'id',
|
||||
'instrument_id',
|
||||
'kind',
|
||||
'price',
|
||||
'price_currency',
|
||||
'quantity',
|
||||
'status',
|
||||
'tax',
|
||||
'ticker',
|
||||
'trade_date',
|
||||
'ts',
|
||||
],
|
||||
);
|
||||
final val = EventOut(
|
||||
accountId: $checkedConvert('account_id', (v) => (v as num).toInt()),
|
||||
accruedInterest: $checkedConvert('accrued_interest', (v) => v as String?),
|
||||
amount: $checkedConvert('amount', (v) => v as String),
|
||||
amountRub: $checkedConvert('amount_rub', (v) => v as String?),
|
||||
currency: $checkedConvert('currency', (v) => v as String),
|
||||
description: $checkedConvert('description', (v) => v as String?),
|
||||
externalFlow: $checkedConvert('external_flow', (v) => v as bool),
|
||||
fee: $checkedConvert('fee', (v) => v as String?),
|
||||
id: $checkedConvert('id', (v) => (v as num).toInt()),
|
||||
instrumentId: $checkedConvert(
|
||||
'instrument_id',
|
||||
(v) => (v as num?)?.toInt(),
|
||||
),
|
||||
kind: $checkedConvert(
|
||||
'kind',
|
||||
(v) => $enumDecode(
|
||||
_$EventKindEnumMap,
|
||||
v,
|
||||
unknownValue: EventKind.unknownDefaultOpenApi,
|
||||
),
|
||||
),
|
||||
price: $checkedConvert('price', (v) => v as String?),
|
||||
priceCurrency: $checkedConvert('price_currency', (v) => v as String?),
|
||||
quantity: $checkedConvert('quantity', (v) => v as String?),
|
||||
status: $checkedConvert(
|
||||
'status',
|
||||
(v) => $enumDecode(
|
||||
_$EventStatusEnumMap,
|
||||
v,
|
||||
unknownValue: EventStatus.unknownDefaultOpenApi,
|
||||
),
|
||||
),
|
||||
tax: $checkedConvert('tax', (v) => v as String?),
|
||||
ticker: $checkedConvert('ticker', (v) => v as String?),
|
||||
tradeDate: $checkedConvert(
|
||||
'trade_date',
|
||||
(v) => DateTime.parse(v as String),
|
||||
),
|
||||
ts: $checkedConvert('ts', (v) => DateTime.parse(v as String)),
|
||||
);
|
||||
return val;
|
||||
},
|
||||
fieldKeyMap: const {
|
||||
'accountId': 'account_id',
|
||||
'accruedInterest': 'accrued_interest',
|
||||
'amountRub': 'amount_rub',
|
||||
'externalFlow': 'external_flow',
|
||||
'instrumentId': 'instrument_id',
|
||||
'priceCurrency': 'price_currency',
|
||||
'tradeDate': 'trade_date',
|
||||
},
|
||||
);
|
||||
|
||||
Map<String, dynamic> _$EventOutToJson(EventOut instance) => <String, dynamic>{
|
||||
'account_id': instance.accountId,
|
||||
'accrued_interest': instance.accruedInterest,
|
||||
'amount': instance.amount,
|
||||
'amount_rub': instance.amountRub,
|
||||
'currency': instance.currency,
|
||||
'description': instance.description,
|
||||
'external_flow': instance.externalFlow,
|
||||
'fee': instance.fee,
|
||||
'id': instance.id,
|
||||
'instrument_id': instance.instrumentId,
|
||||
'kind': _$EventKindEnumMap[instance.kind]!,
|
||||
'price': instance.price,
|
||||
'price_currency': instance.priceCurrency,
|
||||
'quantity': instance.quantity,
|
||||
'status': _$EventStatusEnumMap[instance.status]!,
|
||||
'tax': instance.tax,
|
||||
'ticker': instance.ticker,
|
||||
'trade_date': instance.tradeDate.toIso8601String(),
|
||||
'ts': instance.ts.toIso8601String(),
|
||||
};
|
||||
|
||||
const _$EventKindEnumMap = {
|
||||
EventKind.buy: 'buy',
|
||||
EventKind.sell: 'sell',
|
||||
EventKind.dividend: 'dividend',
|
||||
EventKind.coupon: 'coupon',
|
||||
EventKind.interest: 'interest',
|
||||
EventKind.tax: 'tax',
|
||||
EventKind.taxRefund: 'tax_refund',
|
||||
EventKind.commission: 'commission',
|
||||
EventKind.deposit: 'deposit',
|
||||
EventKind.withdrawal: 'withdrawal',
|
||||
EventKind.transferIn: 'transfer_in',
|
||||
EventKind.transferOut: 'transfer_out',
|
||||
EventKind.split: 'split',
|
||||
EventKind.amortization: 'amortization',
|
||||
EventKind.repayment: 'repayment',
|
||||
EventKind.fxExchange: 'fx_exchange',
|
||||
EventKind.other: 'other',
|
||||
EventKind.unknownDefaultOpenApi: 'unknown_default_open_api',
|
||||
};
|
||||
|
||||
const _$EventStatusEnumMap = {
|
||||
EventStatus.confirmed: 'confirmed',
|
||||
EventStatus.pending: 'pending',
|
||||
EventStatus.shadow: 'shadow',
|
||||
EventStatus.ignored: 'ignored',
|
||||
EventStatus.unknownDefaultOpenApi: 'unknown_default_open_api',
|
||||
};
|
||||
@@ -0,0 +1,107 @@
|
||||
//
|
||||
// AUTO-GENERATED FILE, DO NOT MODIFY!
|
||||
//
|
||||
|
||||
// ignore_for_file: unused_element
|
||||
import 'package:fintracker_api/src/model/event_out.dart';
|
||||
import 'package:copy_with_extension/copy_with_extension.dart';
|
||||
import 'package:json_annotation/json_annotation.dart';
|
||||
|
||||
part 'event_page.g.dart';
|
||||
|
||||
|
||||
@CopyWith()
|
||||
@JsonSerializable(
|
||||
checked: true,
|
||||
createToJson: true,
|
||||
disallowUnrecognizedKeys: false,
|
||||
explicitToJson: true,
|
||||
)
|
||||
class EventPage {
|
||||
/// Returns a new [EventPage] instance.
|
||||
EventPage({
|
||||
|
||||
required this.items,
|
||||
|
||||
required this.page,
|
||||
|
||||
required this.pageSize,
|
||||
|
||||
required this.total,
|
||||
});
|
||||
|
||||
@JsonKey(
|
||||
|
||||
name: r'items',
|
||||
required: true,
|
||||
includeIfNull: false,
|
||||
)
|
||||
|
||||
|
||||
final List<EventOut> items;
|
||||
|
||||
|
||||
|
||||
@JsonKey(
|
||||
|
||||
name: r'page',
|
||||
required: true,
|
||||
includeIfNull: false,
|
||||
)
|
||||
|
||||
|
||||
final int page;
|
||||
|
||||
|
||||
|
||||
@JsonKey(
|
||||
|
||||
name: r'page_size',
|
||||
required: true,
|
||||
includeIfNull: false,
|
||||
)
|
||||
|
||||
|
||||
final int pageSize;
|
||||
|
||||
|
||||
|
||||
@JsonKey(
|
||||
|
||||
name: r'total',
|
||||
required: true,
|
||||
includeIfNull: false,
|
||||
)
|
||||
|
||||
|
||||
final int total;
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
@override
|
||||
bool operator ==(Object other) => identical(this, other) || other is EventPage &&
|
||||
other.items == items &&
|
||||
other.page == page &&
|
||||
other.pageSize == pageSize &&
|
||||
other.total == total;
|
||||
|
||||
@override
|
||||
int get hashCode =>
|
||||
items.hashCode +
|
||||
page.hashCode +
|
||||
pageSize.hashCode +
|
||||
total.hashCode;
|
||||
|
||||
factory EventPage.fromJson(Map<String, dynamic> json) => _$EventPageFromJson(json);
|
||||
|
||||
Map<String, dynamic> toJson() => _$EventPageToJson(this);
|
||||
|
||||
@override
|
||||
String toString() {
|
||||
return toJson().toString();
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -0,0 +1,114 @@
|
||||
// GENERATED CODE - DO NOT MODIFY BY HAND
|
||||
|
||||
part of 'event_page.dart';
|
||||
|
||||
// **************************************************************************
|
||||
// CopyWithGenerator
|
||||
// **************************************************************************
|
||||
|
||||
abstract class _$EventPageCWProxy {
|
||||
EventPage items(List<EventOut> items);
|
||||
|
||||
EventPage page(int page);
|
||||
|
||||
EventPage pageSize(int pageSize);
|
||||
|
||||
EventPage total(int total);
|
||||
|
||||
/// This function **does support** nullification of nullable fields. All `null` values passed to `non-nullable` fields will be ignored. You can also use `EventPage(...).copyWith.fieldName(...)` to override fields one at a time with nullification support.
|
||||
///
|
||||
/// Usage
|
||||
/// ```dart
|
||||
/// EventPage(...).copyWith(id: 12, name: "My name")
|
||||
/// ````
|
||||
EventPage call({List<EventOut> items, int page, int pageSize, int total});
|
||||
}
|
||||
|
||||
/// Proxy class for `copyWith` functionality. This is a callable class and can be used as follows: `instanceOfEventPage.copyWith(...)`. Additionally contains functions for specific fields e.g. `instanceOfEventPage.copyWith.fieldName(...)`
|
||||
class _$EventPageCWProxyImpl implements _$EventPageCWProxy {
|
||||
const _$EventPageCWProxyImpl(this._value);
|
||||
|
||||
final EventPage _value;
|
||||
|
||||
@override
|
||||
EventPage items(List<EventOut> items) => this(items: items);
|
||||
|
||||
@override
|
||||
EventPage page(int page) => this(page: page);
|
||||
|
||||
@override
|
||||
EventPage pageSize(int pageSize) => this(pageSize: pageSize);
|
||||
|
||||
@override
|
||||
EventPage total(int total) => this(total: total);
|
||||
|
||||
@override
|
||||
/// This function **does support** nullification of nullable fields. All `null` values passed to `non-nullable` fields will be ignored. You can also use `EventPage(...).copyWith.fieldName(...)` to override fields one at a time with nullification support.
|
||||
///
|
||||
/// Usage
|
||||
/// ```dart
|
||||
/// EventPage(...).copyWith(id: 12, name: "My name")
|
||||
/// ````
|
||||
EventPage call({
|
||||
Object? items = const $CopyWithPlaceholder(),
|
||||
Object? page = const $CopyWithPlaceholder(),
|
||||
Object? pageSize = const $CopyWithPlaceholder(),
|
||||
Object? total = const $CopyWithPlaceholder(),
|
||||
}) {
|
||||
return EventPage(
|
||||
items: items == const $CopyWithPlaceholder()
|
||||
? _value.items
|
||||
// ignore: cast_nullable_to_non_nullable
|
||||
: items as List<EventOut>,
|
||||
page: page == const $CopyWithPlaceholder()
|
||||
? _value.page
|
||||
// ignore: cast_nullable_to_non_nullable
|
||||
: page as int,
|
||||
pageSize: pageSize == const $CopyWithPlaceholder()
|
||||
? _value.pageSize
|
||||
// ignore: cast_nullable_to_non_nullable
|
||||
: pageSize as int,
|
||||
total: total == const $CopyWithPlaceholder()
|
||||
? _value.total
|
||||
// ignore: cast_nullable_to_non_nullable
|
||||
: total as int,
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
extension $EventPageCopyWith on EventPage {
|
||||
/// Returns a callable class that can be used as follows: `instanceOfEventPage.copyWith(...)` or like so:`instanceOfEventPage.copyWith.fieldName(...)`.
|
||||
// ignore: library_private_types_in_public_api
|
||||
_$EventPageCWProxy get copyWith => _$EventPageCWProxyImpl(this);
|
||||
}
|
||||
|
||||
// **************************************************************************
|
||||
// JsonSerializableGenerator
|
||||
// **************************************************************************
|
||||
|
||||
EventPage _$EventPageFromJson(Map<String, dynamic> json) =>
|
||||
$checkedCreate('EventPage', json, ($checkedConvert) {
|
||||
$checkKeys(
|
||||
json,
|
||||
requiredKeys: const ['items', 'page', 'page_size', 'total'],
|
||||
);
|
||||
final val = EventPage(
|
||||
items: $checkedConvert(
|
||||
'items',
|
||||
(v) => (v as List<dynamic>)
|
||||
.map((e) => EventOut.fromJson(e as Map<String, dynamic>))
|
||||
.toList(),
|
||||
),
|
||||
page: $checkedConvert('page', (v) => (v as num).toInt()),
|
||||
pageSize: $checkedConvert('page_size', (v) => (v as num).toInt()),
|
||||
total: $checkedConvert('total', (v) => (v as num).toInt()),
|
||||
);
|
||||
return val;
|
||||
}, fieldKeyMap: const {'pageSize': 'page_size'});
|
||||
|
||||
Map<String, dynamic> _$EventPageToJson(EventPage instance) => <String, dynamic>{
|
||||
'items': instance.items.map((e) => e.toJson()).toList(),
|
||||
'page': instance.page,
|
||||
'page_size': instance.pageSize,
|
||||
'total': instance.total,
|
||||
};
|
||||
@@ -0,0 +1,26 @@
|
||||
//
|
||||
// AUTO-GENERATED FILE, DO NOT MODIFY!
|
||||
//
|
||||
|
||||
// ignore_for_file: unused_element
|
||||
import 'package:json_annotation/json_annotation.dart';
|
||||
|
||||
enum EventStatus {
|
||||
@JsonValue(r'confirmed')
|
||||
confirmed(r'confirmed'),
|
||||
@JsonValue(r'pending')
|
||||
pending(r'pending'),
|
||||
@JsonValue(r'shadow')
|
||||
shadow(r'shadow'),
|
||||
@JsonValue(r'ignored')
|
||||
ignored(r'ignored'),
|
||||
@JsonValue(r'unknown_default_open_api')
|
||||
unknownDefaultOpenApi(r'unknown_default_open_api');
|
||||
|
||||
const EventStatus(this.value);
|
||||
|
||||
final String value;
|
||||
|
||||
@override
|
||||
String toString() => value;
|
||||
}
|
||||
@@ -0,0 +1,472 @@
|
||||
//
|
||||
// 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 'holding_out.g.dart';
|
||||
|
||||
|
||||
@CopyWith()
|
||||
@JsonSerializable(
|
||||
checked: true,
|
||||
createToJson: true,
|
||||
disallowUnrecognizedKeys: false,
|
||||
explicitToJson: true,
|
||||
)
|
||||
class HoldingOut {
|
||||
/// Returns a new [HoldingOut] instance.
|
||||
HoldingOut({
|
||||
|
||||
required this.accruedInterestRub,
|
||||
|
||||
required this.assetClass,
|
||||
|
||||
required this.avgCost,
|
||||
|
||||
required this.board,
|
||||
|
||||
required this.costCurrency,
|
||||
|
||||
required this.costTotalRub,
|
||||
|
||||
required this.currency,
|
||||
|
||||
required this.daysHeld,
|
||||
|
||||
required this.firstBuyDate,
|
||||
|
||||
required this.incomeRub,
|
||||
|
||||
required this.instrumentId,
|
||||
|
||||
required this.ldvEligibleQty,
|
||||
|
||||
required this.marketPrice,
|
||||
|
||||
required this.name,
|
||||
|
||||
required this.priceCurrency,
|
||||
|
||||
required this.priceDate,
|
||||
|
||||
required this.priceStatus,
|
||||
|
||||
required this.qty,
|
||||
|
||||
required this.realizedPnlRub,
|
||||
|
||||
required this.ticker,
|
||||
|
||||
required this.unrealizedPnlNative,
|
||||
|
||||
required this.unrealizedPnlRub,
|
||||
|
||||
required this.valueNative,
|
||||
|
||||
required this.valueRub,
|
||||
|
||||
required this.weight,
|
||||
|
||||
required this.xirr,
|
||||
});
|
||||
|
||||
/// decimal as string
|
||||
@JsonKey(
|
||||
|
||||
name: r'accrued_interest_rub',
|
||||
required: true,
|
||||
includeIfNull: true,
|
||||
)
|
||||
|
||||
|
||||
final String? accruedInterestRub;
|
||||
|
||||
|
||||
|
||||
@JsonKey(
|
||||
|
||||
name: r'asset_class',
|
||||
required: true,
|
||||
includeIfNull: false,
|
||||
)
|
||||
|
||||
|
||||
final String assetClass;
|
||||
|
||||
|
||||
|
||||
/// decimal as string
|
||||
@JsonKey(
|
||||
|
||||
name: r'avg_cost',
|
||||
required: true,
|
||||
includeIfNull: true,
|
||||
)
|
||||
|
||||
|
||||
final String? avgCost;
|
||||
|
||||
|
||||
|
||||
@JsonKey(
|
||||
|
||||
name: r'board',
|
||||
required: true,
|
||||
includeIfNull: true,
|
||||
)
|
||||
|
||||
|
||||
final String? board;
|
||||
|
||||
|
||||
|
||||
@JsonKey(
|
||||
|
||||
name: r'cost_currency',
|
||||
required: true,
|
||||
includeIfNull: true,
|
||||
)
|
||||
|
||||
|
||||
final String? costCurrency;
|
||||
|
||||
|
||||
|
||||
/// decimal as string
|
||||
@JsonKey(
|
||||
|
||||
name: r'cost_total_rub',
|
||||
required: true,
|
||||
includeIfNull: true,
|
||||
)
|
||||
|
||||
|
||||
final String? costTotalRub;
|
||||
|
||||
|
||||
|
||||
@JsonKey(
|
||||
|
||||
name: r'currency',
|
||||
required: true,
|
||||
includeIfNull: false,
|
||||
)
|
||||
|
||||
|
||||
final String currency;
|
||||
|
||||
|
||||
|
||||
@JsonKey(
|
||||
|
||||
name: r'days_held',
|
||||
required: true,
|
||||
includeIfNull: true,
|
||||
)
|
||||
|
||||
|
||||
final int? daysHeld;
|
||||
|
||||
|
||||
|
||||
@JsonKey(
|
||||
|
||||
name: r'first_buy_date',
|
||||
required: true,
|
||||
includeIfNull: true,
|
||||
)
|
||||
|
||||
|
||||
final DateTime? firstBuyDate;
|
||||
|
||||
|
||||
|
||||
/// decimal as string
|
||||
@JsonKey(
|
||||
|
||||
name: r'income_rub',
|
||||
required: true,
|
||||
includeIfNull: true,
|
||||
)
|
||||
|
||||
|
||||
final String? incomeRub;
|
||||
|
||||
|
||||
|
||||
@JsonKey(
|
||||
|
||||
name: r'instrument_id',
|
||||
required: true,
|
||||
includeIfNull: false,
|
||||
)
|
||||
|
||||
|
||||
final int instrumentId;
|
||||
|
||||
|
||||
|
||||
/// decimal as string
|
||||
@JsonKey(
|
||||
|
||||
name: r'ldv_eligible_qty',
|
||||
required: true,
|
||||
includeIfNull: false,
|
||||
)
|
||||
|
||||
|
||||
final String ldvEligibleQty;
|
||||
|
||||
|
||||
|
||||
/// decimal as string
|
||||
@JsonKey(
|
||||
|
||||
name: r'market_price',
|
||||
required: true,
|
||||
includeIfNull: true,
|
||||
)
|
||||
|
||||
|
||||
final String? marketPrice;
|
||||
|
||||
|
||||
|
||||
@JsonKey(
|
||||
|
||||
name: r'name',
|
||||
required: true,
|
||||
includeIfNull: false,
|
||||
)
|
||||
|
||||
|
||||
final String name;
|
||||
|
||||
|
||||
|
||||
@JsonKey(
|
||||
|
||||
name: r'price_currency',
|
||||
required: true,
|
||||
includeIfNull: true,
|
||||
)
|
||||
|
||||
|
||||
final String? priceCurrency;
|
||||
|
||||
|
||||
|
||||
@JsonKey(
|
||||
|
||||
name: r'price_date',
|
||||
required: true,
|
||||
includeIfNull: true,
|
||||
)
|
||||
|
||||
|
||||
final DateTime? priceDate;
|
||||
|
||||
|
||||
|
||||
@JsonKey(
|
||||
|
||||
name: r'price_status',
|
||||
required: true,
|
||||
includeIfNull: false,
|
||||
)
|
||||
|
||||
|
||||
final String priceStatus;
|
||||
|
||||
|
||||
|
||||
/// decimal as string
|
||||
@JsonKey(
|
||||
|
||||
name: r'qty',
|
||||
required: true,
|
||||
includeIfNull: false,
|
||||
)
|
||||
|
||||
|
||||
final String qty;
|
||||
|
||||
|
||||
|
||||
/// decimal as string
|
||||
@JsonKey(
|
||||
|
||||
name: r'realized_pnl_rub',
|
||||
required: true,
|
||||
includeIfNull: true,
|
||||
)
|
||||
|
||||
|
||||
final String? realizedPnlRub;
|
||||
|
||||
|
||||
|
||||
@JsonKey(
|
||||
|
||||
name: r'ticker',
|
||||
required: true,
|
||||
includeIfNull: true,
|
||||
)
|
||||
|
||||
|
||||
final String? ticker;
|
||||
|
||||
|
||||
|
||||
/// decimal as string
|
||||
@JsonKey(
|
||||
|
||||
name: r'unrealized_pnl_native',
|
||||
required: true,
|
||||
includeIfNull: true,
|
||||
)
|
||||
|
||||
|
||||
final String? unrealizedPnlNative;
|
||||
|
||||
|
||||
|
||||
/// decimal as string
|
||||
@JsonKey(
|
||||
|
||||
name: r'unrealized_pnl_rub',
|
||||
required: true,
|
||||
includeIfNull: true,
|
||||
)
|
||||
|
||||
|
||||
final String? unrealizedPnlRub;
|
||||
|
||||
|
||||
|
||||
/// decimal as string
|
||||
@JsonKey(
|
||||
|
||||
name: r'value_native',
|
||||
required: true,
|
||||
includeIfNull: true,
|
||||
)
|
||||
|
||||
|
||||
final String? valueNative;
|
||||
|
||||
|
||||
|
||||
/// decimal as string
|
||||
@JsonKey(
|
||||
|
||||
name: r'value_rub',
|
||||
required: true,
|
||||
includeIfNull: true,
|
||||
)
|
||||
|
||||
|
||||
final String? valueRub;
|
||||
|
||||
|
||||
|
||||
/// decimal as string
|
||||
@JsonKey(
|
||||
|
||||
name: r'weight',
|
||||
required: true,
|
||||
includeIfNull: true,
|
||||
)
|
||||
|
||||
|
||||
final String? weight;
|
||||
|
||||
|
||||
|
||||
/// decimal as string
|
||||
@JsonKey(
|
||||
|
||||
name: r'xirr',
|
||||
required: true,
|
||||
includeIfNull: true,
|
||||
)
|
||||
|
||||
|
||||
final String? xirr;
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
@override
|
||||
bool operator ==(Object other) => identical(this, other) || other is HoldingOut &&
|
||||
other.accruedInterestRub == accruedInterestRub &&
|
||||
other.assetClass == assetClass &&
|
||||
other.avgCost == avgCost &&
|
||||
other.board == board &&
|
||||
other.costCurrency == costCurrency &&
|
||||
other.costTotalRub == costTotalRub &&
|
||||
other.currency == currency &&
|
||||
other.daysHeld == daysHeld &&
|
||||
other.firstBuyDate == firstBuyDate &&
|
||||
other.incomeRub == incomeRub &&
|
||||
other.instrumentId == instrumentId &&
|
||||
other.ldvEligibleQty == ldvEligibleQty &&
|
||||
other.marketPrice == marketPrice &&
|
||||
other.name == name &&
|
||||
other.priceCurrency == priceCurrency &&
|
||||
other.priceDate == priceDate &&
|
||||
other.priceStatus == priceStatus &&
|
||||
other.qty == qty &&
|
||||
other.realizedPnlRub == realizedPnlRub &&
|
||||
other.ticker == ticker &&
|
||||
other.unrealizedPnlNative == unrealizedPnlNative &&
|
||||
other.unrealizedPnlRub == unrealizedPnlRub &&
|
||||
other.valueNative == valueNative &&
|
||||
other.valueRub == valueRub &&
|
||||
other.weight == weight &&
|
||||
other.xirr == xirr;
|
||||
|
||||
@override
|
||||
int get hashCode =>
|
||||
(accruedInterestRub == null ? 0 : accruedInterestRub.hashCode) +
|
||||
assetClass.hashCode +
|
||||
(avgCost == null ? 0 : avgCost.hashCode) +
|
||||
(board == null ? 0 : board.hashCode) +
|
||||
(costCurrency == null ? 0 : costCurrency.hashCode) +
|
||||
(costTotalRub == null ? 0 : costTotalRub.hashCode) +
|
||||
currency.hashCode +
|
||||
(daysHeld == null ? 0 : daysHeld.hashCode) +
|
||||
(firstBuyDate == null ? 0 : firstBuyDate.hashCode) +
|
||||
(incomeRub == null ? 0 : incomeRub.hashCode) +
|
||||
instrumentId.hashCode +
|
||||
ldvEligibleQty.hashCode +
|
||||
(marketPrice == null ? 0 : marketPrice.hashCode) +
|
||||
name.hashCode +
|
||||
(priceCurrency == null ? 0 : priceCurrency.hashCode) +
|
||||
(priceDate == null ? 0 : priceDate.hashCode) +
|
||||
priceStatus.hashCode +
|
||||
qty.hashCode +
|
||||
(realizedPnlRub == null ? 0 : realizedPnlRub.hashCode) +
|
||||
(ticker == null ? 0 : ticker.hashCode) +
|
||||
(unrealizedPnlNative == null ? 0 : unrealizedPnlNative.hashCode) +
|
||||
(unrealizedPnlRub == null ? 0 : unrealizedPnlRub.hashCode) +
|
||||
(valueNative == null ? 0 : valueNative.hashCode) +
|
||||
(valueRub == null ? 0 : valueRub.hashCode) +
|
||||
(weight == null ? 0 : weight.hashCode) +
|
||||
(xirr == null ? 0 : xirr.hashCode);
|
||||
|
||||
factory HoldingOut.fromJson(Map<String, dynamic> json) => _$HoldingOutFromJson(json);
|
||||
|
||||
Map<String, dynamic> toJson() => _$HoldingOutToJson(this);
|
||||
|
||||
@override
|
||||
String toString() {
|
||||
return toJson().toString();
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -0,0 +1,476 @@
|
||||
// GENERATED CODE - DO NOT MODIFY BY HAND
|
||||
|
||||
part of 'holding_out.dart';
|
||||
|
||||
// **************************************************************************
|
||||
// CopyWithGenerator
|
||||
// **************************************************************************
|
||||
|
||||
abstract class _$HoldingOutCWProxy {
|
||||
HoldingOut accruedInterestRub(String? accruedInterestRub);
|
||||
|
||||
HoldingOut assetClass(String assetClass);
|
||||
|
||||
HoldingOut avgCost(String? avgCost);
|
||||
|
||||
HoldingOut board(String? board);
|
||||
|
||||
HoldingOut costCurrency(String? costCurrency);
|
||||
|
||||
HoldingOut costTotalRub(String? costTotalRub);
|
||||
|
||||
HoldingOut currency(String currency);
|
||||
|
||||
HoldingOut daysHeld(int? daysHeld);
|
||||
|
||||
HoldingOut firstBuyDate(DateTime? firstBuyDate);
|
||||
|
||||
HoldingOut incomeRub(String? incomeRub);
|
||||
|
||||
HoldingOut instrumentId(int instrumentId);
|
||||
|
||||
HoldingOut ldvEligibleQty(String ldvEligibleQty);
|
||||
|
||||
HoldingOut marketPrice(String? marketPrice);
|
||||
|
||||
HoldingOut name(String name);
|
||||
|
||||
HoldingOut priceCurrency(String? priceCurrency);
|
||||
|
||||
HoldingOut priceDate(DateTime? priceDate);
|
||||
|
||||
HoldingOut priceStatus(String priceStatus);
|
||||
|
||||
HoldingOut qty(String qty);
|
||||
|
||||
HoldingOut realizedPnlRub(String? realizedPnlRub);
|
||||
|
||||
HoldingOut ticker(String? ticker);
|
||||
|
||||
HoldingOut unrealizedPnlNative(String? unrealizedPnlNative);
|
||||
|
||||
HoldingOut unrealizedPnlRub(String? unrealizedPnlRub);
|
||||
|
||||
HoldingOut valueNative(String? valueNative);
|
||||
|
||||
HoldingOut valueRub(String? valueRub);
|
||||
|
||||
HoldingOut weight(String? weight);
|
||||
|
||||
HoldingOut xirr(String? xirr);
|
||||
|
||||
/// This function **does support** nullification of nullable fields. All `null` values passed to `non-nullable` fields will be ignored. You can also use `HoldingOut(...).copyWith.fieldName(...)` to override fields one at a time with nullification support.
|
||||
///
|
||||
/// Usage
|
||||
/// ```dart
|
||||
/// HoldingOut(...).copyWith(id: 12, name: "My name")
|
||||
/// ````
|
||||
HoldingOut call({
|
||||
String? accruedInterestRub,
|
||||
String assetClass,
|
||||
String? avgCost,
|
||||
String? board,
|
||||
String? costCurrency,
|
||||
String? costTotalRub,
|
||||
String currency,
|
||||
int? daysHeld,
|
||||
DateTime? firstBuyDate,
|
||||
String? incomeRub,
|
||||
int instrumentId,
|
||||
String ldvEligibleQty,
|
||||
String? marketPrice,
|
||||
String name,
|
||||
String? priceCurrency,
|
||||
DateTime? priceDate,
|
||||
String priceStatus,
|
||||
String qty,
|
||||
String? realizedPnlRub,
|
||||
String? ticker,
|
||||
String? unrealizedPnlNative,
|
||||
String? unrealizedPnlRub,
|
||||
String? valueNative,
|
||||
String? valueRub,
|
||||
String? weight,
|
||||
String? xirr,
|
||||
});
|
||||
}
|
||||
|
||||
/// Proxy class for `copyWith` functionality. This is a callable class and can be used as follows: `instanceOfHoldingOut.copyWith(...)`. Additionally contains functions for specific fields e.g. `instanceOfHoldingOut.copyWith.fieldName(...)`
|
||||
class _$HoldingOutCWProxyImpl implements _$HoldingOutCWProxy {
|
||||
const _$HoldingOutCWProxyImpl(this._value);
|
||||
|
||||
final HoldingOut _value;
|
||||
|
||||
@override
|
||||
HoldingOut accruedInterestRub(String? accruedInterestRub) =>
|
||||
this(accruedInterestRub: accruedInterestRub);
|
||||
|
||||
@override
|
||||
HoldingOut assetClass(String assetClass) => this(assetClass: assetClass);
|
||||
|
||||
@override
|
||||
HoldingOut avgCost(String? avgCost) => this(avgCost: avgCost);
|
||||
|
||||
@override
|
||||
HoldingOut board(String? board) => this(board: board);
|
||||
|
||||
@override
|
||||
HoldingOut costCurrency(String? costCurrency) =>
|
||||
this(costCurrency: costCurrency);
|
||||
|
||||
@override
|
||||
HoldingOut costTotalRub(String? costTotalRub) =>
|
||||
this(costTotalRub: costTotalRub);
|
||||
|
||||
@override
|
||||
HoldingOut currency(String currency) => this(currency: currency);
|
||||
|
||||
@override
|
||||
HoldingOut daysHeld(int? daysHeld) => this(daysHeld: daysHeld);
|
||||
|
||||
@override
|
||||
HoldingOut firstBuyDate(DateTime? firstBuyDate) =>
|
||||
this(firstBuyDate: firstBuyDate);
|
||||
|
||||
@override
|
||||
HoldingOut incomeRub(String? incomeRub) => this(incomeRub: incomeRub);
|
||||
|
||||
@override
|
||||
HoldingOut instrumentId(int instrumentId) => this(instrumentId: instrumentId);
|
||||
|
||||
@override
|
||||
HoldingOut ldvEligibleQty(String ldvEligibleQty) =>
|
||||
this(ldvEligibleQty: ldvEligibleQty);
|
||||
|
||||
@override
|
||||
HoldingOut marketPrice(String? marketPrice) => this(marketPrice: marketPrice);
|
||||
|
||||
@override
|
||||
HoldingOut name(String name) => this(name: name);
|
||||
|
||||
@override
|
||||
HoldingOut priceCurrency(String? priceCurrency) =>
|
||||
this(priceCurrency: priceCurrency);
|
||||
|
||||
@override
|
||||
HoldingOut priceDate(DateTime? priceDate) => this(priceDate: priceDate);
|
||||
|
||||
@override
|
||||
HoldingOut priceStatus(String priceStatus) => this(priceStatus: priceStatus);
|
||||
|
||||
@override
|
||||
HoldingOut qty(String qty) => this(qty: qty);
|
||||
|
||||
@override
|
||||
HoldingOut realizedPnlRub(String? realizedPnlRub) =>
|
||||
this(realizedPnlRub: realizedPnlRub);
|
||||
|
||||
@override
|
||||
HoldingOut ticker(String? ticker) => this(ticker: ticker);
|
||||
|
||||
@override
|
||||
HoldingOut unrealizedPnlNative(String? unrealizedPnlNative) =>
|
||||
this(unrealizedPnlNative: unrealizedPnlNative);
|
||||
|
||||
@override
|
||||
HoldingOut unrealizedPnlRub(String? unrealizedPnlRub) =>
|
||||
this(unrealizedPnlRub: unrealizedPnlRub);
|
||||
|
||||
@override
|
||||
HoldingOut valueNative(String? valueNative) => this(valueNative: valueNative);
|
||||
|
||||
@override
|
||||
HoldingOut valueRub(String? valueRub) => this(valueRub: valueRub);
|
||||
|
||||
@override
|
||||
HoldingOut weight(String? weight) => this(weight: weight);
|
||||
|
||||
@override
|
||||
HoldingOut xirr(String? xirr) => this(xirr: xirr);
|
||||
|
||||
@override
|
||||
/// This function **does support** nullification of nullable fields. All `null` values passed to `non-nullable` fields will be ignored. You can also use `HoldingOut(...).copyWith.fieldName(...)` to override fields one at a time with nullification support.
|
||||
///
|
||||
/// Usage
|
||||
/// ```dart
|
||||
/// HoldingOut(...).copyWith(id: 12, name: "My name")
|
||||
/// ````
|
||||
HoldingOut call({
|
||||
Object? accruedInterestRub = const $CopyWithPlaceholder(),
|
||||
Object? assetClass = const $CopyWithPlaceholder(),
|
||||
Object? avgCost = const $CopyWithPlaceholder(),
|
||||
Object? board = const $CopyWithPlaceholder(),
|
||||
Object? costCurrency = const $CopyWithPlaceholder(),
|
||||
Object? costTotalRub = const $CopyWithPlaceholder(),
|
||||
Object? currency = const $CopyWithPlaceholder(),
|
||||
Object? daysHeld = const $CopyWithPlaceholder(),
|
||||
Object? firstBuyDate = const $CopyWithPlaceholder(),
|
||||
Object? incomeRub = const $CopyWithPlaceholder(),
|
||||
Object? instrumentId = const $CopyWithPlaceholder(),
|
||||
Object? ldvEligibleQty = const $CopyWithPlaceholder(),
|
||||
Object? marketPrice = const $CopyWithPlaceholder(),
|
||||
Object? name = const $CopyWithPlaceholder(),
|
||||
Object? priceCurrency = const $CopyWithPlaceholder(),
|
||||
Object? priceDate = const $CopyWithPlaceholder(),
|
||||
Object? priceStatus = const $CopyWithPlaceholder(),
|
||||
Object? qty = const $CopyWithPlaceholder(),
|
||||
Object? realizedPnlRub = const $CopyWithPlaceholder(),
|
||||
Object? ticker = const $CopyWithPlaceholder(),
|
||||
Object? unrealizedPnlNative = const $CopyWithPlaceholder(),
|
||||
Object? unrealizedPnlRub = const $CopyWithPlaceholder(),
|
||||
Object? valueNative = const $CopyWithPlaceholder(),
|
||||
Object? valueRub = const $CopyWithPlaceholder(),
|
||||
Object? weight = const $CopyWithPlaceholder(),
|
||||
Object? xirr = const $CopyWithPlaceholder(),
|
||||
}) {
|
||||
return HoldingOut(
|
||||
accruedInterestRub: accruedInterestRub == const $CopyWithPlaceholder()
|
||||
? _value.accruedInterestRub
|
||||
// ignore: cast_nullable_to_non_nullable
|
||||
: accruedInterestRub as String?,
|
||||
assetClass: assetClass == const $CopyWithPlaceholder()
|
||||
? _value.assetClass
|
||||
// ignore: cast_nullable_to_non_nullable
|
||||
: assetClass as String,
|
||||
avgCost: avgCost == const $CopyWithPlaceholder()
|
||||
? _value.avgCost
|
||||
// ignore: cast_nullable_to_non_nullable
|
||||
: avgCost as String?,
|
||||
board: board == const $CopyWithPlaceholder()
|
||||
? _value.board
|
||||
// ignore: cast_nullable_to_non_nullable
|
||||
: board as String?,
|
||||
costCurrency: costCurrency == const $CopyWithPlaceholder()
|
||||
? _value.costCurrency
|
||||
// ignore: cast_nullable_to_non_nullable
|
||||
: costCurrency as String?,
|
||||
costTotalRub: costTotalRub == const $CopyWithPlaceholder()
|
||||
? _value.costTotalRub
|
||||
// ignore: cast_nullable_to_non_nullable
|
||||
: costTotalRub as String?,
|
||||
currency: currency == const $CopyWithPlaceholder()
|
||||
? _value.currency
|
||||
// ignore: cast_nullable_to_non_nullable
|
||||
: currency as String,
|
||||
daysHeld: daysHeld == const $CopyWithPlaceholder()
|
||||
? _value.daysHeld
|
||||
// ignore: cast_nullable_to_non_nullable
|
||||
: daysHeld as int?,
|
||||
firstBuyDate: firstBuyDate == const $CopyWithPlaceholder()
|
||||
? _value.firstBuyDate
|
||||
// ignore: cast_nullable_to_non_nullable
|
||||
: firstBuyDate as DateTime?,
|
||||
incomeRub: incomeRub == const $CopyWithPlaceholder()
|
||||
? _value.incomeRub
|
||||
// ignore: cast_nullable_to_non_nullable
|
||||
: incomeRub as String?,
|
||||
instrumentId: instrumentId == const $CopyWithPlaceholder()
|
||||
? _value.instrumentId
|
||||
// ignore: cast_nullable_to_non_nullable
|
||||
: instrumentId as int,
|
||||
ldvEligibleQty: ldvEligibleQty == const $CopyWithPlaceholder()
|
||||
? _value.ldvEligibleQty
|
||||
// ignore: cast_nullable_to_non_nullable
|
||||
: ldvEligibleQty as String,
|
||||
marketPrice: marketPrice == const $CopyWithPlaceholder()
|
||||
? _value.marketPrice
|
||||
// ignore: cast_nullable_to_non_nullable
|
||||
: marketPrice as String?,
|
||||
name: name == const $CopyWithPlaceholder()
|
||||
? _value.name
|
||||
// ignore: cast_nullable_to_non_nullable
|
||||
: name as String,
|
||||
priceCurrency: priceCurrency == const $CopyWithPlaceholder()
|
||||
? _value.priceCurrency
|
||||
// ignore: cast_nullable_to_non_nullable
|
||||
: priceCurrency as String?,
|
||||
priceDate: priceDate == const $CopyWithPlaceholder()
|
||||
? _value.priceDate
|
||||
// ignore: cast_nullable_to_non_nullable
|
||||
: priceDate as DateTime?,
|
||||
priceStatus: priceStatus == const $CopyWithPlaceholder()
|
||||
? _value.priceStatus
|
||||
// ignore: cast_nullable_to_non_nullable
|
||||
: priceStatus as String,
|
||||
qty: qty == const $CopyWithPlaceholder()
|
||||
? _value.qty
|
||||
// ignore: cast_nullable_to_non_nullable
|
||||
: qty as String,
|
||||
realizedPnlRub: realizedPnlRub == const $CopyWithPlaceholder()
|
||||
? _value.realizedPnlRub
|
||||
// ignore: cast_nullable_to_non_nullable
|
||||
: realizedPnlRub as String?,
|
||||
ticker: ticker == const $CopyWithPlaceholder()
|
||||
? _value.ticker
|
||||
// ignore: cast_nullable_to_non_nullable
|
||||
: ticker as String?,
|
||||
unrealizedPnlNative: unrealizedPnlNative == const $CopyWithPlaceholder()
|
||||
? _value.unrealizedPnlNative
|
||||
// ignore: cast_nullable_to_non_nullable
|
||||
: unrealizedPnlNative as String?,
|
||||
unrealizedPnlRub: unrealizedPnlRub == const $CopyWithPlaceholder()
|
||||
? _value.unrealizedPnlRub
|
||||
// ignore: cast_nullable_to_non_nullable
|
||||
: unrealizedPnlRub as String?,
|
||||
valueNative: valueNative == const $CopyWithPlaceholder()
|
||||
? _value.valueNative
|
||||
// ignore: cast_nullable_to_non_nullable
|
||||
: valueNative as String?,
|
||||
valueRub: valueRub == const $CopyWithPlaceholder()
|
||||
? _value.valueRub
|
||||
// ignore: cast_nullable_to_non_nullable
|
||||
: valueRub as String?,
|
||||
weight: weight == const $CopyWithPlaceholder()
|
||||
? _value.weight
|
||||
// ignore: cast_nullable_to_non_nullable
|
||||
: weight as String?,
|
||||
xirr: xirr == const $CopyWithPlaceholder()
|
||||
? _value.xirr
|
||||
// ignore: cast_nullable_to_non_nullable
|
||||
: xirr as String?,
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
extension $HoldingOutCopyWith on HoldingOut {
|
||||
/// Returns a callable class that can be used as follows: `instanceOfHoldingOut.copyWith(...)` or like so:`instanceOfHoldingOut.copyWith.fieldName(...)`.
|
||||
// ignore: library_private_types_in_public_api
|
||||
_$HoldingOutCWProxy get copyWith => _$HoldingOutCWProxyImpl(this);
|
||||
}
|
||||
|
||||
// **************************************************************************
|
||||
// JsonSerializableGenerator
|
||||
// **************************************************************************
|
||||
|
||||
HoldingOut _$HoldingOutFromJson(Map<String, dynamic> json) => $checkedCreate(
|
||||
'HoldingOut',
|
||||
json,
|
||||
($checkedConvert) {
|
||||
$checkKeys(
|
||||
json,
|
||||
requiredKeys: const [
|
||||
'accrued_interest_rub',
|
||||
'asset_class',
|
||||
'avg_cost',
|
||||
'board',
|
||||
'cost_currency',
|
||||
'cost_total_rub',
|
||||
'currency',
|
||||
'days_held',
|
||||
'first_buy_date',
|
||||
'income_rub',
|
||||
'instrument_id',
|
||||
'ldv_eligible_qty',
|
||||
'market_price',
|
||||
'name',
|
||||
'price_currency',
|
||||
'price_date',
|
||||
'price_status',
|
||||
'qty',
|
||||
'realized_pnl_rub',
|
||||
'ticker',
|
||||
'unrealized_pnl_native',
|
||||
'unrealized_pnl_rub',
|
||||
'value_native',
|
||||
'value_rub',
|
||||
'weight',
|
||||
'xirr',
|
||||
],
|
||||
);
|
||||
final val = HoldingOut(
|
||||
accruedInterestRub: $checkedConvert(
|
||||
'accrued_interest_rub',
|
||||
(v) => v as String?,
|
||||
),
|
||||
assetClass: $checkedConvert('asset_class', (v) => v as String),
|
||||
avgCost: $checkedConvert('avg_cost', (v) => v as String?),
|
||||
board: $checkedConvert('board', (v) => v as String?),
|
||||
costCurrency: $checkedConvert('cost_currency', (v) => v as String?),
|
||||
costTotalRub: $checkedConvert('cost_total_rub', (v) => v as String?),
|
||||
currency: $checkedConvert('currency', (v) => v as String),
|
||||
daysHeld: $checkedConvert('days_held', (v) => (v as num?)?.toInt()),
|
||||
firstBuyDate: $checkedConvert(
|
||||
'first_buy_date',
|
||||
(v) => v == null ? null : DateTime.parse(v as String),
|
||||
),
|
||||
incomeRub: $checkedConvert('income_rub', (v) => v as String?),
|
||||
instrumentId: $checkedConvert('instrument_id', (v) => (v as num).toInt()),
|
||||
ldvEligibleQty: $checkedConvert('ldv_eligible_qty', (v) => v as String),
|
||||
marketPrice: $checkedConvert('market_price', (v) => v as String?),
|
||||
name: $checkedConvert('name', (v) => v as String),
|
||||
priceCurrency: $checkedConvert('price_currency', (v) => v as String?),
|
||||
priceDate: $checkedConvert(
|
||||
'price_date',
|
||||
(v) => v == null ? null : DateTime.parse(v as String),
|
||||
),
|
||||
priceStatus: $checkedConvert('price_status', (v) => v as String),
|
||||
qty: $checkedConvert('qty', (v) => v as String),
|
||||
realizedPnlRub: $checkedConvert('realized_pnl_rub', (v) => v as String?),
|
||||
ticker: $checkedConvert('ticker', (v) => v as String?),
|
||||
unrealizedPnlNative: $checkedConvert(
|
||||
'unrealized_pnl_native',
|
||||
(v) => v as String?,
|
||||
),
|
||||
unrealizedPnlRub: $checkedConvert(
|
||||
'unrealized_pnl_rub',
|
||||
(v) => v as String?,
|
||||
),
|
||||
valueNative: $checkedConvert('value_native', (v) => v as String?),
|
||||
valueRub: $checkedConvert('value_rub', (v) => v as String?),
|
||||
weight: $checkedConvert('weight', (v) => v as String?),
|
||||
xirr: $checkedConvert('xirr', (v) => v as String?),
|
||||
);
|
||||
return val;
|
||||
},
|
||||
fieldKeyMap: const {
|
||||
'accruedInterestRub': 'accrued_interest_rub',
|
||||
'assetClass': 'asset_class',
|
||||
'avgCost': 'avg_cost',
|
||||
'costCurrency': 'cost_currency',
|
||||
'costTotalRub': 'cost_total_rub',
|
||||
'daysHeld': 'days_held',
|
||||
'firstBuyDate': 'first_buy_date',
|
||||
'incomeRub': 'income_rub',
|
||||
'instrumentId': 'instrument_id',
|
||||
'ldvEligibleQty': 'ldv_eligible_qty',
|
||||
'marketPrice': 'market_price',
|
||||
'priceCurrency': 'price_currency',
|
||||
'priceDate': 'price_date',
|
||||
'priceStatus': 'price_status',
|
||||
'realizedPnlRub': 'realized_pnl_rub',
|
||||
'unrealizedPnlNative': 'unrealized_pnl_native',
|
||||
'unrealizedPnlRub': 'unrealized_pnl_rub',
|
||||
'valueNative': 'value_native',
|
||||
'valueRub': 'value_rub',
|
||||
},
|
||||
);
|
||||
|
||||
Map<String, dynamic> _$HoldingOutToJson(HoldingOut instance) =>
|
||||
<String, dynamic>{
|
||||
'accrued_interest_rub': instance.accruedInterestRub,
|
||||
'asset_class': instance.assetClass,
|
||||
'avg_cost': instance.avgCost,
|
||||
'board': instance.board,
|
||||
'cost_currency': instance.costCurrency,
|
||||
'cost_total_rub': instance.costTotalRub,
|
||||
'currency': instance.currency,
|
||||
'days_held': instance.daysHeld,
|
||||
'first_buy_date': instance.firstBuyDate?.toIso8601String(),
|
||||
'income_rub': instance.incomeRub,
|
||||
'instrument_id': instance.instrumentId,
|
||||
'ldv_eligible_qty': instance.ldvEligibleQty,
|
||||
'market_price': instance.marketPrice,
|
||||
'name': instance.name,
|
||||
'price_currency': instance.priceCurrency,
|
||||
'price_date': instance.priceDate?.toIso8601String(),
|
||||
'price_status': instance.priceStatus,
|
||||
'qty': instance.qty,
|
||||
'realized_pnl_rub': instance.realizedPnlRub,
|
||||
'ticker': instance.ticker,
|
||||
'unrealized_pnl_native': instance.unrealizedPnlNative,
|
||||
'unrealized_pnl_rub': instance.unrealizedPnlRub,
|
||||
'value_native': instance.valueNative,
|
||||
'value_rub': instance.valueRub,
|
||||
'weight': instance.weight,
|
||||
'xirr': instance.xirr,
|
||||
};
|
||||
@@ -0,0 +1,127 @@
|
||||
//
|
||||
// AUTO-GENERATED FILE, DO NOT MODIFY!
|
||||
//
|
||||
|
||||
// ignore_for_file: unused_element
|
||||
import 'package:fintracker_api/src/model/price_point.dart';
|
||||
import 'package:fintracker_api/src/model/lot_out.dart';
|
||||
import 'package:fintracker_api/src/model/event_out.dart';
|
||||
import 'package:fintracker_api/src/model/instrument_out.dart';
|
||||
import 'package:fintracker_api/src/model/holding_out.dart';
|
||||
import 'package:copy_with_extension/copy_with_extension.dart';
|
||||
import 'package:json_annotation/json_annotation.dart';
|
||||
|
||||
part 'instrument_detail.g.dart';
|
||||
|
||||
|
||||
@CopyWith()
|
||||
@JsonSerializable(
|
||||
checked: true,
|
||||
createToJson: true,
|
||||
disallowUnrecognizedKeys: false,
|
||||
explicitToJson: true,
|
||||
)
|
||||
class InstrumentDetail {
|
||||
/// Returns a new [InstrumentDetail] instance.
|
||||
InstrumentDetail({
|
||||
|
||||
required this.events,
|
||||
|
||||
required this.holding,
|
||||
|
||||
required this.instrument,
|
||||
|
||||
required this.lots,
|
||||
|
||||
required this.prices,
|
||||
});
|
||||
|
||||
@JsonKey(
|
||||
|
||||
name: r'events',
|
||||
required: true,
|
||||
includeIfNull: false,
|
||||
)
|
||||
|
||||
|
||||
final List<EventOut> events;
|
||||
|
||||
|
||||
|
||||
@JsonKey(
|
||||
|
||||
name: r'holding',
|
||||
required: true,
|
||||
includeIfNull: true,
|
||||
)
|
||||
|
||||
|
||||
final HoldingOut? holding;
|
||||
|
||||
|
||||
|
||||
@JsonKey(
|
||||
|
||||
name: r'instrument',
|
||||
required: true,
|
||||
includeIfNull: false,
|
||||
)
|
||||
|
||||
|
||||
final InstrumentOut instrument;
|
||||
|
||||
|
||||
|
||||
@JsonKey(
|
||||
|
||||
name: r'lots',
|
||||
required: true,
|
||||
includeIfNull: false,
|
||||
)
|
||||
|
||||
|
||||
final List<LotOut> lots;
|
||||
|
||||
|
||||
|
||||
@JsonKey(
|
||||
|
||||
name: r'prices',
|
||||
required: true,
|
||||
includeIfNull: false,
|
||||
)
|
||||
|
||||
|
||||
final List<PricePoint> prices;
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
@override
|
||||
bool operator ==(Object other) => identical(this, other) || other is InstrumentDetail &&
|
||||
other.events == events &&
|
||||
other.holding == holding &&
|
||||
other.instrument == instrument &&
|
||||
other.lots == lots &&
|
||||
other.prices == prices;
|
||||
|
||||
@override
|
||||
int get hashCode =>
|
||||
events.hashCode +
|
||||
(holding == null ? 0 : holding.hashCode) +
|
||||
instrument.hashCode +
|
||||
lots.hashCode +
|
||||
prices.hashCode;
|
||||
|
||||
factory InstrumentDetail.fromJson(Map<String, dynamic> json) => _$InstrumentDetailFromJson(json);
|
||||
|
||||
Map<String, dynamic> toJson() => _$InstrumentDetailToJson(this);
|
||||
|
||||
@override
|
||||
String toString() {
|
||||
return toJson().toString();
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -0,0 +1,157 @@
|
||||
// GENERATED CODE - DO NOT MODIFY BY HAND
|
||||
|
||||
part of 'instrument_detail.dart';
|
||||
|
||||
// **************************************************************************
|
||||
// CopyWithGenerator
|
||||
// **************************************************************************
|
||||
|
||||
abstract class _$InstrumentDetailCWProxy {
|
||||
InstrumentDetail events(List<EventOut> events);
|
||||
|
||||
InstrumentDetail holding(HoldingOut? holding);
|
||||
|
||||
InstrumentDetail instrument(InstrumentOut instrument);
|
||||
|
||||
InstrumentDetail lots(List<LotOut> lots);
|
||||
|
||||
InstrumentDetail prices(List<PricePoint> prices);
|
||||
|
||||
/// This function **does support** nullification of nullable fields. All `null` values passed to `non-nullable` fields will be ignored. You can also use `InstrumentDetail(...).copyWith.fieldName(...)` to override fields one at a time with nullification support.
|
||||
///
|
||||
/// Usage
|
||||
/// ```dart
|
||||
/// InstrumentDetail(...).copyWith(id: 12, name: "My name")
|
||||
/// ````
|
||||
InstrumentDetail call({
|
||||
List<EventOut> events,
|
||||
HoldingOut? holding,
|
||||
InstrumentOut instrument,
|
||||
List<LotOut> lots,
|
||||
List<PricePoint> prices,
|
||||
});
|
||||
}
|
||||
|
||||
/// Proxy class for `copyWith` functionality. This is a callable class and can be used as follows: `instanceOfInstrumentDetail.copyWith(...)`. Additionally contains functions for specific fields e.g. `instanceOfInstrumentDetail.copyWith.fieldName(...)`
|
||||
class _$InstrumentDetailCWProxyImpl implements _$InstrumentDetailCWProxy {
|
||||
const _$InstrumentDetailCWProxyImpl(this._value);
|
||||
|
||||
final InstrumentDetail _value;
|
||||
|
||||
@override
|
||||
InstrumentDetail events(List<EventOut> events) => this(events: events);
|
||||
|
||||
@override
|
||||
InstrumentDetail holding(HoldingOut? holding) => this(holding: holding);
|
||||
|
||||
@override
|
||||
InstrumentDetail instrument(InstrumentOut instrument) =>
|
||||
this(instrument: instrument);
|
||||
|
||||
@override
|
||||
InstrumentDetail lots(List<LotOut> lots) => this(lots: lots);
|
||||
|
||||
@override
|
||||
InstrumentDetail prices(List<PricePoint> prices) => this(prices: prices);
|
||||
|
||||
@override
|
||||
/// This function **does support** nullification of nullable fields. All `null` values passed to `non-nullable` fields will be ignored. You can also use `InstrumentDetail(...).copyWith.fieldName(...)` to override fields one at a time with nullification support.
|
||||
///
|
||||
/// Usage
|
||||
/// ```dart
|
||||
/// InstrumentDetail(...).copyWith(id: 12, name: "My name")
|
||||
/// ````
|
||||
InstrumentDetail call({
|
||||
Object? events = const $CopyWithPlaceholder(),
|
||||
Object? holding = const $CopyWithPlaceholder(),
|
||||
Object? instrument = const $CopyWithPlaceholder(),
|
||||
Object? lots = const $CopyWithPlaceholder(),
|
||||
Object? prices = const $CopyWithPlaceholder(),
|
||||
}) {
|
||||
return InstrumentDetail(
|
||||
events: events == const $CopyWithPlaceholder()
|
||||
? _value.events
|
||||
// ignore: cast_nullable_to_non_nullable
|
||||
: events as List<EventOut>,
|
||||
holding: holding == const $CopyWithPlaceholder()
|
||||
? _value.holding
|
||||
// ignore: cast_nullable_to_non_nullable
|
||||
: holding as HoldingOut?,
|
||||
instrument: instrument == const $CopyWithPlaceholder()
|
||||
? _value.instrument
|
||||
// ignore: cast_nullable_to_non_nullable
|
||||
: instrument as InstrumentOut,
|
||||
lots: lots == const $CopyWithPlaceholder()
|
||||
? _value.lots
|
||||
// ignore: cast_nullable_to_non_nullable
|
||||
: lots as List<LotOut>,
|
||||
prices: prices == const $CopyWithPlaceholder()
|
||||
? _value.prices
|
||||
// ignore: cast_nullable_to_non_nullable
|
||||
: prices as List<PricePoint>,
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
extension $InstrumentDetailCopyWith on InstrumentDetail {
|
||||
/// Returns a callable class that can be used as follows: `instanceOfInstrumentDetail.copyWith(...)` or like so:`instanceOfInstrumentDetail.copyWith.fieldName(...)`.
|
||||
// ignore: library_private_types_in_public_api
|
||||
_$InstrumentDetailCWProxy get copyWith => _$InstrumentDetailCWProxyImpl(this);
|
||||
}
|
||||
|
||||
// **************************************************************************
|
||||
// JsonSerializableGenerator
|
||||
// **************************************************************************
|
||||
|
||||
InstrumentDetail _$InstrumentDetailFromJson(Map<String, dynamic> json) =>
|
||||
$checkedCreate('InstrumentDetail', json, ($checkedConvert) {
|
||||
$checkKeys(
|
||||
json,
|
||||
requiredKeys: const [
|
||||
'events',
|
||||
'holding',
|
||||
'instrument',
|
||||
'lots',
|
||||
'prices',
|
||||
],
|
||||
);
|
||||
final val = InstrumentDetail(
|
||||
events: $checkedConvert(
|
||||
'events',
|
||||
(v) => (v as List<dynamic>)
|
||||
.map((e) => EventOut.fromJson(e as Map<String, dynamic>))
|
||||
.toList(),
|
||||
),
|
||||
holding: $checkedConvert(
|
||||
'holding',
|
||||
(v) =>
|
||||
v == null ? null : HoldingOut.fromJson(v as Map<String, dynamic>),
|
||||
),
|
||||
instrument: $checkedConvert(
|
||||
'instrument',
|
||||
(v) => InstrumentOut.fromJson(v as Map<String, dynamic>),
|
||||
),
|
||||
lots: $checkedConvert(
|
||||
'lots',
|
||||
(v) => (v as List<dynamic>)
|
||||
.map((e) => LotOut.fromJson(e as Map<String, dynamic>))
|
||||
.toList(),
|
||||
),
|
||||
prices: $checkedConvert(
|
||||
'prices',
|
||||
(v) => (v as List<dynamic>)
|
||||
.map((e) => PricePoint.fromJson(e as Map<String, dynamic>))
|
||||
.toList(),
|
||||
),
|
||||
);
|
||||
return val;
|
||||
});
|
||||
|
||||
Map<String, dynamic> _$InstrumentDetailToJson(InstrumentDetail instance) =>
|
||||
<String, dynamic>{
|
||||
'events': instance.events.map((e) => e.toJson()).toList(),
|
||||
'holding': instance.holding?.toJson(),
|
||||
'instrument': instance.instrument.toJson(),
|
||||
'lots': instance.lots.map((e) => e.toJson()).toList(),
|
||||
'prices': instance.prices.map((e) => e.toJson()).toList(),
|
||||
};
|
||||
@@ -0,0 +1,315 @@
|
||||
//
|
||||
// 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 'instrument_out.g.dart';
|
||||
|
||||
|
||||
@CopyWith()
|
||||
@JsonSerializable(
|
||||
checked: true,
|
||||
createToJson: true,
|
||||
disallowUnrecognizedKeys: false,
|
||||
explicitToJson: true,
|
||||
)
|
||||
class InstrumentOut {
|
||||
/// Returns a new [InstrumentOut] instance.
|
||||
InstrumentOut({
|
||||
|
||||
required this.assetClass,
|
||||
|
||||
required this.board,
|
||||
|
||||
required this.country,
|
||||
|
||||
required this.currency,
|
||||
|
||||
required this.exchange,
|
||||
|
||||
required this.figi,
|
||||
|
||||
required this.id,
|
||||
|
||||
required this.isActive,
|
||||
|
||||
required this.isin,
|
||||
|
||||
required this.issuer,
|
||||
|
||||
required this.lot,
|
||||
|
||||
required this.maturityDate,
|
||||
|
||||
required this.name,
|
||||
|
||||
required this.nominal,
|
||||
|
||||
required this.nominalCurrency,
|
||||
|
||||
required this.sector,
|
||||
|
||||
required this.ticker,
|
||||
});
|
||||
|
||||
@JsonKey(
|
||||
|
||||
name: r'asset_class',
|
||||
required: true,
|
||||
includeIfNull: false,
|
||||
)
|
||||
|
||||
|
||||
final String assetClass;
|
||||
|
||||
|
||||
|
||||
@JsonKey(
|
||||
|
||||
name: r'board',
|
||||
required: true,
|
||||
includeIfNull: true,
|
||||
)
|
||||
|
||||
|
||||
final String? board;
|
||||
|
||||
|
||||
|
||||
@JsonKey(
|
||||
|
||||
name: r'country',
|
||||
required: true,
|
||||
includeIfNull: true,
|
||||
)
|
||||
|
||||
|
||||
final String? country;
|
||||
|
||||
|
||||
|
||||
@JsonKey(
|
||||
|
||||
name: r'currency',
|
||||
required: true,
|
||||
includeIfNull: false,
|
||||
)
|
||||
|
||||
|
||||
final String currency;
|
||||
|
||||
|
||||
|
||||
@JsonKey(
|
||||
|
||||
name: r'exchange',
|
||||
required: true,
|
||||
includeIfNull: true,
|
||||
)
|
||||
|
||||
|
||||
final String? exchange;
|
||||
|
||||
|
||||
|
||||
@JsonKey(
|
||||
|
||||
name: r'figi',
|
||||
required: true,
|
||||
includeIfNull: true,
|
||||
)
|
||||
|
||||
|
||||
final String? figi;
|
||||
|
||||
|
||||
|
||||
@JsonKey(
|
||||
|
||||
name: r'id',
|
||||
required: true,
|
||||
includeIfNull: false,
|
||||
)
|
||||
|
||||
|
||||
final int id;
|
||||
|
||||
|
||||
|
||||
@JsonKey(
|
||||
|
||||
name: r'is_active',
|
||||
required: true,
|
||||
includeIfNull: false,
|
||||
)
|
||||
|
||||
|
||||
final bool isActive;
|
||||
|
||||
|
||||
|
||||
@JsonKey(
|
||||
|
||||
name: r'isin',
|
||||
required: true,
|
||||
includeIfNull: true,
|
||||
)
|
||||
|
||||
|
||||
final String? isin;
|
||||
|
||||
|
||||
|
||||
@JsonKey(
|
||||
|
||||
name: r'issuer',
|
||||
required: true,
|
||||
includeIfNull: true,
|
||||
)
|
||||
|
||||
|
||||
final String? issuer;
|
||||
|
||||
|
||||
|
||||
@JsonKey(
|
||||
|
||||
name: r'lot',
|
||||
required: true,
|
||||
includeIfNull: false,
|
||||
)
|
||||
|
||||
|
||||
final int lot;
|
||||
|
||||
|
||||
|
||||
@JsonKey(
|
||||
|
||||
name: r'maturity_date',
|
||||
required: true,
|
||||
includeIfNull: true,
|
||||
)
|
||||
|
||||
|
||||
final DateTime? maturityDate;
|
||||
|
||||
|
||||
|
||||
@JsonKey(
|
||||
|
||||
name: r'name',
|
||||
required: true,
|
||||
includeIfNull: false,
|
||||
)
|
||||
|
||||
|
||||
final String name;
|
||||
|
||||
|
||||
|
||||
/// decimal as string
|
||||
@JsonKey(
|
||||
|
||||
name: r'nominal',
|
||||
required: true,
|
||||
includeIfNull: true,
|
||||
)
|
||||
|
||||
|
||||
final String? nominal;
|
||||
|
||||
|
||||
|
||||
@JsonKey(
|
||||
|
||||
name: r'nominal_currency',
|
||||
required: true,
|
||||
includeIfNull: true,
|
||||
)
|
||||
|
||||
|
||||
final String? nominalCurrency;
|
||||
|
||||
|
||||
|
||||
@JsonKey(
|
||||
|
||||
name: r'sector',
|
||||
required: true,
|
||||
includeIfNull: true,
|
||||
)
|
||||
|
||||
|
||||
final String? sector;
|
||||
|
||||
|
||||
|
||||
@JsonKey(
|
||||
|
||||
name: r'ticker',
|
||||
required: true,
|
||||
includeIfNull: true,
|
||||
)
|
||||
|
||||
|
||||
final String? ticker;
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
@override
|
||||
bool operator ==(Object other) => identical(this, other) || other is InstrumentOut &&
|
||||
other.assetClass == assetClass &&
|
||||
other.board == board &&
|
||||
other.country == country &&
|
||||
other.currency == currency &&
|
||||
other.exchange == exchange &&
|
||||
other.figi == figi &&
|
||||
other.id == id &&
|
||||
other.isActive == isActive &&
|
||||
other.isin == isin &&
|
||||
other.issuer == issuer &&
|
||||
other.lot == lot &&
|
||||
other.maturityDate == maturityDate &&
|
||||
other.name == name &&
|
||||
other.nominal == nominal &&
|
||||
other.nominalCurrency == nominalCurrency &&
|
||||
other.sector == sector &&
|
||||
other.ticker == ticker;
|
||||
|
||||
@override
|
||||
int get hashCode =>
|
||||
assetClass.hashCode +
|
||||
(board == null ? 0 : board.hashCode) +
|
||||
(country == null ? 0 : country.hashCode) +
|
||||
currency.hashCode +
|
||||
(exchange == null ? 0 : exchange.hashCode) +
|
||||
(figi == null ? 0 : figi.hashCode) +
|
||||
id.hashCode +
|
||||
isActive.hashCode +
|
||||
(isin == null ? 0 : isin.hashCode) +
|
||||
(issuer == null ? 0 : issuer.hashCode) +
|
||||
lot.hashCode +
|
||||
(maturityDate == null ? 0 : maturityDate.hashCode) +
|
||||
name.hashCode +
|
||||
(nominal == null ? 0 : nominal.hashCode) +
|
||||
(nominalCurrency == null ? 0 : nominalCurrency.hashCode) +
|
||||
(sector == null ? 0 : sector.hashCode) +
|
||||
(ticker == null ? 0 : ticker.hashCode);
|
||||
|
||||
factory InstrumentOut.fromJson(Map<String, dynamic> json) => _$InstrumentOutFromJson(json);
|
||||
|
||||
Map<String, dynamic> toJson() => _$InstrumentOutToJson(this);
|
||||
|
||||
@override
|
||||
String toString() {
|
||||
return toJson().toString();
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -0,0 +1,320 @@
|
||||
// GENERATED CODE - DO NOT MODIFY BY HAND
|
||||
|
||||
part of 'instrument_out.dart';
|
||||
|
||||
// **************************************************************************
|
||||
// CopyWithGenerator
|
||||
// **************************************************************************
|
||||
|
||||
abstract class _$InstrumentOutCWProxy {
|
||||
InstrumentOut assetClass(String assetClass);
|
||||
|
||||
InstrumentOut board(String? board);
|
||||
|
||||
InstrumentOut country(String? country);
|
||||
|
||||
InstrumentOut currency(String currency);
|
||||
|
||||
InstrumentOut exchange(String? exchange);
|
||||
|
||||
InstrumentOut figi(String? figi);
|
||||
|
||||
InstrumentOut id(int id);
|
||||
|
||||
InstrumentOut isActive(bool isActive);
|
||||
|
||||
InstrumentOut isin(String? isin);
|
||||
|
||||
InstrumentOut issuer(String? issuer);
|
||||
|
||||
InstrumentOut lot(int lot);
|
||||
|
||||
InstrumentOut maturityDate(DateTime? maturityDate);
|
||||
|
||||
InstrumentOut name(String name);
|
||||
|
||||
InstrumentOut nominal(String? nominal);
|
||||
|
||||
InstrumentOut nominalCurrency(String? nominalCurrency);
|
||||
|
||||
InstrumentOut sector(String? sector);
|
||||
|
||||
InstrumentOut 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 `InstrumentOut(...).copyWith.fieldName(...)` to override fields one at a time with nullification support.
|
||||
///
|
||||
/// Usage
|
||||
/// ```dart
|
||||
/// InstrumentOut(...).copyWith(id: 12, name: "My name")
|
||||
/// ````
|
||||
InstrumentOut call({
|
||||
String assetClass,
|
||||
String? board,
|
||||
String? country,
|
||||
String currency,
|
||||
String? exchange,
|
||||
String? figi,
|
||||
int id,
|
||||
bool isActive,
|
||||
String? isin,
|
||||
String? issuer,
|
||||
int lot,
|
||||
DateTime? maturityDate,
|
||||
String name,
|
||||
String? nominal,
|
||||
String? nominalCurrency,
|
||||
String? sector,
|
||||
String? ticker,
|
||||
});
|
||||
}
|
||||
|
||||
/// Proxy class for `copyWith` functionality. This is a callable class and can be used as follows: `instanceOfInstrumentOut.copyWith(...)`. Additionally contains functions for specific fields e.g. `instanceOfInstrumentOut.copyWith.fieldName(...)`
|
||||
class _$InstrumentOutCWProxyImpl implements _$InstrumentOutCWProxy {
|
||||
const _$InstrumentOutCWProxyImpl(this._value);
|
||||
|
||||
final InstrumentOut _value;
|
||||
|
||||
@override
|
||||
InstrumentOut assetClass(String assetClass) => this(assetClass: assetClass);
|
||||
|
||||
@override
|
||||
InstrumentOut board(String? board) => this(board: board);
|
||||
|
||||
@override
|
||||
InstrumentOut country(String? country) => this(country: country);
|
||||
|
||||
@override
|
||||
InstrumentOut currency(String currency) => this(currency: currency);
|
||||
|
||||
@override
|
||||
InstrumentOut exchange(String? exchange) => this(exchange: exchange);
|
||||
|
||||
@override
|
||||
InstrumentOut figi(String? figi) => this(figi: figi);
|
||||
|
||||
@override
|
||||
InstrumentOut id(int id) => this(id: id);
|
||||
|
||||
@override
|
||||
InstrumentOut isActive(bool isActive) => this(isActive: isActive);
|
||||
|
||||
@override
|
||||
InstrumentOut isin(String? isin) => this(isin: isin);
|
||||
|
||||
@override
|
||||
InstrumentOut issuer(String? issuer) => this(issuer: issuer);
|
||||
|
||||
@override
|
||||
InstrumentOut lot(int lot) => this(lot: lot);
|
||||
|
||||
@override
|
||||
InstrumentOut maturityDate(DateTime? maturityDate) =>
|
||||
this(maturityDate: maturityDate);
|
||||
|
||||
@override
|
||||
InstrumentOut name(String name) => this(name: name);
|
||||
|
||||
@override
|
||||
InstrumentOut nominal(String? nominal) => this(nominal: nominal);
|
||||
|
||||
@override
|
||||
InstrumentOut nominalCurrency(String? nominalCurrency) =>
|
||||
this(nominalCurrency: nominalCurrency);
|
||||
|
||||
@override
|
||||
InstrumentOut sector(String? sector) => this(sector: sector);
|
||||
|
||||
@override
|
||||
InstrumentOut 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 `InstrumentOut(...).copyWith.fieldName(...)` to override fields one at a time with nullification support.
|
||||
///
|
||||
/// Usage
|
||||
/// ```dart
|
||||
/// InstrumentOut(...).copyWith(id: 12, name: "My name")
|
||||
/// ````
|
||||
InstrumentOut call({
|
||||
Object? assetClass = const $CopyWithPlaceholder(),
|
||||
Object? board = const $CopyWithPlaceholder(),
|
||||
Object? country = const $CopyWithPlaceholder(),
|
||||
Object? currency = const $CopyWithPlaceholder(),
|
||||
Object? exchange = const $CopyWithPlaceholder(),
|
||||
Object? figi = const $CopyWithPlaceholder(),
|
||||
Object? id = const $CopyWithPlaceholder(),
|
||||
Object? isActive = const $CopyWithPlaceholder(),
|
||||
Object? isin = const $CopyWithPlaceholder(),
|
||||
Object? issuer = const $CopyWithPlaceholder(),
|
||||
Object? lot = const $CopyWithPlaceholder(),
|
||||
Object? maturityDate = const $CopyWithPlaceholder(),
|
||||
Object? name = const $CopyWithPlaceholder(),
|
||||
Object? nominal = const $CopyWithPlaceholder(),
|
||||
Object? nominalCurrency = const $CopyWithPlaceholder(),
|
||||
Object? sector = const $CopyWithPlaceholder(),
|
||||
Object? ticker = const $CopyWithPlaceholder(),
|
||||
}) {
|
||||
return InstrumentOut(
|
||||
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?,
|
||||
country: country == const $CopyWithPlaceholder()
|
||||
? _value.country
|
||||
// ignore: cast_nullable_to_non_nullable
|
||||
: country as String?,
|
||||
currency: currency == const $CopyWithPlaceholder()
|
||||
? _value.currency
|
||||
// ignore: cast_nullable_to_non_nullable
|
||||
: currency as String,
|
||||
exchange: exchange == const $CopyWithPlaceholder()
|
||||
? _value.exchange
|
||||
// ignore: cast_nullable_to_non_nullable
|
||||
: exchange as String?,
|
||||
figi: figi == const $CopyWithPlaceholder()
|
||||
? _value.figi
|
||||
// ignore: cast_nullable_to_non_nullable
|
||||
: figi as String?,
|
||||
id: id == const $CopyWithPlaceholder()
|
||||
? _value.id
|
||||
// ignore: cast_nullable_to_non_nullable
|
||||
: id as int,
|
||||
isActive: isActive == const $CopyWithPlaceholder()
|
||||
? _value.isActive
|
||||
// ignore: cast_nullable_to_non_nullable
|
||||
: isActive as bool,
|
||||
isin: isin == const $CopyWithPlaceholder()
|
||||
? _value.isin
|
||||
// ignore: cast_nullable_to_non_nullable
|
||||
: isin as String?,
|
||||
issuer: issuer == const $CopyWithPlaceholder()
|
||||
? _value.issuer
|
||||
// ignore: cast_nullable_to_non_nullable
|
||||
: issuer as String?,
|
||||
lot: lot == const $CopyWithPlaceholder()
|
||||
? _value.lot
|
||||
// ignore: cast_nullable_to_non_nullable
|
||||
: lot as int,
|
||||
maturityDate: maturityDate == const $CopyWithPlaceholder()
|
||||
? _value.maturityDate
|
||||
// ignore: cast_nullable_to_non_nullable
|
||||
: maturityDate as DateTime?,
|
||||
name: name == const $CopyWithPlaceholder()
|
||||
? _value.name
|
||||
// ignore: cast_nullable_to_non_nullable
|
||||
: name as String,
|
||||
nominal: nominal == const $CopyWithPlaceholder()
|
||||
? _value.nominal
|
||||
// ignore: cast_nullable_to_non_nullable
|
||||
: nominal as String?,
|
||||
nominalCurrency: nominalCurrency == const $CopyWithPlaceholder()
|
||||
? _value.nominalCurrency
|
||||
// ignore: cast_nullable_to_non_nullable
|
||||
: nominalCurrency as String?,
|
||||
sector: sector == const $CopyWithPlaceholder()
|
||||
? _value.sector
|
||||
// ignore: cast_nullable_to_non_nullable
|
||||
: sector as String?,
|
||||
ticker: ticker == const $CopyWithPlaceholder()
|
||||
? _value.ticker
|
||||
// ignore: cast_nullable_to_non_nullable
|
||||
: ticker as String?,
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
extension $InstrumentOutCopyWith on InstrumentOut {
|
||||
/// Returns a callable class that can be used as follows: `instanceOfInstrumentOut.copyWith(...)` or like so:`instanceOfInstrumentOut.copyWith.fieldName(...)`.
|
||||
// ignore: library_private_types_in_public_api
|
||||
_$InstrumentOutCWProxy get copyWith => _$InstrumentOutCWProxyImpl(this);
|
||||
}
|
||||
|
||||
// **************************************************************************
|
||||
// JsonSerializableGenerator
|
||||
// **************************************************************************
|
||||
|
||||
InstrumentOut _$InstrumentOutFromJson(Map<String, dynamic> json) =>
|
||||
$checkedCreate(
|
||||
'InstrumentOut',
|
||||
json,
|
||||
($checkedConvert) {
|
||||
$checkKeys(
|
||||
json,
|
||||
requiredKeys: const [
|
||||
'asset_class',
|
||||
'board',
|
||||
'country',
|
||||
'currency',
|
||||
'exchange',
|
||||
'figi',
|
||||
'id',
|
||||
'is_active',
|
||||
'isin',
|
||||
'issuer',
|
||||
'lot',
|
||||
'maturity_date',
|
||||
'name',
|
||||
'nominal',
|
||||
'nominal_currency',
|
||||
'sector',
|
||||
'ticker',
|
||||
],
|
||||
);
|
||||
final val = InstrumentOut(
|
||||
assetClass: $checkedConvert('asset_class', (v) => v as String),
|
||||
board: $checkedConvert('board', (v) => v as String?),
|
||||
country: $checkedConvert('country', (v) => v as String?),
|
||||
currency: $checkedConvert('currency', (v) => v as String),
|
||||
exchange: $checkedConvert('exchange', (v) => v as String?),
|
||||
figi: $checkedConvert('figi', (v) => v as String?),
|
||||
id: $checkedConvert('id', (v) => (v as num).toInt()),
|
||||
isActive: $checkedConvert('is_active', (v) => v as bool),
|
||||
isin: $checkedConvert('isin', (v) => v as String?),
|
||||
issuer: $checkedConvert('issuer', (v) => v as String?),
|
||||
lot: $checkedConvert('lot', (v) => (v as num).toInt()),
|
||||
maturityDate: $checkedConvert(
|
||||
'maturity_date',
|
||||
(v) => v == null ? null : DateTime.parse(v as String),
|
||||
),
|
||||
name: $checkedConvert('name', (v) => v as String),
|
||||
nominal: $checkedConvert('nominal', (v) => v as String?),
|
||||
nominalCurrency: $checkedConvert(
|
||||
'nominal_currency',
|
||||
(v) => v as String?,
|
||||
),
|
||||
sector: $checkedConvert('sector', (v) => v as String?),
|
||||
ticker: $checkedConvert('ticker', (v) => v as String?),
|
||||
);
|
||||
return val;
|
||||
},
|
||||
fieldKeyMap: const {
|
||||
'assetClass': 'asset_class',
|
||||
'isActive': 'is_active',
|
||||
'maturityDate': 'maturity_date',
|
||||
'nominalCurrency': 'nominal_currency',
|
||||
},
|
||||
);
|
||||
|
||||
Map<String, dynamic> _$InstrumentOutToJson(InstrumentOut instance) =>
|
||||
<String, dynamic>{
|
||||
'asset_class': instance.assetClass,
|
||||
'board': instance.board,
|
||||
'country': instance.country,
|
||||
'currency': instance.currency,
|
||||
'exchange': instance.exchange,
|
||||
'figi': instance.figi,
|
||||
'id': instance.id,
|
||||
'is_active': instance.isActive,
|
||||
'isin': instance.isin,
|
||||
'issuer': instance.issuer,
|
||||
'lot': instance.lot,
|
||||
'maturity_date': instance.maturityDate?.toIso8601String(),
|
||||
'name': instance.name,
|
||||
'nominal': instance.nominal,
|
||||
'nominal_currency': instance.nominalCurrency,
|
||||
'sector': instance.sector,
|
||||
'ticker': instance.ticker,
|
||||
};
|
||||
@@ -0,0 +1,190 @@
|
||||
//
|
||||
// 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 'lot_out.g.dart';
|
||||
|
||||
|
||||
@CopyWith()
|
||||
@JsonSerializable(
|
||||
checked: true,
|
||||
createToJson: true,
|
||||
disallowUnrecognizedKeys: false,
|
||||
explicitToJson: true,
|
||||
)
|
||||
class LotOut {
|
||||
/// Returns a new [LotOut] instance.
|
||||
LotOut({
|
||||
|
||||
required this.accountId,
|
||||
|
||||
required this.closedAt,
|
||||
|
||||
required this.costCurrency,
|
||||
|
||||
required this.costPerUnit,
|
||||
|
||||
required this.costTotalRub,
|
||||
|
||||
required this.id,
|
||||
|
||||
required this.openDate,
|
||||
|
||||
required this.qtyOpen,
|
||||
|
||||
required this.qtyRemaining,
|
||||
});
|
||||
|
||||
@JsonKey(
|
||||
|
||||
name: r'account_id',
|
||||
required: true,
|
||||
includeIfNull: false,
|
||||
)
|
||||
|
||||
|
||||
final int accountId;
|
||||
|
||||
|
||||
|
||||
@JsonKey(
|
||||
|
||||
name: r'closed_at',
|
||||
required: true,
|
||||
includeIfNull: true,
|
||||
)
|
||||
|
||||
|
||||
final DateTime? closedAt;
|
||||
|
||||
|
||||
|
||||
@JsonKey(
|
||||
|
||||
name: r'cost_currency',
|
||||
required: true,
|
||||
includeIfNull: false,
|
||||
)
|
||||
|
||||
|
||||
final String costCurrency;
|
||||
|
||||
|
||||
|
||||
/// decimal as string
|
||||
@JsonKey(
|
||||
|
||||
name: r'cost_per_unit',
|
||||
required: true,
|
||||
includeIfNull: false,
|
||||
)
|
||||
|
||||
|
||||
final String costPerUnit;
|
||||
|
||||
|
||||
|
||||
/// decimal as string
|
||||
@JsonKey(
|
||||
|
||||
name: r'cost_total_rub',
|
||||
required: true,
|
||||
includeIfNull: true,
|
||||
)
|
||||
|
||||
|
||||
final String? costTotalRub;
|
||||
|
||||
|
||||
|
||||
@JsonKey(
|
||||
|
||||
name: r'id',
|
||||
required: true,
|
||||
includeIfNull: false,
|
||||
)
|
||||
|
||||
|
||||
final int id;
|
||||
|
||||
|
||||
|
||||
@JsonKey(
|
||||
|
||||
name: r'open_date',
|
||||
required: true,
|
||||
includeIfNull: false,
|
||||
)
|
||||
|
||||
|
||||
final DateTime openDate;
|
||||
|
||||
|
||||
|
||||
/// decimal as string
|
||||
@JsonKey(
|
||||
|
||||
name: r'qty_open',
|
||||
required: true,
|
||||
includeIfNull: false,
|
||||
)
|
||||
|
||||
|
||||
final String qtyOpen;
|
||||
|
||||
|
||||
|
||||
/// decimal as string
|
||||
@JsonKey(
|
||||
|
||||
name: r'qty_remaining',
|
||||
required: true,
|
||||
includeIfNull: false,
|
||||
)
|
||||
|
||||
|
||||
final String qtyRemaining;
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
@override
|
||||
bool operator ==(Object other) => identical(this, other) || other is LotOut &&
|
||||
other.accountId == accountId &&
|
||||
other.closedAt == closedAt &&
|
||||
other.costCurrency == costCurrency &&
|
||||
other.costPerUnit == costPerUnit &&
|
||||
other.costTotalRub == costTotalRub &&
|
||||
other.id == id &&
|
||||
other.openDate == openDate &&
|
||||
other.qtyOpen == qtyOpen &&
|
||||
other.qtyRemaining == qtyRemaining;
|
||||
|
||||
@override
|
||||
int get hashCode =>
|
||||
accountId.hashCode +
|
||||
(closedAt == null ? 0 : closedAt.hashCode) +
|
||||
costCurrency.hashCode +
|
||||
costPerUnit.hashCode +
|
||||
(costTotalRub == null ? 0 : costTotalRub.hashCode) +
|
||||
id.hashCode +
|
||||
openDate.hashCode +
|
||||
qtyOpen.hashCode +
|
||||
qtyRemaining.hashCode;
|
||||
|
||||
factory LotOut.fromJson(Map<String, dynamic> json) => _$LotOutFromJson(json);
|
||||
|
||||
Map<String, dynamic> toJson() => _$LotOutToJson(this);
|
||||
|
||||
@override
|
||||
String toString() {
|
||||
return toJson().toString();
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -0,0 +1,208 @@
|
||||
// GENERATED CODE - DO NOT MODIFY BY HAND
|
||||
|
||||
part of 'lot_out.dart';
|
||||
|
||||
// **************************************************************************
|
||||
// CopyWithGenerator
|
||||
// **************************************************************************
|
||||
|
||||
abstract class _$LotOutCWProxy {
|
||||
LotOut accountId(int accountId);
|
||||
|
||||
LotOut closedAt(DateTime? closedAt);
|
||||
|
||||
LotOut costCurrency(String costCurrency);
|
||||
|
||||
LotOut costPerUnit(String costPerUnit);
|
||||
|
||||
LotOut costTotalRub(String? costTotalRub);
|
||||
|
||||
LotOut id(int id);
|
||||
|
||||
LotOut openDate(DateTime openDate);
|
||||
|
||||
LotOut qtyOpen(String qtyOpen);
|
||||
|
||||
LotOut qtyRemaining(String qtyRemaining);
|
||||
|
||||
/// This function **does support** nullification of nullable fields. All `null` values passed to `non-nullable` fields will be ignored. You can also use `LotOut(...).copyWith.fieldName(...)` to override fields one at a time with nullification support.
|
||||
///
|
||||
/// Usage
|
||||
/// ```dart
|
||||
/// LotOut(...).copyWith(id: 12, name: "My name")
|
||||
/// ````
|
||||
LotOut call({
|
||||
int accountId,
|
||||
DateTime? closedAt,
|
||||
String costCurrency,
|
||||
String costPerUnit,
|
||||
String? costTotalRub,
|
||||
int id,
|
||||
DateTime openDate,
|
||||
String qtyOpen,
|
||||
String qtyRemaining,
|
||||
});
|
||||
}
|
||||
|
||||
/// Proxy class for `copyWith` functionality. This is a callable class and can be used as follows: `instanceOfLotOut.copyWith(...)`. Additionally contains functions for specific fields e.g. `instanceOfLotOut.copyWith.fieldName(...)`
|
||||
class _$LotOutCWProxyImpl implements _$LotOutCWProxy {
|
||||
const _$LotOutCWProxyImpl(this._value);
|
||||
|
||||
final LotOut _value;
|
||||
|
||||
@override
|
||||
LotOut accountId(int accountId) => this(accountId: accountId);
|
||||
|
||||
@override
|
||||
LotOut closedAt(DateTime? closedAt) => this(closedAt: closedAt);
|
||||
|
||||
@override
|
||||
LotOut costCurrency(String costCurrency) => this(costCurrency: costCurrency);
|
||||
|
||||
@override
|
||||
LotOut costPerUnit(String costPerUnit) => this(costPerUnit: costPerUnit);
|
||||
|
||||
@override
|
||||
LotOut costTotalRub(String? costTotalRub) => this(costTotalRub: costTotalRub);
|
||||
|
||||
@override
|
||||
LotOut id(int id) => this(id: id);
|
||||
|
||||
@override
|
||||
LotOut openDate(DateTime openDate) => this(openDate: openDate);
|
||||
|
||||
@override
|
||||
LotOut qtyOpen(String qtyOpen) => this(qtyOpen: qtyOpen);
|
||||
|
||||
@override
|
||||
LotOut qtyRemaining(String qtyRemaining) => this(qtyRemaining: qtyRemaining);
|
||||
|
||||
@override
|
||||
/// This function **does support** nullification of nullable fields. All `null` values passed to `non-nullable` fields will be ignored. You can also use `LotOut(...).copyWith.fieldName(...)` to override fields one at a time with nullification support.
|
||||
///
|
||||
/// Usage
|
||||
/// ```dart
|
||||
/// LotOut(...).copyWith(id: 12, name: "My name")
|
||||
/// ````
|
||||
LotOut call({
|
||||
Object? accountId = const $CopyWithPlaceholder(),
|
||||
Object? closedAt = const $CopyWithPlaceholder(),
|
||||
Object? costCurrency = const $CopyWithPlaceholder(),
|
||||
Object? costPerUnit = const $CopyWithPlaceholder(),
|
||||
Object? costTotalRub = const $CopyWithPlaceholder(),
|
||||
Object? id = const $CopyWithPlaceholder(),
|
||||
Object? openDate = const $CopyWithPlaceholder(),
|
||||
Object? qtyOpen = const $CopyWithPlaceholder(),
|
||||
Object? qtyRemaining = const $CopyWithPlaceholder(),
|
||||
}) {
|
||||
return LotOut(
|
||||
accountId: accountId == const $CopyWithPlaceholder()
|
||||
? _value.accountId
|
||||
// ignore: cast_nullable_to_non_nullable
|
||||
: accountId as int,
|
||||
closedAt: closedAt == const $CopyWithPlaceholder()
|
||||
? _value.closedAt
|
||||
// ignore: cast_nullable_to_non_nullable
|
||||
: closedAt as DateTime?,
|
||||
costCurrency: costCurrency == const $CopyWithPlaceholder()
|
||||
? _value.costCurrency
|
||||
// ignore: cast_nullable_to_non_nullable
|
||||
: costCurrency as String,
|
||||
costPerUnit: costPerUnit == const $CopyWithPlaceholder()
|
||||
? _value.costPerUnit
|
||||
// ignore: cast_nullable_to_non_nullable
|
||||
: costPerUnit as String,
|
||||
costTotalRub: costTotalRub == const $CopyWithPlaceholder()
|
||||
? _value.costTotalRub
|
||||
// ignore: cast_nullable_to_non_nullable
|
||||
: costTotalRub as String?,
|
||||
id: id == const $CopyWithPlaceholder()
|
||||
? _value.id
|
||||
// ignore: cast_nullable_to_non_nullable
|
||||
: id as int,
|
||||
openDate: openDate == const $CopyWithPlaceholder()
|
||||
? _value.openDate
|
||||
// ignore: cast_nullable_to_non_nullable
|
||||
: openDate as DateTime,
|
||||
qtyOpen: qtyOpen == const $CopyWithPlaceholder()
|
||||
? _value.qtyOpen
|
||||
// ignore: cast_nullable_to_non_nullable
|
||||
: qtyOpen as String,
|
||||
qtyRemaining: qtyRemaining == const $CopyWithPlaceholder()
|
||||
? _value.qtyRemaining
|
||||
// ignore: cast_nullable_to_non_nullable
|
||||
: qtyRemaining as String,
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
extension $LotOutCopyWith on LotOut {
|
||||
/// Returns a callable class that can be used as follows: `instanceOfLotOut.copyWith(...)` or like so:`instanceOfLotOut.copyWith.fieldName(...)`.
|
||||
// ignore: library_private_types_in_public_api
|
||||
_$LotOutCWProxy get copyWith => _$LotOutCWProxyImpl(this);
|
||||
}
|
||||
|
||||
// **************************************************************************
|
||||
// JsonSerializableGenerator
|
||||
// **************************************************************************
|
||||
|
||||
LotOut _$LotOutFromJson(Map<String, dynamic> json) => $checkedCreate(
|
||||
'LotOut',
|
||||
json,
|
||||
($checkedConvert) {
|
||||
$checkKeys(
|
||||
json,
|
||||
requiredKeys: const [
|
||||
'account_id',
|
||||
'closed_at',
|
||||
'cost_currency',
|
||||
'cost_per_unit',
|
||||
'cost_total_rub',
|
||||
'id',
|
||||
'open_date',
|
||||
'qty_open',
|
||||
'qty_remaining',
|
||||
],
|
||||
);
|
||||
final val = LotOut(
|
||||
accountId: $checkedConvert('account_id', (v) => (v as num).toInt()),
|
||||
closedAt: $checkedConvert(
|
||||
'closed_at',
|
||||
(v) => v == null ? null : DateTime.parse(v as String),
|
||||
),
|
||||
costCurrency: $checkedConvert('cost_currency', (v) => v as String),
|
||||
costPerUnit: $checkedConvert('cost_per_unit', (v) => v as String),
|
||||
costTotalRub: $checkedConvert('cost_total_rub', (v) => v as String?),
|
||||
id: $checkedConvert('id', (v) => (v as num).toInt()),
|
||||
openDate: $checkedConvert(
|
||||
'open_date',
|
||||
(v) => DateTime.parse(v as String),
|
||||
),
|
||||
qtyOpen: $checkedConvert('qty_open', (v) => v as String),
|
||||
qtyRemaining: $checkedConvert('qty_remaining', (v) => v as String),
|
||||
);
|
||||
return val;
|
||||
},
|
||||
fieldKeyMap: const {
|
||||
'accountId': 'account_id',
|
||||
'closedAt': 'closed_at',
|
||||
'costCurrency': 'cost_currency',
|
||||
'costPerUnit': 'cost_per_unit',
|
||||
'costTotalRub': 'cost_total_rub',
|
||||
'openDate': 'open_date',
|
||||
'qtyOpen': 'qty_open',
|
||||
'qtyRemaining': 'qty_remaining',
|
||||
},
|
||||
);
|
||||
|
||||
Map<String, dynamic> _$LotOutToJson(LotOut instance) => <String, dynamic>{
|
||||
'account_id': instance.accountId,
|
||||
'closed_at': instance.closedAt?.toIso8601String(),
|
||||
'cost_currency': instance.costCurrency,
|
||||
'cost_per_unit': instance.costPerUnit,
|
||||
'cost_total_rub': instance.costTotalRub,
|
||||
'id': instance.id,
|
||||
'open_date': instance.openDate.toIso8601String(),
|
||||
'qty_open': instance.qtyOpen,
|
||||
'qty_remaining': instance.qtyRemaining,
|
||||
};
|
||||
@@ -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 'price_point.g.dart';
|
||||
|
||||
|
||||
@CopyWith()
|
||||
@JsonSerializable(
|
||||
checked: true,
|
||||
createToJson: true,
|
||||
disallowUnrecognizedKeys: false,
|
||||
explicitToJson: true,
|
||||
)
|
||||
class PricePoint {
|
||||
/// Returns a new [PricePoint] instance.
|
||||
PricePoint({
|
||||
|
||||
required this.accruedInterest,
|
||||
|
||||
required this.close,
|
||||
|
||||
required this.currency,
|
||||
|
||||
required this.d,
|
||||
});
|
||||
|
||||
/// decimal as string
|
||||
@JsonKey(
|
||||
|
||||
name: r'accrued_interest',
|
||||
required: true,
|
||||
includeIfNull: true,
|
||||
)
|
||||
|
||||
|
||||
final String? accruedInterest;
|
||||
|
||||
|
||||
|
||||
/// decimal as string
|
||||
@JsonKey(
|
||||
|
||||
name: r'close',
|
||||
required: true,
|
||||
includeIfNull: false,
|
||||
)
|
||||
|
||||
|
||||
final String close;
|
||||
|
||||
|
||||
|
||||
@JsonKey(
|
||||
|
||||
name: r'currency',
|
||||
required: true,
|
||||
includeIfNull: false,
|
||||
)
|
||||
|
||||
|
||||
final String currency;
|
||||
|
||||
|
||||
|
||||
@JsonKey(
|
||||
|
||||
name: r'd',
|
||||
required: true,
|
||||
includeIfNull: false,
|
||||
)
|
||||
|
||||
|
||||
final DateTime d;
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
@override
|
||||
bool operator ==(Object other) => identical(this, other) || other is PricePoint &&
|
||||
other.accruedInterest == accruedInterest &&
|
||||
other.close == close &&
|
||||
other.currency == currency &&
|
||||
other.d == d;
|
||||
|
||||
@override
|
||||
int get hashCode =>
|
||||
(accruedInterest == null ? 0 : accruedInterest.hashCode) +
|
||||
close.hashCode +
|
||||
currency.hashCode +
|
||||
d.hashCode;
|
||||
|
||||
factory PricePoint.fromJson(Map<String, dynamic> json) => _$PricePointFromJson(json);
|
||||
|
||||
Map<String, dynamic> toJson() => _$PricePointToJson(this);
|
||||
|
||||
@override
|
||||
String toString() {
|
||||
return toJson().toString();
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -0,0 +1,120 @@
|
||||
// GENERATED CODE - DO NOT MODIFY BY HAND
|
||||
|
||||
part of 'price_point.dart';
|
||||
|
||||
// **************************************************************************
|
||||
// CopyWithGenerator
|
||||
// **************************************************************************
|
||||
|
||||
abstract class _$PricePointCWProxy {
|
||||
PricePoint accruedInterest(String? accruedInterest);
|
||||
|
||||
PricePoint close(String close);
|
||||
|
||||
PricePoint currency(String currency);
|
||||
|
||||
PricePoint d(DateTime d);
|
||||
|
||||
/// 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
|
||||
/// ```dart
|
||||
/// PricePoint(...).copyWith(id: 12, name: "My name")
|
||||
/// ````
|
||||
PricePoint call({
|
||||
String? accruedInterest,
|
||||
String close,
|
||||
String currency,
|
||||
DateTime d,
|
||||
});
|
||||
}
|
||||
|
||||
/// Proxy class for `copyWith` functionality. This is a callable class and can be used as follows: `instanceOfPricePoint.copyWith(...)`. Additionally contains functions for specific fields e.g. `instanceOfPricePoint.copyWith.fieldName(...)`
|
||||
class _$PricePointCWProxyImpl implements _$PricePointCWProxy {
|
||||
const _$PricePointCWProxyImpl(this._value);
|
||||
|
||||
final PricePoint _value;
|
||||
|
||||
@override
|
||||
PricePoint accruedInterest(String? accruedInterest) =>
|
||||
this(accruedInterest: accruedInterest);
|
||||
|
||||
@override
|
||||
PricePoint close(String close) => this(close: close);
|
||||
|
||||
@override
|
||||
PricePoint currency(String currency) => this(currency: currency);
|
||||
|
||||
@override
|
||||
PricePoint d(DateTime d) => this(d: d);
|
||||
|
||||
@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.
|
||||
///
|
||||
/// Usage
|
||||
/// ```dart
|
||||
/// PricePoint(...).copyWith(id: 12, name: "My name")
|
||||
/// ````
|
||||
PricePoint call({
|
||||
Object? accruedInterest = const $CopyWithPlaceholder(),
|
||||
Object? close = const $CopyWithPlaceholder(),
|
||||
Object? currency = const $CopyWithPlaceholder(),
|
||||
Object? d = const $CopyWithPlaceholder(),
|
||||
}) {
|
||||
return PricePoint(
|
||||
accruedInterest: accruedInterest == const $CopyWithPlaceholder()
|
||||
? _value.accruedInterest
|
||||
// ignore: cast_nullable_to_non_nullable
|
||||
: accruedInterest as String?,
|
||||
close: close == const $CopyWithPlaceholder()
|
||||
? _value.close
|
||||
// ignore: cast_nullable_to_non_nullable
|
||||
: close as String,
|
||||
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,
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
extension $PricePointCopyWith on PricePoint {
|
||||
/// Returns a callable class that can be used as follows: `instanceOfPricePoint.copyWith(...)` or like so:`instanceOfPricePoint.copyWith.fieldName(...)`.
|
||||
// ignore: library_private_types_in_public_api
|
||||
_$PricePointCWProxy get copyWith => _$PricePointCWProxyImpl(this);
|
||||
}
|
||||
|
||||
// **************************************************************************
|
||||
// JsonSerializableGenerator
|
||||
// **************************************************************************
|
||||
|
||||
PricePoint _$PricePointFromJson(Map<String, dynamic> json) => $checkedCreate(
|
||||
'PricePoint',
|
||||
json,
|
||||
($checkedConvert) {
|
||||
$checkKeys(
|
||||
json,
|
||||
requiredKeys: const ['accrued_interest', 'close', 'currency', 'd'],
|
||||
);
|
||||
final val = PricePoint(
|
||||
accruedInterest: $checkedConvert('accrued_interest', (v) => v as String?),
|
||||
close: $checkedConvert('close', (v) => v as String),
|
||||
currency: $checkedConvert('currency', (v) => v as String),
|
||||
d: $checkedConvert('d', (v) => DateTime.parse(v as String)),
|
||||
);
|
||||
return val;
|
||||
},
|
||||
fieldKeyMap: const {'accruedInterest': 'accrued_interest'},
|
||||
);
|
||||
|
||||
Map<String, dynamic> _$PricePointToJson(PricePoint instance) =>
|
||||
<String, dynamic>{
|
||||
'accrued_interest': instance.accruedInterest,
|
||||
'close': instance.close,
|
||||
'currency': instance.currency,
|
||||
'd': instance.d.toIso8601String(),
|
||||
};
|
||||
@@ -0,0 +1,225 @@
|
||||
//
|
||||
// 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 'returns_out.g.dart';
|
||||
|
||||
|
||||
@CopyWith()
|
||||
@JsonSerializable(
|
||||
checked: true,
|
||||
createToJson: true,
|
||||
disallowUnrecognizedKeys: false,
|
||||
explicitToJson: true,
|
||||
)
|
||||
class ReturnsOut {
|
||||
/// Returns a new [ReturnsOut] instance.
|
||||
ReturnsOut({
|
||||
|
||||
required this.absPnlRub,
|
||||
|
||||
required this.dateFrom,
|
||||
|
||||
required this.dateTo,
|
||||
|
||||
required this.externalFlowRub,
|
||||
|
||||
required this.period,
|
||||
|
||||
required this.twr,
|
||||
|
||||
required this.twrAnnualized,
|
||||
|
||||
required this.twrDaysSkipped,
|
||||
|
||||
required this.valueEndRub,
|
||||
|
||||
required this.valueStartRub,
|
||||
|
||||
required this.xirr,
|
||||
});
|
||||
|
||||
/// decimal as string
|
||||
@JsonKey(
|
||||
|
||||
name: r'abs_pnl_rub',
|
||||
required: true,
|
||||
includeIfNull: false,
|
||||
)
|
||||
|
||||
|
||||
final String absPnlRub;
|
||||
|
||||
|
||||
|
||||
@JsonKey(
|
||||
|
||||
name: r'date_from',
|
||||
required: true,
|
||||
includeIfNull: false,
|
||||
)
|
||||
|
||||
|
||||
final DateTime dateFrom;
|
||||
|
||||
|
||||
|
||||
@JsonKey(
|
||||
|
||||
name: r'date_to',
|
||||
required: true,
|
||||
includeIfNull: false,
|
||||
)
|
||||
|
||||
|
||||
final DateTime dateTo;
|
||||
|
||||
|
||||
|
||||
/// decimal as string
|
||||
@JsonKey(
|
||||
|
||||
name: r'external_flow_rub',
|
||||
required: true,
|
||||
includeIfNull: false,
|
||||
)
|
||||
|
||||
|
||||
final String externalFlowRub;
|
||||
|
||||
|
||||
|
||||
@JsonKey(
|
||||
|
||||
name: r'period',
|
||||
required: true,
|
||||
includeIfNull: false,
|
||||
)
|
||||
|
||||
|
||||
final String period;
|
||||
|
||||
|
||||
|
||||
/// 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;
|
||||
|
||||
|
||||
|
||||
@JsonKey(
|
||||
|
||||
name: r'twr_days_skipped',
|
||||
required: true,
|
||||
includeIfNull: false,
|
||||
)
|
||||
|
||||
|
||||
final int twrDaysSkipped;
|
||||
|
||||
|
||||
|
||||
/// decimal as string
|
||||
@JsonKey(
|
||||
|
||||
name: r'value_end_rub',
|
||||
required: true,
|
||||
includeIfNull: false,
|
||||
)
|
||||
|
||||
|
||||
final String valueEndRub;
|
||||
|
||||
|
||||
|
||||
/// decimal as string
|
||||
@JsonKey(
|
||||
|
||||
name: r'value_start_rub',
|
||||
required: true,
|
||||
includeIfNull: false,
|
||||
)
|
||||
|
||||
|
||||
final String valueStartRub;
|
||||
|
||||
|
||||
|
||||
/// decimal as string
|
||||
@JsonKey(
|
||||
|
||||
name: r'xirr',
|
||||
required: true,
|
||||
includeIfNull: true,
|
||||
)
|
||||
|
||||
|
||||
final String? xirr;
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
@override
|
||||
bool operator ==(Object other) => identical(this, other) || other is ReturnsOut &&
|
||||
other.absPnlRub == absPnlRub &&
|
||||
other.dateFrom == dateFrom &&
|
||||
other.dateTo == dateTo &&
|
||||
other.externalFlowRub == externalFlowRub &&
|
||||
other.period == period &&
|
||||
other.twr == twr &&
|
||||
other.twrAnnualized == twrAnnualized &&
|
||||
other.twrDaysSkipped == twrDaysSkipped &&
|
||||
other.valueEndRub == valueEndRub &&
|
||||
other.valueStartRub == valueStartRub &&
|
||||
other.xirr == xirr;
|
||||
|
||||
@override
|
||||
int get hashCode =>
|
||||
absPnlRub.hashCode +
|
||||
dateFrom.hashCode +
|
||||
dateTo.hashCode +
|
||||
externalFlowRub.hashCode +
|
||||
period.hashCode +
|
||||
(twr == null ? 0 : twr.hashCode) +
|
||||
(twrAnnualized == null ? 0 : twrAnnualized.hashCode) +
|
||||
twrDaysSkipped.hashCode +
|
||||
valueEndRub.hashCode +
|
||||
valueStartRub.hashCode +
|
||||
(xirr == null ? 0 : xirr.hashCode);
|
||||
|
||||
factory ReturnsOut.fromJson(Map<String, dynamic> json) => _$ReturnsOutFromJson(json);
|
||||
|
||||
Map<String, dynamic> toJson() => _$ReturnsOutToJson(this);
|
||||
|
||||
@override
|
||||
String toString() {
|
||||
return toJson().toString();
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -0,0 +1,241 @@
|
||||
// GENERATED CODE - DO NOT MODIFY BY HAND
|
||||
|
||||
part of 'returns_out.dart';
|
||||
|
||||
// **************************************************************************
|
||||
// CopyWithGenerator
|
||||
// **************************************************************************
|
||||
|
||||
abstract class _$ReturnsOutCWProxy {
|
||||
ReturnsOut absPnlRub(String absPnlRub);
|
||||
|
||||
ReturnsOut dateFrom(DateTime dateFrom);
|
||||
|
||||
ReturnsOut dateTo(DateTime dateTo);
|
||||
|
||||
ReturnsOut externalFlowRub(String externalFlowRub);
|
||||
|
||||
ReturnsOut period(String period);
|
||||
|
||||
ReturnsOut twr(String? twr);
|
||||
|
||||
ReturnsOut twrAnnualized(String? twrAnnualized);
|
||||
|
||||
ReturnsOut twrDaysSkipped(int twrDaysSkipped);
|
||||
|
||||
ReturnsOut valueEndRub(String valueEndRub);
|
||||
|
||||
ReturnsOut valueStartRub(String valueStartRub);
|
||||
|
||||
ReturnsOut xirr(String? xirr);
|
||||
|
||||
/// This function **does support** nullification of nullable fields. All `null` values passed to `non-nullable` fields will be ignored. You can also use `ReturnsOut(...).copyWith.fieldName(...)` to override fields one at a time with nullification support.
|
||||
///
|
||||
/// Usage
|
||||
/// ```dart
|
||||
/// ReturnsOut(...).copyWith(id: 12, name: "My name")
|
||||
/// ````
|
||||
ReturnsOut call({
|
||||
String absPnlRub,
|
||||
DateTime dateFrom,
|
||||
DateTime dateTo,
|
||||
String externalFlowRub,
|
||||
String period,
|
||||
String? twr,
|
||||
String? twrAnnualized,
|
||||
int twrDaysSkipped,
|
||||
String valueEndRub,
|
||||
String valueStartRub,
|
||||
String? xirr,
|
||||
});
|
||||
}
|
||||
|
||||
/// Proxy class for `copyWith` functionality. This is a callable class and can be used as follows: `instanceOfReturnsOut.copyWith(...)`. Additionally contains functions for specific fields e.g. `instanceOfReturnsOut.copyWith.fieldName(...)`
|
||||
class _$ReturnsOutCWProxyImpl implements _$ReturnsOutCWProxy {
|
||||
const _$ReturnsOutCWProxyImpl(this._value);
|
||||
|
||||
final ReturnsOut _value;
|
||||
|
||||
@override
|
||||
ReturnsOut absPnlRub(String absPnlRub) => this(absPnlRub: absPnlRub);
|
||||
|
||||
@override
|
||||
ReturnsOut dateFrom(DateTime dateFrom) => this(dateFrom: dateFrom);
|
||||
|
||||
@override
|
||||
ReturnsOut dateTo(DateTime dateTo) => this(dateTo: dateTo);
|
||||
|
||||
@override
|
||||
ReturnsOut externalFlowRub(String externalFlowRub) =>
|
||||
this(externalFlowRub: externalFlowRub);
|
||||
|
||||
@override
|
||||
ReturnsOut period(String period) => this(period: period);
|
||||
|
||||
@override
|
||||
ReturnsOut twr(String? twr) => this(twr: twr);
|
||||
|
||||
@override
|
||||
ReturnsOut twrAnnualized(String? twrAnnualized) =>
|
||||
this(twrAnnualized: twrAnnualized);
|
||||
|
||||
@override
|
||||
ReturnsOut twrDaysSkipped(int twrDaysSkipped) =>
|
||||
this(twrDaysSkipped: twrDaysSkipped);
|
||||
|
||||
@override
|
||||
ReturnsOut valueEndRub(String valueEndRub) => this(valueEndRub: valueEndRub);
|
||||
|
||||
@override
|
||||
ReturnsOut valueStartRub(String valueStartRub) =>
|
||||
this(valueStartRub: valueStartRub);
|
||||
|
||||
@override
|
||||
ReturnsOut xirr(String? xirr) => this(xirr: xirr);
|
||||
|
||||
@override
|
||||
/// This function **does support** nullification of nullable fields. All `null` values passed to `non-nullable` fields will be ignored. You can also use `ReturnsOut(...).copyWith.fieldName(...)` to override fields one at a time with nullification support.
|
||||
///
|
||||
/// Usage
|
||||
/// ```dart
|
||||
/// ReturnsOut(...).copyWith(id: 12, name: "My name")
|
||||
/// ````
|
||||
ReturnsOut call({
|
||||
Object? absPnlRub = const $CopyWithPlaceholder(),
|
||||
Object? dateFrom = const $CopyWithPlaceholder(),
|
||||
Object? dateTo = const $CopyWithPlaceholder(),
|
||||
Object? externalFlowRub = const $CopyWithPlaceholder(),
|
||||
Object? period = const $CopyWithPlaceholder(),
|
||||
Object? twr = const $CopyWithPlaceholder(),
|
||||
Object? twrAnnualized = const $CopyWithPlaceholder(),
|
||||
Object? twrDaysSkipped = const $CopyWithPlaceholder(),
|
||||
Object? valueEndRub = const $CopyWithPlaceholder(),
|
||||
Object? valueStartRub = const $CopyWithPlaceholder(),
|
||||
Object? xirr = const $CopyWithPlaceholder(),
|
||||
}) {
|
||||
return ReturnsOut(
|
||||
absPnlRub: absPnlRub == const $CopyWithPlaceholder()
|
||||
? _value.absPnlRub
|
||||
// ignore: cast_nullable_to_non_nullable
|
||||
: absPnlRub as String,
|
||||
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,
|
||||
externalFlowRub: externalFlowRub == const $CopyWithPlaceholder()
|
||||
? _value.externalFlowRub
|
||||
// ignore: cast_nullable_to_non_nullable
|
||||
: externalFlowRub as String,
|
||||
period: period == const $CopyWithPlaceholder()
|
||||
? _value.period
|
||||
// ignore: cast_nullable_to_non_nullable
|
||||
: period 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?,
|
||||
twrDaysSkipped: twrDaysSkipped == const $CopyWithPlaceholder()
|
||||
? _value.twrDaysSkipped
|
||||
// ignore: cast_nullable_to_non_nullable
|
||||
: twrDaysSkipped as int,
|
||||
valueEndRub: valueEndRub == const $CopyWithPlaceholder()
|
||||
? _value.valueEndRub
|
||||
// ignore: cast_nullable_to_non_nullable
|
||||
: valueEndRub as String,
|
||||
valueStartRub: valueStartRub == const $CopyWithPlaceholder()
|
||||
? _value.valueStartRub
|
||||
// ignore: cast_nullable_to_non_nullable
|
||||
: valueStartRub as String,
|
||||
xirr: xirr == const $CopyWithPlaceholder()
|
||||
? _value.xirr
|
||||
// ignore: cast_nullable_to_non_nullable
|
||||
: xirr as String?,
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
extension $ReturnsOutCopyWith on ReturnsOut {
|
||||
/// Returns a callable class that can be used as follows: `instanceOfReturnsOut.copyWith(...)` or like so:`instanceOfReturnsOut.copyWith.fieldName(...)`.
|
||||
// ignore: library_private_types_in_public_api
|
||||
_$ReturnsOutCWProxy get copyWith => _$ReturnsOutCWProxyImpl(this);
|
||||
}
|
||||
|
||||
// **************************************************************************
|
||||
// JsonSerializableGenerator
|
||||
// **************************************************************************
|
||||
|
||||
ReturnsOut _$ReturnsOutFromJson(Map<String, dynamic> json) => $checkedCreate(
|
||||
'ReturnsOut',
|
||||
json,
|
||||
($checkedConvert) {
|
||||
$checkKeys(
|
||||
json,
|
||||
requiredKeys: const [
|
||||
'abs_pnl_rub',
|
||||
'date_from',
|
||||
'date_to',
|
||||
'external_flow_rub',
|
||||
'period',
|
||||
'twr',
|
||||
'twr_annualized',
|
||||
'twr_days_skipped',
|
||||
'value_end_rub',
|
||||
'value_start_rub',
|
||||
'xirr',
|
||||
],
|
||||
);
|
||||
final val = ReturnsOut(
|
||||
absPnlRub: $checkedConvert('abs_pnl_rub', (v) => v as String),
|
||||
dateFrom: $checkedConvert(
|
||||
'date_from',
|
||||
(v) => DateTime.parse(v as String),
|
||||
),
|
||||
dateTo: $checkedConvert('date_to', (v) => DateTime.parse(v as String)),
|
||||
externalFlowRub: $checkedConvert('external_flow_rub', (v) => v as String),
|
||||
period: $checkedConvert('period', (v) => v as String),
|
||||
twr: $checkedConvert('twr', (v) => v as String?),
|
||||
twrAnnualized: $checkedConvert('twr_annualized', (v) => v as String?),
|
||||
twrDaysSkipped: $checkedConvert(
|
||||
'twr_days_skipped',
|
||||
(v) => (v as num).toInt(),
|
||||
),
|
||||
valueEndRub: $checkedConvert('value_end_rub', (v) => v as String),
|
||||
valueStartRub: $checkedConvert('value_start_rub', (v) => v as String),
|
||||
xirr: $checkedConvert('xirr', (v) => v as String?),
|
||||
);
|
||||
return val;
|
||||
},
|
||||
fieldKeyMap: const {
|
||||
'absPnlRub': 'abs_pnl_rub',
|
||||
'dateFrom': 'date_from',
|
||||
'dateTo': 'date_to',
|
||||
'externalFlowRub': 'external_flow_rub',
|
||||
'twrAnnualized': 'twr_annualized',
|
||||
'twrDaysSkipped': 'twr_days_skipped',
|
||||
'valueEndRub': 'value_end_rub',
|
||||
'valueStartRub': 'value_start_rub',
|
||||
},
|
||||
);
|
||||
|
||||
Map<String, dynamic> _$ReturnsOutToJson(ReturnsOut instance) =>
|
||||
<String, dynamic>{
|
||||
'abs_pnl_rub': instance.absPnlRub,
|
||||
'date_from': instance.dateFrom.toIso8601String(),
|
||||
'date_to': instance.dateTo.toIso8601String(),
|
||||
'external_flow_rub': instance.externalFlowRub,
|
||||
'period': instance.period,
|
||||
'twr': instance.twr,
|
||||
'twr_annualized': instance.twrAnnualized,
|
||||
'twr_days_skipped': instance.twrDaysSkipped,
|
||||
'value_end_rub': instance.valueEndRub,
|
||||
'value_start_rub': instance.valueStartRub,
|
||||
'xirr': instance.xirr,
|
||||
};
|
||||
@@ -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 'scope_out.g.dart';
|
||||
|
||||
|
||||
@CopyWith()
|
||||
@JsonSerializable(
|
||||
checked: true,
|
||||
createToJson: true,
|
||||
disallowUnrecognizedKeys: false,
|
||||
explicitToJson: true,
|
||||
)
|
||||
class ScopeOut {
|
||||
/// Returns a new [ScopeOut] instance.
|
||||
ScopeOut({
|
||||
|
||||
required this.accountIds,
|
||||
|
||||
required this.name,
|
||||
|
||||
required this.scope,
|
||||
});
|
||||
|
||||
@JsonKey(
|
||||
|
||||
name: r'account_ids',
|
||||
required: true,
|
||||
includeIfNull: false,
|
||||
)
|
||||
|
||||
|
||||
final List<int> accountIds;
|
||||
|
||||
|
||||
|
||||
@JsonKey(
|
||||
|
||||
name: r'name',
|
||||
required: true,
|
||||
includeIfNull: false,
|
||||
)
|
||||
|
||||
|
||||
final String name;
|
||||
|
||||
|
||||
|
||||
@JsonKey(
|
||||
|
||||
name: r'scope',
|
||||
required: true,
|
||||
includeIfNull: false,
|
||||
)
|
||||
|
||||
|
||||
final String scope;
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
@override
|
||||
bool operator ==(Object other) => identical(this, other) || other is ScopeOut &&
|
||||
other.accountIds == accountIds &&
|
||||
other.name == name &&
|
||||
other.scope == scope;
|
||||
|
||||
@override
|
||||
int get hashCode =>
|
||||
accountIds.hashCode +
|
||||
name.hashCode +
|
||||
scope.hashCode;
|
||||
|
||||
factory ScopeOut.fromJson(Map<String, dynamic> json) => _$ScopeOutFromJson(json);
|
||||
|
||||
Map<String, dynamic> toJson() => _$ScopeOutToJson(this);
|
||||
|
||||
@override
|
||||
String toString() {
|
||||
return toJson().toString();
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -0,0 +1,97 @@
|
||||
// GENERATED CODE - DO NOT MODIFY BY HAND
|
||||
|
||||
part of 'scope_out.dart';
|
||||
|
||||
// **************************************************************************
|
||||
// CopyWithGenerator
|
||||
// **************************************************************************
|
||||
|
||||
abstract class _$ScopeOutCWProxy {
|
||||
ScopeOut accountIds(List<int> accountIds);
|
||||
|
||||
ScopeOut name(String name);
|
||||
|
||||
ScopeOut scope(String scope);
|
||||
|
||||
/// This function **does support** nullification of nullable fields. All `null` values passed to `non-nullable` fields will be ignored. You can also use `ScopeOut(...).copyWith.fieldName(...)` to override fields one at a time with nullification support.
|
||||
///
|
||||
/// Usage
|
||||
/// ```dart
|
||||
/// ScopeOut(...).copyWith(id: 12, name: "My name")
|
||||
/// ````
|
||||
ScopeOut call({List<int> accountIds, String name, String scope});
|
||||
}
|
||||
|
||||
/// Proxy class for `copyWith` functionality. This is a callable class and can be used as follows: `instanceOfScopeOut.copyWith(...)`. Additionally contains functions for specific fields e.g. `instanceOfScopeOut.copyWith.fieldName(...)`
|
||||
class _$ScopeOutCWProxyImpl implements _$ScopeOutCWProxy {
|
||||
const _$ScopeOutCWProxyImpl(this._value);
|
||||
|
||||
final ScopeOut _value;
|
||||
|
||||
@override
|
||||
ScopeOut accountIds(List<int> accountIds) => this(accountIds: accountIds);
|
||||
|
||||
@override
|
||||
ScopeOut name(String name) => this(name: name);
|
||||
|
||||
@override
|
||||
ScopeOut scope(String scope) => this(scope: scope);
|
||||
|
||||
@override
|
||||
/// This function **does support** nullification of nullable fields. All `null` values passed to `non-nullable` fields will be ignored. You can also use `ScopeOut(...).copyWith.fieldName(...)` to override fields one at a time with nullification support.
|
||||
///
|
||||
/// Usage
|
||||
/// ```dart
|
||||
/// ScopeOut(...).copyWith(id: 12, name: "My name")
|
||||
/// ````
|
||||
ScopeOut call({
|
||||
Object? accountIds = const $CopyWithPlaceholder(),
|
||||
Object? name = const $CopyWithPlaceholder(),
|
||||
Object? scope = const $CopyWithPlaceholder(),
|
||||
}) {
|
||||
return ScopeOut(
|
||||
accountIds: accountIds == const $CopyWithPlaceholder()
|
||||
? _value.accountIds
|
||||
// ignore: cast_nullable_to_non_nullable
|
||||
: accountIds as List<int>,
|
||||
name: name == const $CopyWithPlaceholder()
|
||||
? _value.name
|
||||
// ignore: cast_nullable_to_non_nullable
|
||||
: name as String,
|
||||
scope: scope == const $CopyWithPlaceholder()
|
||||
? _value.scope
|
||||
// ignore: cast_nullable_to_non_nullable
|
||||
: scope as String,
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
extension $ScopeOutCopyWith on ScopeOut {
|
||||
/// Returns a callable class that can be used as follows: `instanceOfScopeOut.copyWith(...)` or like so:`instanceOfScopeOut.copyWith.fieldName(...)`.
|
||||
// ignore: library_private_types_in_public_api
|
||||
_$ScopeOutCWProxy get copyWith => _$ScopeOutCWProxyImpl(this);
|
||||
}
|
||||
|
||||
// **************************************************************************
|
||||
// JsonSerializableGenerator
|
||||
// **************************************************************************
|
||||
|
||||
ScopeOut _$ScopeOutFromJson(Map<String, dynamic> json) =>
|
||||
$checkedCreate('ScopeOut', json, ($checkedConvert) {
|
||||
$checkKeys(json, requiredKeys: const ['account_ids', 'name', 'scope']);
|
||||
final val = ScopeOut(
|
||||
accountIds: $checkedConvert(
|
||||
'account_ids',
|
||||
(v) => (v as List<dynamic>).map((e) => (e as num).toInt()).toList(),
|
||||
),
|
||||
name: $checkedConvert('name', (v) => v as String),
|
||||
scope: $checkedConvert('scope', (v) => v as String),
|
||||
);
|
||||
return val;
|
||||
}, fieldKeyMap: const {'accountIds': 'account_ids'});
|
||||
|
||||
Map<String, dynamic> _$ScopeOutToJson(ScopeOut instance) => <String, dynamic>{
|
||||
'account_ids': instance.accountIds,
|
||||
'name': instance.name,
|
||||
'scope': instance.scope,
|
||||
};
|
||||
@@ -0,0 +1,274 @@
|
||||
//
|
||||
// AUTO-GENERATED FILE, DO NOT MODIFY!
|
||||
//
|
||||
|
||||
// ignore_for_file: unused_element
|
||||
import 'package:fintracker_api/src/model/returns_out.dart';
|
||||
import 'package:copy_with_extension/copy_with_extension.dart';
|
||||
import 'package:json_annotation/json_annotation.dart';
|
||||
|
||||
part 'summary_out.g.dart';
|
||||
|
||||
|
||||
@CopyWith()
|
||||
@JsonSerializable(
|
||||
checked: true,
|
||||
createToJson: true,
|
||||
disallowUnrecognizedKeys: false,
|
||||
explicitToJson: true,
|
||||
)
|
||||
class SummaryOut {
|
||||
/// Returns a new [SummaryOut] instance.
|
||||
SummaryOut({
|
||||
|
||||
required this.asOf,
|
||||
|
||||
required this.cashRub,
|
||||
|
||||
required this.computedAt,
|
||||
|
||||
required this.holdingCount,
|
||||
|
||||
required this.incomeRub,
|
||||
|
||||
required this.investedNetRub,
|
||||
|
||||
required this.marketValueRub,
|
||||
|
||||
required this.pnlTotalRub,
|
||||
|
||||
required this.realizedPnlRub,
|
||||
|
||||
required this.returns,
|
||||
|
||||
required this.scope,
|
||||
|
||||
required this.staleCount,
|
||||
|
||||
required this.totalRub,
|
||||
|
||||
required this.unpricedCount,
|
||||
});
|
||||
|
||||
@JsonKey(
|
||||
|
||||
name: r'as_of',
|
||||
required: true,
|
||||
includeIfNull: true,
|
||||
)
|
||||
|
||||
|
||||
final DateTime? asOf;
|
||||
|
||||
|
||||
|
||||
/// decimal as string
|
||||
@JsonKey(
|
||||
|
||||
name: r'cash_rub',
|
||||
required: true,
|
||||
includeIfNull: false,
|
||||
)
|
||||
|
||||
|
||||
final String cashRub;
|
||||
|
||||
|
||||
|
||||
@JsonKey(
|
||||
|
||||
name: r'computed_at',
|
||||
required: true,
|
||||
includeIfNull: true,
|
||||
)
|
||||
|
||||
|
||||
final DateTime? computedAt;
|
||||
|
||||
|
||||
|
||||
@JsonKey(
|
||||
|
||||
name: r'holding_count',
|
||||
required: true,
|
||||
includeIfNull: false,
|
||||
)
|
||||
|
||||
|
||||
final int holdingCount;
|
||||
|
||||
|
||||
|
||||
/// decimal as string
|
||||
@JsonKey(
|
||||
|
||||
name: r'income_rub',
|
||||
required: true,
|
||||
includeIfNull: false,
|
||||
)
|
||||
|
||||
|
||||
final String incomeRub;
|
||||
|
||||
|
||||
|
||||
/// decimal as string
|
||||
@JsonKey(
|
||||
|
||||
name: r'invested_net_rub',
|
||||
required: true,
|
||||
includeIfNull: false,
|
||||
)
|
||||
|
||||
|
||||
final String investedNetRub;
|
||||
|
||||
|
||||
|
||||
/// decimal as string
|
||||
@JsonKey(
|
||||
|
||||
name: r'market_value_rub',
|
||||
required: true,
|
||||
includeIfNull: false,
|
||||
)
|
||||
|
||||
|
||||
final String marketValueRub;
|
||||
|
||||
|
||||
|
||||
/// decimal as string
|
||||
@JsonKey(
|
||||
|
||||
name: r'pnl_total_rub',
|
||||
required: true,
|
||||
includeIfNull: true,
|
||||
)
|
||||
|
||||
|
||||
final String? pnlTotalRub;
|
||||
|
||||
|
||||
|
||||
/// decimal as string
|
||||
@JsonKey(
|
||||
|
||||
name: r'realized_pnl_rub',
|
||||
required: true,
|
||||
includeIfNull: false,
|
||||
)
|
||||
|
||||
|
||||
final String realizedPnlRub;
|
||||
|
||||
|
||||
|
||||
@JsonKey(
|
||||
|
||||
name: r'returns',
|
||||
required: true,
|
||||
includeIfNull: false,
|
||||
)
|
||||
|
||||
|
||||
final List<ReturnsOut> returns;
|
||||
|
||||
|
||||
|
||||
@JsonKey(
|
||||
|
||||
name: r'scope',
|
||||
required: true,
|
||||
includeIfNull: false,
|
||||
)
|
||||
|
||||
|
||||
final String scope;
|
||||
|
||||
|
||||
|
||||
@JsonKey(
|
||||
|
||||
name: r'stale_count',
|
||||
required: true,
|
||||
includeIfNull: false,
|
||||
)
|
||||
|
||||
|
||||
final int staleCount;
|
||||
|
||||
|
||||
|
||||
/// decimal as string
|
||||
@JsonKey(
|
||||
|
||||
name: r'total_rub',
|
||||
required: true,
|
||||
includeIfNull: false,
|
||||
)
|
||||
|
||||
|
||||
final String totalRub;
|
||||
|
||||
|
||||
|
||||
@JsonKey(
|
||||
|
||||
name: r'unpriced_count',
|
||||
required: true,
|
||||
includeIfNull: false,
|
||||
)
|
||||
|
||||
|
||||
final int unpricedCount;
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
@override
|
||||
bool operator ==(Object other) => identical(this, other) || other is SummaryOut &&
|
||||
other.asOf == asOf &&
|
||||
other.cashRub == cashRub &&
|
||||
other.computedAt == computedAt &&
|
||||
other.holdingCount == holdingCount &&
|
||||
other.incomeRub == incomeRub &&
|
||||
other.investedNetRub == investedNetRub &&
|
||||
other.marketValueRub == marketValueRub &&
|
||||
other.pnlTotalRub == pnlTotalRub &&
|
||||
other.realizedPnlRub == realizedPnlRub &&
|
||||
other.returns == returns &&
|
||||
other.scope == scope &&
|
||||
other.staleCount == staleCount &&
|
||||
other.totalRub == totalRub &&
|
||||
other.unpricedCount == unpricedCount;
|
||||
|
||||
@override
|
||||
int get hashCode =>
|
||||
(asOf == null ? 0 : asOf.hashCode) +
|
||||
cashRub.hashCode +
|
||||
(computedAt == null ? 0 : computedAt.hashCode) +
|
||||
holdingCount.hashCode +
|
||||
incomeRub.hashCode +
|
||||
investedNetRub.hashCode +
|
||||
marketValueRub.hashCode +
|
||||
(pnlTotalRub == null ? 0 : pnlTotalRub.hashCode) +
|
||||
realizedPnlRub.hashCode +
|
||||
returns.hashCode +
|
||||
scope.hashCode +
|
||||
staleCount.hashCode +
|
||||
totalRub.hashCode +
|
||||
unpricedCount.hashCode;
|
||||
|
||||
factory SummaryOut.fromJson(Map<String, dynamic> json) => _$SummaryOutFromJson(json);
|
||||
|
||||
Map<String, dynamic> toJson() => _$SummaryOutToJson(this);
|
||||
|
||||
@override
|
||||
String toString() {
|
||||
return toJson().toString();
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -0,0 +1,295 @@
|
||||
// GENERATED CODE - DO NOT MODIFY BY HAND
|
||||
|
||||
part of 'summary_out.dart';
|
||||
|
||||
// **************************************************************************
|
||||
// CopyWithGenerator
|
||||
// **************************************************************************
|
||||
|
||||
abstract class _$SummaryOutCWProxy {
|
||||
SummaryOut asOf(DateTime? asOf);
|
||||
|
||||
SummaryOut cashRub(String cashRub);
|
||||
|
||||
SummaryOut computedAt(DateTime? computedAt);
|
||||
|
||||
SummaryOut holdingCount(int holdingCount);
|
||||
|
||||
SummaryOut incomeRub(String incomeRub);
|
||||
|
||||
SummaryOut investedNetRub(String investedNetRub);
|
||||
|
||||
SummaryOut marketValueRub(String marketValueRub);
|
||||
|
||||
SummaryOut pnlTotalRub(String? pnlTotalRub);
|
||||
|
||||
SummaryOut realizedPnlRub(String realizedPnlRub);
|
||||
|
||||
SummaryOut returns(List<ReturnsOut> returns);
|
||||
|
||||
SummaryOut scope(String scope);
|
||||
|
||||
SummaryOut staleCount(int staleCount);
|
||||
|
||||
SummaryOut totalRub(String totalRub);
|
||||
|
||||
SummaryOut unpricedCount(int unpricedCount);
|
||||
|
||||
/// This function **does support** nullification of nullable fields. All `null` values passed to `non-nullable` fields will be ignored. You can also use `SummaryOut(...).copyWith.fieldName(...)` to override fields one at a time with nullification support.
|
||||
///
|
||||
/// Usage
|
||||
/// ```dart
|
||||
/// SummaryOut(...).copyWith(id: 12, name: "My name")
|
||||
/// ````
|
||||
SummaryOut call({
|
||||
DateTime? asOf,
|
||||
String cashRub,
|
||||
DateTime? computedAt,
|
||||
int holdingCount,
|
||||
String incomeRub,
|
||||
String investedNetRub,
|
||||
String marketValueRub,
|
||||
String? pnlTotalRub,
|
||||
String realizedPnlRub,
|
||||
List<ReturnsOut> returns,
|
||||
String scope,
|
||||
int staleCount,
|
||||
String totalRub,
|
||||
int unpricedCount,
|
||||
});
|
||||
}
|
||||
|
||||
/// Proxy class for `copyWith` functionality. This is a callable class and can be used as follows: `instanceOfSummaryOut.copyWith(...)`. Additionally contains functions for specific fields e.g. `instanceOfSummaryOut.copyWith.fieldName(...)`
|
||||
class _$SummaryOutCWProxyImpl implements _$SummaryOutCWProxy {
|
||||
const _$SummaryOutCWProxyImpl(this._value);
|
||||
|
||||
final SummaryOut _value;
|
||||
|
||||
@override
|
||||
SummaryOut asOf(DateTime? asOf) => this(asOf: asOf);
|
||||
|
||||
@override
|
||||
SummaryOut cashRub(String cashRub) => this(cashRub: cashRub);
|
||||
|
||||
@override
|
||||
SummaryOut computedAt(DateTime? computedAt) => this(computedAt: computedAt);
|
||||
|
||||
@override
|
||||
SummaryOut holdingCount(int holdingCount) => this(holdingCount: holdingCount);
|
||||
|
||||
@override
|
||||
SummaryOut incomeRub(String incomeRub) => this(incomeRub: incomeRub);
|
||||
|
||||
@override
|
||||
SummaryOut investedNetRub(String investedNetRub) =>
|
||||
this(investedNetRub: investedNetRub);
|
||||
|
||||
@override
|
||||
SummaryOut marketValueRub(String marketValueRub) =>
|
||||
this(marketValueRub: marketValueRub);
|
||||
|
||||
@override
|
||||
SummaryOut pnlTotalRub(String? pnlTotalRub) => this(pnlTotalRub: pnlTotalRub);
|
||||
|
||||
@override
|
||||
SummaryOut realizedPnlRub(String realizedPnlRub) =>
|
||||
this(realizedPnlRub: realizedPnlRub);
|
||||
|
||||
@override
|
||||
SummaryOut returns(List<ReturnsOut> returns) => this(returns: returns);
|
||||
|
||||
@override
|
||||
SummaryOut scope(String scope) => this(scope: scope);
|
||||
|
||||
@override
|
||||
SummaryOut staleCount(int staleCount) => this(staleCount: staleCount);
|
||||
|
||||
@override
|
||||
SummaryOut totalRub(String totalRub) => this(totalRub: totalRub);
|
||||
|
||||
@override
|
||||
SummaryOut unpricedCount(int unpricedCount) =>
|
||||
this(unpricedCount: unpricedCount);
|
||||
|
||||
@override
|
||||
/// This function **does support** nullification of nullable fields. All `null` values passed to `non-nullable` fields will be ignored. You can also use `SummaryOut(...).copyWith.fieldName(...)` to override fields one at a time with nullification support.
|
||||
///
|
||||
/// Usage
|
||||
/// ```dart
|
||||
/// SummaryOut(...).copyWith(id: 12, name: "My name")
|
||||
/// ````
|
||||
SummaryOut call({
|
||||
Object? asOf = const $CopyWithPlaceholder(),
|
||||
Object? cashRub = const $CopyWithPlaceholder(),
|
||||
Object? computedAt = const $CopyWithPlaceholder(),
|
||||
Object? holdingCount = const $CopyWithPlaceholder(),
|
||||
Object? incomeRub = const $CopyWithPlaceholder(),
|
||||
Object? investedNetRub = const $CopyWithPlaceholder(),
|
||||
Object? marketValueRub = const $CopyWithPlaceholder(),
|
||||
Object? pnlTotalRub = const $CopyWithPlaceholder(),
|
||||
Object? realizedPnlRub = const $CopyWithPlaceholder(),
|
||||
Object? returns = const $CopyWithPlaceholder(),
|
||||
Object? scope = const $CopyWithPlaceholder(),
|
||||
Object? staleCount = const $CopyWithPlaceholder(),
|
||||
Object? totalRub = const $CopyWithPlaceholder(),
|
||||
Object? unpricedCount = const $CopyWithPlaceholder(),
|
||||
}) {
|
||||
return SummaryOut(
|
||||
asOf: asOf == const $CopyWithPlaceholder()
|
||||
? _value.asOf
|
||||
// ignore: cast_nullable_to_non_nullable
|
||||
: asOf as DateTime?,
|
||||
cashRub: cashRub == const $CopyWithPlaceholder()
|
||||
? _value.cashRub
|
||||
// ignore: cast_nullable_to_non_nullable
|
||||
: cashRub as String,
|
||||
computedAt: computedAt == const $CopyWithPlaceholder()
|
||||
? _value.computedAt
|
||||
// ignore: cast_nullable_to_non_nullable
|
||||
: computedAt as DateTime?,
|
||||
holdingCount: holdingCount == const $CopyWithPlaceholder()
|
||||
? _value.holdingCount
|
||||
// ignore: cast_nullable_to_non_nullable
|
||||
: holdingCount as int,
|
||||
incomeRub: incomeRub == const $CopyWithPlaceholder()
|
||||
? _value.incomeRub
|
||||
// ignore: cast_nullable_to_non_nullable
|
||||
: incomeRub as String,
|
||||
investedNetRub: investedNetRub == const $CopyWithPlaceholder()
|
||||
? _value.investedNetRub
|
||||
// ignore: cast_nullable_to_non_nullable
|
||||
: investedNetRub as String,
|
||||
marketValueRub: marketValueRub == const $CopyWithPlaceholder()
|
||||
? _value.marketValueRub
|
||||
// ignore: cast_nullable_to_non_nullable
|
||||
: marketValueRub as String,
|
||||
pnlTotalRub: pnlTotalRub == const $CopyWithPlaceholder()
|
||||
? _value.pnlTotalRub
|
||||
// ignore: cast_nullable_to_non_nullable
|
||||
: pnlTotalRub as String?,
|
||||
realizedPnlRub: realizedPnlRub == const $CopyWithPlaceholder()
|
||||
? _value.realizedPnlRub
|
||||
// ignore: cast_nullable_to_non_nullable
|
||||
: realizedPnlRub as String,
|
||||
returns: returns == const $CopyWithPlaceholder()
|
||||
? _value.returns
|
||||
// ignore: cast_nullable_to_non_nullable
|
||||
: returns as List<ReturnsOut>,
|
||||
scope: scope == const $CopyWithPlaceholder()
|
||||
? _value.scope
|
||||
// ignore: cast_nullable_to_non_nullable
|
||||
: scope as String,
|
||||
staleCount: staleCount == const $CopyWithPlaceholder()
|
||||
? _value.staleCount
|
||||
// ignore: cast_nullable_to_non_nullable
|
||||
: staleCount as int,
|
||||
totalRub: totalRub == const $CopyWithPlaceholder()
|
||||
? _value.totalRub
|
||||
// ignore: cast_nullable_to_non_nullable
|
||||
: totalRub as String,
|
||||
unpricedCount: unpricedCount == const $CopyWithPlaceholder()
|
||||
? _value.unpricedCount
|
||||
// ignore: cast_nullable_to_non_nullable
|
||||
: unpricedCount as int,
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
extension $SummaryOutCopyWith on SummaryOut {
|
||||
/// Returns a callable class that can be used as follows: `instanceOfSummaryOut.copyWith(...)` or like so:`instanceOfSummaryOut.copyWith.fieldName(...)`.
|
||||
// ignore: library_private_types_in_public_api
|
||||
_$SummaryOutCWProxy get copyWith => _$SummaryOutCWProxyImpl(this);
|
||||
}
|
||||
|
||||
// **************************************************************************
|
||||
// JsonSerializableGenerator
|
||||
// **************************************************************************
|
||||
|
||||
SummaryOut _$SummaryOutFromJson(Map<String, dynamic> json) => $checkedCreate(
|
||||
'SummaryOut',
|
||||
json,
|
||||
($checkedConvert) {
|
||||
$checkKeys(
|
||||
json,
|
||||
requiredKeys: const [
|
||||
'as_of',
|
||||
'cash_rub',
|
||||
'computed_at',
|
||||
'holding_count',
|
||||
'income_rub',
|
||||
'invested_net_rub',
|
||||
'market_value_rub',
|
||||
'pnl_total_rub',
|
||||
'realized_pnl_rub',
|
||||
'returns',
|
||||
'scope',
|
||||
'stale_count',
|
||||
'total_rub',
|
||||
'unpriced_count',
|
||||
],
|
||||
);
|
||||
final val = SummaryOut(
|
||||
asOf: $checkedConvert(
|
||||
'as_of',
|
||||
(v) => v == null ? null : DateTime.parse(v as String),
|
||||
),
|
||||
cashRub: $checkedConvert('cash_rub', (v) => v as String),
|
||||
computedAt: $checkedConvert(
|
||||
'computed_at',
|
||||
(v) => v == null ? null : DateTime.parse(v as String),
|
||||
),
|
||||
holdingCount: $checkedConvert('holding_count', (v) => (v as num).toInt()),
|
||||
incomeRub: $checkedConvert('income_rub', (v) => v as String),
|
||||
investedNetRub: $checkedConvert('invested_net_rub', (v) => v as String),
|
||||
marketValueRub: $checkedConvert('market_value_rub', (v) => v as String),
|
||||
pnlTotalRub: $checkedConvert('pnl_total_rub', (v) => v as String?),
|
||||
realizedPnlRub: $checkedConvert('realized_pnl_rub', (v) => v as String),
|
||||
returns: $checkedConvert(
|
||||
'returns',
|
||||
(v) => (v as List<dynamic>)
|
||||
.map((e) => ReturnsOut.fromJson(e as Map<String, dynamic>))
|
||||
.toList(),
|
||||
),
|
||||
scope: $checkedConvert('scope', (v) => v as String),
|
||||
staleCount: $checkedConvert('stale_count', (v) => (v as num).toInt()),
|
||||
totalRub: $checkedConvert('total_rub', (v) => v as String),
|
||||
unpricedCount: $checkedConvert(
|
||||
'unpriced_count',
|
||||
(v) => (v as num).toInt(),
|
||||
),
|
||||
);
|
||||
return val;
|
||||
},
|
||||
fieldKeyMap: const {
|
||||
'asOf': 'as_of',
|
||||
'cashRub': 'cash_rub',
|
||||
'computedAt': 'computed_at',
|
||||
'holdingCount': 'holding_count',
|
||||
'incomeRub': 'income_rub',
|
||||
'investedNetRub': 'invested_net_rub',
|
||||
'marketValueRub': 'market_value_rub',
|
||||
'pnlTotalRub': 'pnl_total_rub',
|
||||
'realizedPnlRub': 'realized_pnl_rub',
|
||||
'staleCount': 'stale_count',
|
||||
'totalRub': 'total_rub',
|
||||
'unpricedCount': 'unpriced_count',
|
||||
},
|
||||
);
|
||||
|
||||
Map<String, dynamic> _$SummaryOutToJson(SummaryOut instance) =>
|
||||
<String, dynamic>{
|
||||
'as_of': instance.asOf?.toIso8601String(),
|
||||
'cash_rub': instance.cashRub,
|
||||
'computed_at': instance.computedAt?.toIso8601String(),
|
||||
'holding_count': instance.holdingCount,
|
||||
'income_rub': instance.incomeRub,
|
||||
'invested_net_rub': instance.investedNetRub,
|
||||
'market_value_rub': instance.marketValueRub,
|
||||
'pnl_total_rub': instance.pnlTotalRub,
|
||||
'realized_pnl_rub': instance.realizedPnlRub,
|
||||
'returns': instance.returns.map((e) => e.toJson()).toList(),
|
||||
'scope': instance.scope,
|
||||
'stale_count': instance.staleCount,
|
||||
'total_rub': instance.totalRub,
|
||||
'unpriced_count': instance.unpricedCount,
|
||||
};
|
||||
@@ -0,0 +1,225 @@
|
||||
//
|
||||
// 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 'value_day.g.dart';
|
||||
|
||||
|
||||
@CopyWith()
|
||||
@JsonSerializable(
|
||||
checked: true,
|
||||
createToJson: true,
|
||||
disallowUnrecognizedKeys: false,
|
||||
explicitToJson: true,
|
||||
)
|
||||
class ValueDay {
|
||||
/// Returns a new [ValueDay] instance.
|
||||
ValueDay({
|
||||
|
||||
required this.accruedInterestRub,
|
||||
|
||||
required this.cashRub,
|
||||
|
||||
required this.d,
|
||||
|
||||
required this.externalFlowRub,
|
||||
|
||||
required this.investedNetRub,
|
||||
|
||||
required this.marketValueRub,
|
||||
|
||||
required this.missingFxCount,
|
||||
|
||||
required this.missingPriceCount,
|
||||
|
||||
required this.pnlTotalRub,
|
||||
|
||||
required this.stalePriceCount,
|
||||
|
||||
required this.totalRub,
|
||||
});
|
||||
|
||||
/// decimal as string
|
||||
@JsonKey(
|
||||
|
||||
name: r'accrued_interest_rub',
|
||||
required: true,
|
||||
includeIfNull: false,
|
||||
)
|
||||
|
||||
|
||||
final String accruedInterestRub;
|
||||
|
||||
|
||||
|
||||
/// decimal as string
|
||||
@JsonKey(
|
||||
|
||||
name: r'cash_rub',
|
||||
required: true,
|
||||
includeIfNull: false,
|
||||
)
|
||||
|
||||
|
||||
final String cashRub;
|
||||
|
||||
|
||||
|
||||
@JsonKey(
|
||||
|
||||
name: r'd',
|
||||
required: true,
|
||||
includeIfNull: false,
|
||||
)
|
||||
|
||||
|
||||
final DateTime d;
|
||||
|
||||
|
||||
|
||||
/// decimal as string
|
||||
@JsonKey(
|
||||
|
||||
name: r'external_flow_rub',
|
||||
required: true,
|
||||
includeIfNull: false,
|
||||
)
|
||||
|
||||
|
||||
final String externalFlowRub;
|
||||
|
||||
|
||||
|
||||
/// decimal as string
|
||||
@JsonKey(
|
||||
|
||||
name: r'invested_net_rub',
|
||||
required: true,
|
||||
includeIfNull: false,
|
||||
)
|
||||
|
||||
|
||||
final String investedNetRub;
|
||||
|
||||
|
||||
|
||||
/// decimal as string
|
||||
@JsonKey(
|
||||
|
||||
name: r'market_value_rub',
|
||||
required: true,
|
||||
includeIfNull: false,
|
||||
)
|
||||
|
||||
|
||||
final String marketValueRub;
|
||||
|
||||
|
||||
|
||||
@JsonKey(
|
||||
|
||||
name: r'missing_fx_count',
|
||||
required: true,
|
||||
includeIfNull: false,
|
||||
)
|
||||
|
||||
|
||||
final int missingFxCount;
|
||||
|
||||
|
||||
|
||||
@JsonKey(
|
||||
|
||||
name: r'missing_price_count',
|
||||
required: true,
|
||||
includeIfNull: false,
|
||||
)
|
||||
|
||||
|
||||
final int missingPriceCount;
|
||||
|
||||
|
||||
|
||||
/// decimal as string
|
||||
@JsonKey(
|
||||
|
||||
name: r'pnl_total_rub',
|
||||
required: true,
|
||||
includeIfNull: true,
|
||||
)
|
||||
|
||||
|
||||
final String? pnlTotalRub;
|
||||
|
||||
|
||||
|
||||
@JsonKey(
|
||||
|
||||
name: r'stale_price_count',
|
||||
required: true,
|
||||
includeIfNull: false,
|
||||
)
|
||||
|
||||
|
||||
final int stalePriceCount;
|
||||
|
||||
|
||||
|
||||
/// decimal as string
|
||||
@JsonKey(
|
||||
|
||||
name: r'total_rub',
|
||||
required: true,
|
||||
includeIfNull: false,
|
||||
)
|
||||
|
||||
|
||||
final String totalRub;
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
@override
|
||||
bool operator ==(Object other) => identical(this, other) || other is ValueDay &&
|
||||
other.accruedInterestRub == accruedInterestRub &&
|
||||
other.cashRub == cashRub &&
|
||||
other.d == d &&
|
||||
other.externalFlowRub == externalFlowRub &&
|
||||
other.investedNetRub == investedNetRub &&
|
||||
other.marketValueRub == marketValueRub &&
|
||||
other.missingFxCount == missingFxCount &&
|
||||
other.missingPriceCount == missingPriceCount &&
|
||||
other.pnlTotalRub == pnlTotalRub &&
|
||||
other.stalePriceCount == stalePriceCount &&
|
||||
other.totalRub == totalRub;
|
||||
|
||||
@override
|
||||
int get hashCode =>
|
||||
accruedInterestRub.hashCode +
|
||||
cashRub.hashCode +
|
||||
d.hashCode +
|
||||
externalFlowRub.hashCode +
|
||||
investedNetRub.hashCode +
|
||||
marketValueRub.hashCode +
|
||||
missingFxCount.hashCode +
|
||||
missingPriceCount.hashCode +
|
||||
(pnlTotalRub == null ? 0 : pnlTotalRub.hashCode) +
|
||||
stalePriceCount.hashCode +
|
||||
totalRub.hashCode;
|
||||
|
||||
factory ValueDay.fromJson(Map<String, dynamic> json) => _$ValueDayFromJson(json);
|
||||
|
||||
Map<String, dynamic> toJson() => _$ValueDayToJson(this);
|
||||
|
||||
@override
|
||||
String toString() {
|
||||
return toJson().toString();
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -0,0 +1,251 @@
|
||||
// GENERATED CODE - DO NOT MODIFY BY HAND
|
||||
|
||||
part of 'value_day.dart';
|
||||
|
||||
// **************************************************************************
|
||||
// CopyWithGenerator
|
||||
// **************************************************************************
|
||||
|
||||
abstract class _$ValueDayCWProxy {
|
||||
ValueDay accruedInterestRub(String accruedInterestRub);
|
||||
|
||||
ValueDay cashRub(String cashRub);
|
||||
|
||||
ValueDay d(DateTime d);
|
||||
|
||||
ValueDay externalFlowRub(String externalFlowRub);
|
||||
|
||||
ValueDay investedNetRub(String investedNetRub);
|
||||
|
||||
ValueDay marketValueRub(String marketValueRub);
|
||||
|
||||
ValueDay missingFxCount(int missingFxCount);
|
||||
|
||||
ValueDay missingPriceCount(int missingPriceCount);
|
||||
|
||||
ValueDay pnlTotalRub(String? pnlTotalRub);
|
||||
|
||||
ValueDay stalePriceCount(int stalePriceCount);
|
||||
|
||||
ValueDay totalRub(String totalRub);
|
||||
|
||||
/// This function **does support** nullification of nullable fields. All `null` values passed to `non-nullable` fields will be ignored. You can also use `ValueDay(...).copyWith.fieldName(...)` to override fields one at a time with nullification support.
|
||||
///
|
||||
/// Usage
|
||||
/// ```dart
|
||||
/// ValueDay(...).copyWith(id: 12, name: "My name")
|
||||
/// ````
|
||||
ValueDay call({
|
||||
String accruedInterestRub,
|
||||
String cashRub,
|
||||
DateTime d,
|
||||
String externalFlowRub,
|
||||
String investedNetRub,
|
||||
String marketValueRub,
|
||||
int missingFxCount,
|
||||
int missingPriceCount,
|
||||
String? pnlTotalRub,
|
||||
int stalePriceCount,
|
||||
String totalRub,
|
||||
});
|
||||
}
|
||||
|
||||
/// Proxy class for `copyWith` functionality. This is a callable class and can be used as follows: `instanceOfValueDay.copyWith(...)`. Additionally contains functions for specific fields e.g. `instanceOfValueDay.copyWith.fieldName(...)`
|
||||
class _$ValueDayCWProxyImpl implements _$ValueDayCWProxy {
|
||||
const _$ValueDayCWProxyImpl(this._value);
|
||||
|
||||
final ValueDay _value;
|
||||
|
||||
@override
|
||||
ValueDay accruedInterestRub(String accruedInterestRub) =>
|
||||
this(accruedInterestRub: accruedInterestRub);
|
||||
|
||||
@override
|
||||
ValueDay cashRub(String cashRub) => this(cashRub: cashRub);
|
||||
|
||||
@override
|
||||
ValueDay d(DateTime d) => this(d: d);
|
||||
|
||||
@override
|
||||
ValueDay externalFlowRub(String externalFlowRub) =>
|
||||
this(externalFlowRub: externalFlowRub);
|
||||
|
||||
@override
|
||||
ValueDay investedNetRub(String investedNetRub) =>
|
||||
this(investedNetRub: investedNetRub);
|
||||
|
||||
@override
|
||||
ValueDay marketValueRub(String marketValueRub) =>
|
||||
this(marketValueRub: marketValueRub);
|
||||
|
||||
@override
|
||||
ValueDay missingFxCount(int missingFxCount) =>
|
||||
this(missingFxCount: missingFxCount);
|
||||
|
||||
@override
|
||||
ValueDay missingPriceCount(int missingPriceCount) =>
|
||||
this(missingPriceCount: missingPriceCount);
|
||||
|
||||
@override
|
||||
ValueDay pnlTotalRub(String? pnlTotalRub) => this(pnlTotalRub: pnlTotalRub);
|
||||
|
||||
@override
|
||||
ValueDay stalePriceCount(int stalePriceCount) =>
|
||||
this(stalePriceCount: stalePriceCount);
|
||||
|
||||
@override
|
||||
ValueDay totalRub(String totalRub) => this(totalRub: totalRub);
|
||||
|
||||
@override
|
||||
/// This function **does support** nullification of nullable fields. All `null` values passed to `non-nullable` fields will be ignored. You can also use `ValueDay(...).copyWith.fieldName(...)` to override fields one at a time with nullification support.
|
||||
///
|
||||
/// Usage
|
||||
/// ```dart
|
||||
/// ValueDay(...).copyWith(id: 12, name: "My name")
|
||||
/// ````
|
||||
ValueDay call({
|
||||
Object? accruedInterestRub = const $CopyWithPlaceholder(),
|
||||
Object? cashRub = const $CopyWithPlaceholder(),
|
||||
Object? d = const $CopyWithPlaceholder(),
|
||||
Object? externalFlowRub = const $CopyWithPlaceholder(),
|
||||
Object? investedNetRub = const $CopyWithPlaceholder(),
|
||||
Object? marketValueRub = const $CopyWithPlaceholder(),
|
||||
Object? missingFxCount = const $CopyWithPlaceholder(),
|
||||
Object? missingPriceCount = const $CopyWithPlaceholder(),
|
||||
Object? pnlTotalRub = const $CopyWithPlaceholder(),
|
||||
Object? stalePriceCount = const $CopyWithPlaceholder(),
|
||||
Object? totalRub = const $CopyWithPlaceholder(),
|
||||
}) {
|
||||
return ValueDay(
|
||||
accruedInterestRub: accruedInterestRub == const $CopyWithPlaceholder()
|
||||
? _value.accruedInterestRub
|
||||
// ignore: cast_nullable_to_non_nullable
|
||||
: accruedInterestRub as String,
|
||||
cashRub: cashRub == const $CopyWithPlaceholder()
|
||||
? _value.cashRub
|
||||
// ignore: cast_nullable_to_non_nullable
|
||||
: cashRub as String,
|
||||
d: d == const $CopyWithPlaceholder()
|
||||
? _value.d
|
||||
// ignore: cast_nullable_to_non_nullable
|
||||
: d as DateTime,
|
||||
externalFlowRub: externalFlowRub == const $CopyWithPlaceholder()
|
||||
? _value.externalFlowRub
|
||||
// ignore: cast_nullable_to_non_nullable
|
||||
: externalFlowRub as String,
|
||||
investedNetRub: investedNetRub == const $CopyWithPlaceholder()
|
||||
? _value.investedNetRub
|
||||
// ignore: cast_nullable_to_non_nullable
|
||||
: investedNetRub as String,
|
||||
marketValueRub: marketValueRub == const $CopyWithPlaceholder()
|
||||
? _value.marketValueRub
|
||||
// ignore: cast_nullable_to_non_nullable
|
||||
: marketValueRub as String,
|
||||
missingFxCount: missingFxCount == const $CopyWithPlaceholder()
|
||||
? _value.missingFxCount
|
||||
// ignore: cast_nullable_to_non_nullable
|
||||
: missingFxCount as int,
|
||||
missingPriceCount: missingPriceCount == const $CopyWithPlaceholder()
|
||||
? _value.missingPriceCount
|
||||
// ignore: cast_nullable_to_non_nullable
|
||||
: missingPriceCount as int,
|
||||
pnlTotalRub: pnlTotalRub == const $CopyWithPlaceholder()
|
||||
? _value.pnlTotalRub
|
||||
// ignore: cast_nullable_to_non_nullable
|
||||
: pnlTotalRub as String?,
|
||||
stalePriceCount: stalePriceCount == const $CopyWithPlaceholder()
|
||||
? _value.stalePriceCount
|
||||
// ignore: cast_nullable_to_non_nullable
|
||||
: stalePriceCount as int,
|
||||
totalRub: totalRub == const $CopyWithPlaceholder()
|
||||
? _value.totalRub
|
||||
// ignore: cast_nullable_to_non_nullable
|
||||
: totalRub as String,
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
extension $ValueDayCopyWith on ValueDay {
|
||||
/// Returns a callable class that can be used as follows: `instanceOfValueDay.copyWith(...)` or like so:`instanceOfValueDay.copyWith.fieldName(...)`.
|
||||
// ignore: library_private_types_in_public_api
|
||||
_$ValueDayCWProxy get copyWith => _$ValueDayCWProxyImpl(this);
|
||||
}
|
||||
|
||||
// **************************************************************************
|
||||
// JsonSerializableGenerator
|
||||
// **************************************************************************
|
||||
|
||||
ValueDay _$ValueDayFromJson(Map<String, dynamic> json) => $checkedCreate(
|
||||
'ValueDay',
|
||||
json,
|
||||
($checkedConvert) {
|
||||
$checkKeys(
|
||||
json,
|
||||
requiredKeys: const [
|
||||
'accrued_interest_rub',
|
||||
'cash_rub',
|
||||
'd',
|
||||
'external_flow_rub',
|
||||
'invested_net_rub',
|
||||
'market_value_rub',
|
||||
'missing_fx_count',
|
||||
'missing_price_count',
|
||||
'pnl_total_rub',
|
||||
'stale_price_count',
|
||||
'total_rub',
|
||||
],
|
||||
);
|
||||
final val = ValueDay(
|
||||
accruedInterestRub: $checkedConvert(
|
||||
'accrued_interest_rub',
|
||||
(v) => v as String,
|
||||
),
|
||||
cashRub: $checkedConvert('cash_rub', (v) => v as String),
|
||||
d: $checkedConvert('d', (v) => DateTime.parse(v as String)),
|
||||
externalFlowRub: $checkedConvert('external_flow_rub', (v) => v as String),
|
||||
investedNetRub: $checkedConvert('invested_net_rub', (v) => v as String),
|
||||
marketValueRub: $checkedConvert('market_value_rub', (v) => v as String),
|
||||
missingFxCount: $checkedConvert(
|
||||
'missing_fx_count',
|
||||
(v) => (v as num).toInt(),
|
||||
),
|
||||
missingPriceCount: $checkedConvert(
|
||||
'missing_price_count',
|
||||
(v) => (v as num).toInt(),
|
||||
),
|
||||
pnlTotalRub: $checkedConvert('pnl_total_rub', (v) => v as String?),
|
||||
stalePriceCount: $checkedConvert(
|
||||
'stale_price_count',
|
||||
(v) => (v as num).toInt(),
|
||||
),
|
||||
totalRub: $checkedConvert('total_rub', (v) => v as String),
|
||||
);
|
||||
return val;
|
||||
},
|
||||
fieldKeyMap: const {
|
||||
'accruedInterestRub': 'accrued_interest_rub',
|
||||
'cashRub': 'cash_rub',
|
||||
'externalFlowRub': 'external_flow_rub',
|
||||
'investedNetRub': 'invested_net_rub',
|
||||
'marketValueRub': 'market_value_rub',
|
||||
'missingFxCount': 'missing_fx_count',
|
||||
'missingPriceCount': 'missing_price_count',
|
||||
'pnlTotalRub': 'pnl_total_rub',
|
||||
'stalePriceCount': 'stale_price_count',
|
||||
'totalRub': 'total_rub',
|
||||
},
|
||||
);
|
||||
|
||||
Map<String, dynamic> _$ValueDayToJson(ValueDay instance) => <String, dynamic>{
|
||||
'accrued_interest_rub': instance.accruedInterestRub,
|
||||
'cash_rub': instance.cashRub,
|
||||
'd': instance.d.toIso8601String(),
|
||||
'external_flow_rub': instance.externalFlowRub,
|
||||
'invested_net_rub': instance.investedNetRub,
|
||||
'market_value_rub': instance.marketValueRub,
|
||||
'missing_fx_count': instance.missingFxCount,
|
||||
'missing_price_count': instance.missingPriceCount,
|
||||
'pnl_total_rub': instance.pnlTotalRub,
|
||||
'stale_price_count': instance.stalePriceCount,
|
||||
'total_rub': instance.totalRub,
|
||||
};
|
||||
Reference in New Issue
Block a user