chore(app): перегенерировать Dart-клиент

Портфели, создание счетов, ручные события, PATCH инструмента, ScopeCardOut, MetricsStatusOut, логотипы в HoldingOut.
This commit is contained in:
Dmitry
2026-09-19 22:14:07 +03:00
parent f1f336f94f
commit bfe74ca47c
73 changed files with 4615 additions and 22 deletions
@@ -24,6 +24,7 @@ export 'package:fintracker_api/src/api/instruments_api.dart';
export 'package:fintracker_api/src/api/links_api.dart';
export 'package:fintracker_api/src/api/metrics_api.dart';
export 'package:fintracker_api/src/api/networth_api.dart';
export 'package:fintracker_api/src/api/portfolios_api.dart';
export 'package:fintracker_api/src/api/rebalance_api.dart';
export 'package:fintracker_api/src/api/rules_api.dart';
export 'package:fintracker_api/src/api/sync_api.dart';
@@ -31,6 +32,7 @@ export 'package:fintracker_api/src/api/tax_api.dart';
export 'package:fintracker_api/src/api/transactions_api.dart';
export 'package:fintracker_api/src/model/account_balance.dart';
export 'package:fintracker_api/src/model/account_create.dart';
export 'package:fintracker_api/src/model/account_kind.dart';
export 'package:fintracker_api/src/model/account_out.dart';
export 'package:fintracker_api/src/model/account_patch.dart';
@@ -75,17 +77,24 @@ export 'package:fintracker_api/src/model/import_result.dart';
export 'package:fintracker_api/src/model/import_summary.dart';
export 'package:fintracker_api/src/model/instrument_detail.dart';
export 'package:fintracker_api/src/model/instrument_out.dart';
export 'package:fintracker_api/src/model/instrument_patch.dart';
export 'package:fintracker_api/src/model/job_status.dart';
export 'package:fintracker_api/src/model/link_create.dart';
export 'package:fintracker_api/src/model/link_out.dart';
export 'package:fintracker_api/src/model/login_request.dart';
export 'package:fintracker_api/src/model/lot_out.dart';
export 'package:fintracker_api/src/model/manual_event_create.dart';
export 'package:fintracker_api/src/model/metrics_status_out.dart';
export 'package:fintracker_api/src/model/net_worth_breakdown.dart';
export 'package:fintracker_api/src/model/net_worth_day.dart';
export 'package:fintracker_api/src/model/new_instrument.dart';
export 'package:fintracker_api/src/model/pending_instrument_out.dart';
export 'package:fintracker_api/src/model/pending_resolve_request.dart';
export 'package:fintracker_api/src/model/pending_resolve_result.dart';
export 'package:fintracker_api/src/model/portfolio_accounts_in.dart';
export 'package:fintracker_api/src/model/portfolio_create.dart';
export 'package:fintracker_api/src/model/portfolio_out.dart';
export 'package:fintracker_api/src/model/portfolio_patch.dart';
export 'package:fintracker_api/src/model/price_manual_in.dart';
export 'package:fintracker_api/src/model/price_manual_out.dart';
export 'package:fintracker_api/src/model/price_point.dart';
@@ -106,6 +115,7 @@ export 'package:fintracker_api/src/model/rule_patch.dart';
export 'package:fintracker_api/src/model/run_status.dart';
export 'package:fintracker_api/src/model/runway_out.dart';
export 'package:fintracker_api/src/model/sample_event_out.dart';
export 'package:fintracker_api/src/model/scope_card_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';
+7
View File
@@ -22,6 +22,7 @@ import 'package:fintracker_api/src/api/instruments_api.dart';
import 'package:fintracker_api/src/api/links_api.dart';
import 'package:fintracker_api/src/api/metrics_api.dart';
import 'package:fintracker_api/src/api/networth_api.dart';
import 'package:fintracker_api/src/api/portfolios_api.dart';
import 'package:fintracker_api/src/api/rebalance_api.dart';
import 'package:fintracker_api/src/api/rules_api.dart';
import 'package:fintracker_api/src/api/sync_api.dart';
@@ -209,6 +210,12 @@ class FintrackerApi {
return NetworthApi(dio);
}
/// Get PortfoliosApi instance, base route and serializer can be overridden by a given but be careful,
/// by doing that all interceptors will not be executed
PortfoliosApi getPortfoliosApi() {
return PortfoliosApi(dio);
}
/// Get RebalanceApi instance, base route and serializer can be overridden by a given but be careful,
/// by doing that all interceptors will not be executed
RebalanceApi getRebalanceApi() {
@@ -9,6 +9,7 @@ import 'dart:convert';
import 'package:fintracker_api/src/deserialize.dart';
import 'package:dio/dio.dart';
import 'package:fintracker_api/src/model/account_create.dart';
import 'package:fintracker_api/src/model/account_out.dart';
import 'package:fintracker_api/src/model/account_patch.dart';
import 'package:fintracker_api/src/model/problem.dart';
@@ -19,6 +20,103 @@ class AccountsApi {
const AccountsApi(this._dio);
/// Create
/// Create the broker account a report import will write into. `source_id` is the agreement number the report prints: it is how the import finds the account on its own the next time.
///
/// Parameters:
/// * [accountCreate]
/// * [cancelToken] - A [CancelToken] that can be used to cancel the operation
/// * [headers] - Can be used to add additional headers to the request
/// * [extras] - Can be used to add flags to the request
/// * [validateStatus] - A [ValidateStatus] callback that can be used to determine request success based on the HTTP status of the response
/// * [onSendProgress] - A [ProgressCallback] that can be used to get the send progress
/// * [onReceiveProgress] - A [ProgressCallback] that can be used to get the receive progress
///
/// Returns a [Future] containing a [Response] with a [AccountOut] as data
/// Throws [DioException] if API call or serialization fails
Future<Response<AccountOut>> accountsCreate({
required AccountCreate accountCreate,
CancelToken? cancelToken,
Map<String, dynamic>? headers,
Map<String, dynamic>? extra,
ValidateStatus? validateStatus,
ProgressCallback? onSendProgress,
ProgressCallback? onReceiveProgress,
}) async {
final _path = r'/api/v1/accounts';
final _options = Options(
method: r'POST',
headers: <String, dynamic>{
...?headers,
},
extra: <String, dynamic>{
'secure': <Map<String, String>>[
{
'type': 'http',
'scheme': 'bearer',
'name': 'HTTPBearer',
},
],
...?extra,
},
contentType: 'application/json',
validateStatus: validateStatus,
);
dynamic _bodyData;
try {
_bodyData = jsonEncode(accountCreate);
} catch(error, stackTrace) {
throw DioException(
requestOptions: _options.compose(
_dio.options,
_path,
),
type: DioExceptionType.unknown,
error: error,
stackTrace: stackTrace,
);
}
final _response = await _dio.request<Object>(
_path,
data: _bodyData,
options: _options,
cancelToken: cancelToken,
onSendProgress: onSendProgress,
onReceiveProgress: onReceiveProgress,
);
AccountOut? _responseData;
try {
final rawData = _response.data;
_responseData = rawData == null ? null : deserialize<AccountOut, AccountOut>(rawData, 'AccountOut', growable: true);
} catch (error, stackTrace) {
throw DioException(
requestOptions: _response.requestOptions,
response: _response,
type: DioExceptionType.unknown,
error: error,
stackTrace: stackTrace,
);
}
return Response<AccountOut>(
data: _responseData,
headers: _response.headers,
isRedirect: _response.isRedirect,
requestOptions: _response.requestOptions,
redirects: _response.redirects,
statusCode: _response.statusCode,
statusMessage: _response.statusMessage,
extra: _response.extra,
);
}
/// List
/// Every account, archived ones included — the client decides what to show.
///
@@ -15,6 +15,7 @@ import 'package:fintracker_api/src/model/cash_flow_broker_month.dart';
import 'package:fintracker_api/src/model/holding_out.dart';
import 'package:fintracker_api/src/model/problem.dart';
import 'package:fintracker_api/src/model/returns_out.dart';
import 'package:fintracker_api/src/model/scope_card_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';
@@ -277,6 +278,82 @@ _responseData = rawData == null ? null : deserialize<List<HoldingOut>, HoldingOu
);
}
/// Overview
/// One card per scope for the home screen, in a single round trip. &#x60;all&#x60; first, then the portfolios, then the accounts by value. A scope holding nothing at all is left out: a card of zeros is noise, not an answer.
///
/// 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<ScopeCardOut>] as data
/// Throws [DioException] if API call or serialization fails
Future<Response<List<ScopeCardOut>>> analyticsOverview({
CancelToken? cancelToken,
Map<String, dynamic>? headers,
Map<String, dynamic>? extra,
ValidateStatus? validateStatus,
ProgressCallback? onSendProgress,
ProgressCallback? onReceiveProgress,
}) async {
final _path = r'/api/v1/analytics/overview';
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<ScopeCardOut>? _responseData;
try {
final rawData = _response.data;
_responseData = rawData == null ? null : deserialize<List<ScopeCardOut>, ScopeCardOut>(rawData, 'List<ScopeCardOut>', growable: true);
} catch (error, stackTrace) {
throw DioException(
requestOptions: _response.requestOptions,
response: _response,
type: DioExceptionType.unknown,
error: error,
stackTrace: stackTrace,
);
}
return Response<List<ScopeCardOut>>(
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.
///
@@ -10,8 +10,10 @@ 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_out.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/manual_event_create.dart';
import 'package:fintracker_api/src/model/problem.dart';
class EventsApi {
@@ -20,6 +22,156 @@ class EventsApi {
const EventsApi(this._dio);
/// Create
/// Enter an event by hand. It is &#x60;confirmed&#x60; at once: it is the user&#39;s own statement, so it is never shadowed by the account&#39;s primary feed.
///
/// Parameters:
/// * [manualEventCreate]
/// * [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 [EventOut] as data
/// Throws [DioException] if API call or serialization fails
Future<Response<EventOut>> eventsCreate({
required ManualEventCreate manualEventCreate,
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'POST',
headers: <String, dynamic>{
...?headers,
},
extra: <String, dynamic>{
'secure': <Map<String, String>>[
{
'type': 'http',
'scheme': 'bearer',
'name': 'HTTPBearer',
},
],
...?extra,
},
contentType: 'application/json',
validateStatus: validateStatus,
);
dynamic _bodyData;
try {
_bodyData = jsonEncode(manualEventCreate);
} catch(error, stackTrace) {
throw DioException(
requestOptions: _options.compose(
_dio.options,
_path,
),
type: DioExceptionType.unknown,
error: error,
stackTrace: stackTrace,
);
}
final _response = await _dio.request<Object>(
_path,
data: _bodyData,
options: _options,
cancelToken: cancelToken,
onSendProgress: onSendProgress,
onReceiveProgress: onReceiveProgress,
);
EventOut? _responseData;
try {
final rawData = _response.data;
_responseData = rawData == null ? null : deserialize<EventOut, EventOut>(rawData, 'EventOut', growable: true);
} catch (error, stackTrace) {
throw DioException(
requestOptions: _response.requestOptions,
response: _response,
type: DioExceptionType.unknown,
error: error,
stackTrace: stackTrace,
);
}
return Response<EventOut>(
data: _responseData,
headers: _response.headers,
isRedirect: _response.isRedirect,
requestOptions: _response.requestOptions,
redirects: _response.redirects,
statusCode: _response.statusCode,
statusMessage: _response.statusMessage,
extra: _response.extra,
);
}
/// Delete
/// Delete an event that was entered by hand. Broker events are evidence, not ours to erase: the next sync or import would bring them straight back.
///
/// Parameters:
/// * [eventId]
/// * [cancelToken] - A [CancelToken] that can be used to cancel the operation
/// * [headers] - Can be used to add additional headers to the request
/// * [extras] - Can be used to add flags to the request
/// * [validateStatus] - A [ValidateStatus] callback that can be used to determine request success based on the HTTP status of the response
/// * [onSendProgress] - A [ProgressCallback] that can be used to get the send progress
/// * [onReceiveProgress] - A [ProgressCallback] that can be used to get the receive progress
///
/// Returns a [Future]
/// Throws [DioException] if API call or serialization fails
Future<Response<void>> eventsDelete({
required int eventId,
CancelToken? cancelToken,
Map<String, dynamic>? headers,
Map<String, dynamic>? extra,
ValidateStatus? validateStatus,
ProgressCallback? onSendProgress,
ProgressCallback? onReceiveProgress,
}) async {
final _path = r'/api/v1/events/{event_id}'.replaceAll('{' r'event_id' '}', eventId.toString());
final _options = Options(
method: r'DELETE',
headers: <String, dynamic>{
...?headers,
},
extra: <String, dynamic>{
'secure': <Map<String, String>>[
{
'type': 'http',
'scheme': 'bearer',
'name': 'HTTPBearer',
},
],
...?extra,
},
validateStatus: validateStatus,
);
final _response = await _dio.request<Object>(
_path,
options: _options,
cancelToken: cancelToken,
onSendProgress: onSendProgress,
onReceiveProgress: onReceiveProgress,
);
return _response;
}
/// List
/// One page of ledger events, newest first, with RUB amounts at each own date&#39;s rate.
///
@@ -19,7 +19,7 @@ class HealthApi {
const HealthApi(this._dio);
/// Check
///
/// 503 when the database cannot be reached, so a container healthcheck can trust the code.
///
/// Parameters:
/// * [cancelToken] - A [CancelToken] that can be used to cancel the operation
@@ -11,6 +11,7 @@ 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/instrument_patch.dart';
import 'package:fintracker_api/src/model/pending_instrument_out.dart';
import 'package:fintracker_api/src/model/pending_resolve_request.dart';
import 'package:fintracker_api/src/model/pending_resolve_result.dart';
@@ -204,6 +205,105 @@ _responseData = rawData == null ? null : deserialize<List<InstrumentOut>, Instru
);
}
/// Patch
/// Correct an instrument by hand: name, board, lot, asset class, sector. The lot only rounds the quantities the rebalancing suggests; the asset class decides the bucket it lands in. Neither is refreshed here — call &#x60;POST /metrics/refresh&#x60; after, same as &#x60;/rules/apply&#x60;.
///
/// Parameters:
/// * [instrumentId]
/// * [instrumentPatch]
/// * [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 [InstrumentOut] as data
/// Throws [DioException] if API call or serialization fails
Future<Response<InstrumentOut>> instrumentsPatch({
required int instrumentId,
required InstrumentPatch instrumentPatch,
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'PATCH',
headers: <String, dynamic>{
...?headers,
},
extra: <String, dynamic>{
'secure': <Map<String, String>>[
{
'type': 'http',
'scheme': 'bearer',
'name': 'HTTPBearer',
},
],
...?extra,
},
contentType: 'application/json',
validateStatus: validateStatus,
);
dynamic _bodyData;
try {
_bodyData = jsonEncode(instrumentPatch);
} catch(error, stackTrace) {
throw DioException(
requestOptions: _options.compose(
_dio.options,
_path,
),
type: DioExceptionType.unknown,
error: error,
stackTrace: stackTrace,
);
}
final _response = await _dio.request<Object>(
_path,
data: _bodyData,
options: _options,
cancelToken: cancelToken,
onSendProgress: onSendProgress,
onReceiveProgress: onReceiveProgress,
);
InstrumentOut? _responseData;
try {
final rawData = _response.data;
_responseData = rawData == null ? null : deserialize<InstrumentOut, InstrumentOut>(rawData, 'InstrumentOut', growable: true);
} catch (error, stackTrace) {
throw DioException(
requestOptions: _response.requestOptions,
response: _response,
type: DioExceptionType.unknown,
error: error,
stackTrace: stackTrace,
);
}
return Response<InstrumentOut>(
data: _responseData,
headers: _response.headers,
isRedirect: _response.isRedirect,
requestOptions: _response.requestOptions,
redirects: _response.redirects,
statusCode: _response.statusCode,
statusMessage: _response.statusMessage,
extra: _response.extra,
);
}
/// Pending
/// Instruments a report named that nothing in the master resolves to.
///
@@ -10,8 +10,9 @@ import 'package:fintracker_api/src/deserialize.dart';
import 'package:dio/dio.dart';
import 'package:fintracker_api/src/model/data_quality_row.dart';
import 'package:fintracker_api/src/model/metrics_status_out.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/sync_job_out.dart';
class MetricsApi {
@@ -96,7 +97,7 @@ _responseData = rawData == null ? null : deserialize<List<DataQualityRow>, DataQ
}
/// Refresh
/// Rebuild every metric_* table inline (seconds at personal volumes).
/// Queue a rebuild of every metric_* table; the worker runs it. Poll &#x60;/metrics/status&#x60; until &#x60;refreshing&#x60; is false. A request while one is already waiting shares it. One that arrives while a rebuild is RUNNING queues another, because the running one may have read the data before the change that prompted this call.
///
/// Parameters:
/// * [cancelToken] - A [CancelToken] that can be used to cancel the operation
@@ -106,9 +107,9 @@ _responseData = rawData == null ? null : deserialize<List<DataQualityRow>, DataQ
/// * [onSendProgress] - A [ProgressCallback] that can be used to get the send progress
/// * [onReceiveProgress] - A [ProgressCallback] that can be used to get the receive progress
///
/// Returns a [Future] containing a [Response] with a [RefreshLogOut] as data
/// Returns a [Future] containing a [Response] with a [SyncJobOut] as data
/// Throws [DioException] if API call or serialization fails
Future<Response<RefreshLogOut>> metricsRefresh({
Future<Response<SyncJobOut>> metricsRefresh({
CancelToken? cancelToken,
Map<String, dynamic>? headers,
Map<String, dynamic>? extra,
@@ -143,11 +144,11 @@ _responseData = rawData == null ? null : deserialize<List<DataQualityRow>, DataQ
onReceiveProgress: onReceiveProgress,
);
RefreshLogOut? _responseData;
SyncJobOut? _responseData;
try {
final rawData = _response.data;
_responseData = rawData == null ? null : deserialize<RefreshLogOut, RefreshLogOut>(rawData, 'RefreshLogOut', growable: true);
_responseData = rawData == null ? null : deserialize<SyncJobOut, SyncJobOut>(rawData, 'SyncJobOut', growable: true);
} catch (error, stackTrace) {
throw DioException(
@@ -159,7 +160,7 @@ _responseData = rawData == null ? null : deserialize<RefreshLogOut, RefreshLogOu
);
}
return Response<RefreshLogOut>(
return Response<SyncJobOut>(
data: _responseData,
headers: _response.headers,
isRedirect: _response.isRedirect,
@@ -172,7 +173,7 @@ _responseData = rawData == null ? null : deserialize<RefreshLogOut, RefreshLogOu
}
/// Status
/// When the metric tables were last rebuilt, and whether it failed.
/// When the metric tables were last rebuilt, whether they are one consistent snapshot, and whether another rebuild is on its way.
///
/// Parameters:
/// * [cancelToken] - A [CancelToken] that can be used to cancel the operation
@@ -182,9 +183,9 @@ _responseData = rawData == null ? null : deserialize<RefreshLogOut, RefreshLogOu
/// * [onSendProgress] - A [ProgressCallback] that can be used to get the send progress
/// * [onReceiveProgress] - A [ProgressCallback] that can be used to get the receive progress
///
/// Returns a [Future] containing a [Response] with a [RefreshLogOut] as data
/// Returns a [Future] containing a [Response] with a [MetricsStatusOut] as data
/// Throws [DioException] if API call or serialization fails
Future<Response<RefreshLogOut>> metricsStatus({
Future<Response<MetricsStatusOut>> metricsStatus({
CancelToken? cancelToken,
Map<String, dynamic>? headers,
Map<String, dynamic>? extra,
@@ -219,11 +220,11 @@ _responseData = rawData == null ? null : deserialize<RefreshLogOut, RefreshLogOu
onReceiveProgress: onReceiveProgress,
);
RefreshLogOut? _responseData;
MetricsStatusOut? _responseData;
try {
final rawData = _response.data;
_responseData = rawData == null ? null : deserialize<RefreshLogOut, RefreshLogOut>(rawData, 'RefreshLogOut', growable: true);
_responseData = rawData == null ? null : deserialize<MetricsStatusOut, MetricsStatusOut>(rawData, 'MetricsStatusOut', growable: true);
} catch (error, stackTrace) {
throw DioException(
@@ -235,7 +236,7 @@ _responseData = rawData == null ? null : deserialize<RefreshLogOut, RefreshLogOu
);
}
return Response<RefreshLogOut>(
return Response<MetricsStatusOut>(
data: _responseData,
headers: _response.headers,
isRedirect: _response.isRedirect,
@@ -0,0 +1,448 @@
//
// AUTO-GENERATED FILE, DO NOT MODIFY!
//
import 'dart:async';
// ignore: unused_import
import 'dart:convert';
import 'package:fintracker_api/src/deserialize.dart';
import 'package:dio/dio.dart';
import 'package:fintracker_api/src/model/portfolio_accounts_in.dart';
import 'package:fintracker_api/src/model/portfolio_create.dart';
import 'package:fintracker_api/src/model/portfolio_out.dart';
import 'package:fintracker_api/src/model/portfolio_patch.dart';
import 'package:fintracker_api/src/model/problem.dart';
class PortfoliosApi {
final Dio _dio;
const PortfoliosApi(this._dio);
/// Create
///
///
/// Parameters:
/// * [portfolioCreate]
/// * [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 [PortfolioOut] as data
/// Throws [DioException] if API call or serialization fails
Future<Response<PortfolioOut>> portfoliosCreate({
required PortfolioCreate portfolioCreate,
CancelToken? cancelToken,
Map<String, dynamic>? headers,
Map<String, dynamic>? extra,
ValidateStatus? validateStatus,
ProgressCallback? onSendProgress,
ProgressCallback? onReceiveProgress,
}) async {
final _path = r'/api/v1/portfolios';
final _options = Options(
method: r'POST',
headers: <String, dynamic>{
...?headers,
},
extra: <String, dynamic>{
'secure': <Map<String, String>>[
{
'type': 'http',
'scheme': 'bearer',
'name': 'HTTPBearer',
},
],
...?extra,
},
contentType: 'application/json',
validateStatus: validateStatus,
);
dynamic _bodyData;
try {
_bodyData = jsonEncode(portfolioCreate);
} catch(error, stackTrace) {
throw DioException(
requestOptions: _options.compose(
_dio.options,
_path,
),
type: DioExceptionType.unknown,
error: error,
stackTrace: stackTrace,
);
}
final _response = await _dio.request<Object>(
_path,
data: _bodyData,
options: _options,
cancelToken: cancelToken,
onSendProgress: onSendProgress,
onReceiveProgress: onReceiveProgress,
);
PortfolioOut? _responseData;
try {
final rawData = _response.data;
_responseData = rawData == null ? null : deserialize<PortfolioOut, PortfolioOut>(rawData, 'PortfolioOut', growable: true);
} catch (error, stackTrace) {
throw DioException(
requestOptions: _response.requestOptions,
response: _response,
type: DioExceptionType.unknown,
error: error,
stackTrace: stackTrace,
);
}
return Response<PortfolioOut>(
data: _responseData,
headers: _response.headers,
isRedirect: _response.isRedirect,
requestOptions: _response.requestOptions,
redirects: _response.redirects,
statusCode: _response.statusCode,
statusMessage: _response.statusMessage,
extra: _response.extra,
);
}
/// Delete
///
///
/// Parameters:
/// * [portfolioId]
/// * [cancelToken] - A [CancelToken] that can be used to cancel the operation
/// * [headers] - Can be used to add additional headers to the request
/// * [extras] - Can be used to add flags to the request
/// * [validateStatus] - A [ValidateStatus] callback that can be used to determine request success based on the HTTP status of the response
/// * [onSendProgress] - A [ProgressCallback] that can be used to get the send progress
/// * [onReceiveProgress] - A [ProgressCallback] that can be used to get the receive progress
///
/// Returns a [Future]
/// Throws [DioException] if API call or serialization fails
Future<Response<void>> portfoliosDelete({
required int portfolioId,
CancelToken? cancelToken,
Map<String, dynamic>? headers,
Map<String, dynamic>? extra,
ValidateStatus? validateStatus,
ProgressCallback? onSendProgress,
ProgressCallback? onReceiveProgress,
}) async {
final _path = r'/api/v1/portfolios/{portfolio_id}'.replaceAll('{' r'portfolio_id' '}', portfolioId.toString());
final _options = Options(
method: r'DELETE',
headers: <String, dynamic>{
...?headers,
},
extra: <String, dynamic>{
'secure': <Map<String, String>>[
{
'type': 'http',
'scheme': 'bearer',
'name': 'HTTPBearer',
},
],
...?extra,
},
validateStatus: validateStatus,
);
final _response = await _dio.request<Object>(
_path,
options: _options,
cancelToken: cancelToken,
onSendProgress: onSendProgress,
onReceiveProgress: onReceiveProgress,
);
return _response;
}
/// List
///
///
/// Parameters:
/// * [cancelToken] - A [CancelToken] that can be used to cancel the operation
/// * [headers] - Can be used to add additional headers to the request
/// * [extras] - Can be used to add flags to the request
/// * [validateStatus] - A [ValidateStatus] callback that can be used to determine request success based on the HTTP status of the response
/// * [onSendProgress] - A [ProgressCallback] that can be used to get the send progress
/// * [onReceiveProgress] - A [ProgressCallback] that can be used to get the receive progress
///
/// Returns a [Future] containing a [Response] with a [List<PortfolioOut>] as data
/// Throws [DioException] if API call or serialization fails
Future<Response<List<PortfolioOut>>> portfoliosList({
CancelToken? cancelToken,
Map<String, dynamic>? headers,
Map<String, dynamic>? extra,
ValidateStatus? validateStatus,
ProgressCallback? onSendProgress,
ProgressCallback? onReceiveProgress,
}) async {
final _path = r'/api/v1/portfolios';
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<PortfolioOut>? _responseData;
try {
final rawData = _response.data;
_responseData = rawData == null ? null : deserialize<List<PortfolioOut>, PortfolioOut>(rawData, 'List<PortfolioOut>', growable: true);
} catch (error, stackTrace) {
throw DioException(
requestOptions: _response.requestOptions,
response: _response,
type: DioExceptionType.unknown,
error: error,
stackTrace: stackTrace,
);
}
return Response<List<PortfolioOut>>(
data: _responseData,
headers: _response.headers,
isRedirect: _response.isRedirect,
requestOptions: _response.requestOptions,
redirects: _response.redirects,
statusCode: _response.statusCode,
statusMessage: _response.statusMessage,
extra: _response.extra,
);
}
/// Patch
///
///
/// Parameters:
/// * [portfolioId]
/// * [portfolioPatch]
/// * [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 [PortfolioOut] as data
/// Throws [DioException] if API call or serialization fails
Future<Response<PortfolioOut>> portfoliosPatch({
required int portfolioId,
required PortfolioPatch portfolioPatch,
CancelToken? cancelToken,
Map<String, dynamic>? headers,
Map<String, dynamic>? extra,
ValidateStatus? validateStatus,
ProgressCallback? onSendProgress,
ProgressCallback? onReceiveProgress,
}) async {
final _path = r'/api/v1/portfolios/{portfolio_id}'.replaceAll('{' r'portfolio_id' '}', portfolioId.toString());
final _options = Options(
method: r'PATCH',
headers: <String, dynamic>{
...?headers,
},
extra: <String, dynamic>{
'secure': <Map<String, String>>[
{
'type': 'http',
'scheme': 'bearer',
'name': 'HTTPBearer',
},
],
...?extra,
},
contentType: 'application/json',
validateStatus: validateStatus,
);
dynamic _bodyData;
try {
_bodyData = jsonEncode(portfolioPatch);
} catch(error, stackTrace) {
throw DioException(
requestOptions: _options.compose(
_dio.options,
_path,
),
type: DioExceptionType.unknown,
error: error,
stackTrace: stackTrace,
);
}
final _response = await _dio.request<Object>(
_path,
data: _bodyData,
options: _options,
cancelToken: cancelToken,
onSendProgress: onSendProgress,
onReceiveProgress: onReceiveProgress,
);
PortfolioOut? _responseData;
try {
final rawData = _response.data;
_responseData = rawData == null ? null : deserialize<PortfolioOut, PortfolioOut>(rawData, 'PortfolioOut', growable: true);
} catch (error, stackTrace) {
throw DioException(
requestOptions: _response.requestOptions,
response: _response,
type: DioExceptionType.unknown,
error: error,
stackTrace: stackTrace,
);
}
return Response<PortfolioOut>(
data: _responseData,
headers: _response.headers,
isRedirect: _response.isRedirect,
requestOptions: _response.requestOptions,
redirects: _response.redirects,
statusCode: _response.statusCode,
statusMessage: _response.statusMessage,
extra: _response.extra,
);
}
/// Set Accounts
///
///
/// Parameters:
/// * [portfolioId]
/// * [portfolioAccountsIn]
/// * [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 [PortfolioOut] as data
/// Throws [DioException] if API call or serialization fails
Future<Response<PortfolioOut>> portfoliosSetAccounts({
required int portfolioId,
required PortfolioAccountsIn portfolioAccountsIn,
CancelToken? cancelToken,
Map<String, dynamic>? headers,
Map<String, dynamic>? extra,
ValidateStatus? validateStatus,
ProgressCallback? onSendProgress,
ProgressCallback? onReceiveProgress,
}) async {
final _path = r'/api/v1/portfolios/{portfolio_id}/accounts'.replaceAll('{' r'portfolio_id' '}', portfolioId.toString());
final _options = Options(
method: r'PUT',
headers: <String, dynamic>{
...?headers,
},
extra: <String, dynamic>{
'secure': <Map<String, String>>[
{
'type': 'http',
'scheme': 'bearer',
'name': 'HTTPBearer',
},
],
...?extra,
},
contentType: 'application/json',
validateStatus: validateStatus,
);
dynamic _bodyData;
try {
_bodyData = jsonEncode(portfolioAccountsIn);
} catch(error, stackTrace) {
throw DioException(
requestOptions: _options.compose(
_dio.options,
_path,
),
type: DioExceptionType.unknown,
error: error,
stackTrace: stackTrace,
);
}
final _response = await _dio.request<Object>(
_path,
data: _bodyData,
options: _options,
cancelToken: cancelToken,
onSendProgress: onSendProgress,
onReceiveProgress: onReceiveProgress,
);
PortfolioOut? _responseData;
try {
final rawData = _response.data;
_responseData = rawData == null ? null : deserialize<PortfolioOut, PortfolioOut>(rawData, 'PortfolioOut', growable: true);
} catch (error, stackTrace) {
throw DioException(
requestOptions: _response.requestOptions,
response: _response,
type: DioExceptionType.unknown,
error: error,
stackTrace: stackTrace,
);
}
return Response<PortfolioOut>(
data: _responseData,
headers: _response.headers,
isRedirect: _response.isRedirect,
requestOptions: _response.requestOptions,
redirects: _response.redirects,
statusCode: _response.statusCode,
statusMessage: _response.statusMessage,
extra: _response.extra,
);
}
}
@@ -1,4 +1,5 @@
import 'package:fintracker_api/src/model/account_balance.dart';
import 'package:fintracker_api/src/model/account_create.dart';
import 'package:fintracker_api/src/model/account_out.dart';
import 'package:fintracker_api/src/model/account_patch.dart';
import 'package:fintracker_api/src/model/account_suggestion.dart';
@@ -35,16 +36,23 @@ import 'package:fintracker_api/src/model/import_result.dart';
import 'package:fintracker_api/src/model/import_summary.dart';
import 'package:fintracker_api/src/model/instrument_detail.dart';
import 'package:fintracker_api/src/model/instrument_out.dart';
import 'package:fintracker_api/src/model/instrument_patch.dart';
import 'package:fintracker_api/src/model/link_create.dart';
import 'package:fintracker_api/src/model/link_out.dart';
import 'package:fintracker_api/src/model/login_request.dart';
import 'package:fintracker_api/src/model/lot_out.dart';
import 'package:fintracker_api/src/model/manual_event_create.dart';
import 'package:fintracker_api/src/model/metrics_status_out.dart';
import 'package:fintracker_api/src/model/net_worth_breakdown.dart';
import 'package:fintracker_api/src/model/net_worth_day.dart';
import 'package:fintracker_api/src/model/new_instrument.dart';
import 'package:fintracker_api/src/model/pending_instrument_out.dart';
import 'package:fintracker_api/src/model/pending_resolve_request.dart';
import 'package:fintracker_api/src/model/pending_resolve_result.dart';
import 'package:fintracker_api/src/model/portfolio_accounts_in.dart';
import 'package:fintracker_api/src/model/portfolio_create.dart';
import 'package:fintracker_api/src/model/portfolio_out.dart';
import 'package:fintracker_api/src/model/portfolio_patch.dart';
import 'package:fintracker_api/src/model/price_manual_in.dart';
import 'package:fintracker_api/src/model/price_manual_out.dart';
import 'package:fintracker_api/src/model/price_point.dart';
@@ -62,6 +70,7 @@ import 'package:fintracker_api/src/model/rule_out.dart';
import 'package:fintracker_api/src/model/rule_patch.dart';
import 'package:fintracker_api/src/model/runway_out.dart';
import 'package:fintracker_api/src/model/sample_event_out.dart';
import 'package:fintracker_api/src/model/scope_card_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';
@@ -107,6 +116,8 @@ final _regMap = RegExp(r'^Map<String,(.*)>$');
return (value is double ? value : double.parse('$value')) as ReturnType;
case 'AccountBalance':
return AccountBalance.fromJson(value as Map<String, dynamic>) as ReturnType;
case 'AccountCreate':
return AccountCreate.fromJson(value as Map<String, dynamic>) as ReturnType;
case 'AccountKind':
@@ -203,6 +214,8 @@ final _regMap = RegExp(r'^Map<String,(.*)>$');
return InstrumentDetail.fromJson(value as Map<String, dynamic>) as ReturnType;
case 'InstrumentOut':
return InstrumentOut.fromJson(value as Map<String, dynamic>) as ReturnType;
case 'InstrumentPatch':
return InstrumentPatch.fromJson(value as Map<String, dynamic>) as ReturnType;
case 'JobStatus':
@@ -214,6 +227,10 @@ final _regMap = RegExp(r'^Map<String,(.*)>$');
return LoginRequest.fromJson(value as Map<String, dynamic>) as ReturnType;
case 'LotOut':
return LotOut.fromJson(value as Map<String, dynamic>) as ReturnType;
case 'ManualEventCreate':
return ManualEventCreate.fromJson(value as Map<String, dynamic>) as ReturnType;
case 'MetricsStatusOut':
return MetricsStatusOut.fromJson(value as Map<String, dynamic>) as ReturnType;
case 'NetWorthBreakdown':
return NetWorthBreakdown.fromJson(value as Map<String, dynamic>) as ReturnType;
case 'NetWorthDay':
@@ -226,6 +243,14 @@ final _regMap = RegExp(r'^Map<String,(.*)>$');
return PendingResolveRequest.fromJson(value as Map<String, dynamic>) as ReturnType;
case 'PendingResolveResult':
return PendingResolveResult.fromJson(value as Map<String, dynamic>) as ReturnType;
case 'PortfolioAccountsIn':
return PortfolioAccountsIn.fromJson(value as Map<String, dynamic>) as ReturnType;
case 'PortfolioCreate':
return PortfolioCreate.fromJson(value as Map<String, dynamic>) as ReturnType;
case 'PortfolioOut':
return PortfolioOut.fromJson(value as Map<String, dynamic>) as ReturnType;
case 'PortfolioPatch':
return PortfolioPatch.fromJson(value as Map<String, dynamic>) as ReturnType;
case 'PriceManualIn':
return PriceManualIn.fromJson(value as Map<String, dynamic>) as ReturnType;
case 'PriceManualOut':
@@ -269,6 +294,8 @@ final _regMap = RegExp(r'^Map<String,(.*)>$');
return RunwayOut.fromJson(value as Map<String, dynamic>) as ReturnType;
case 'SampleEventOut':
return SampleEventOut.fromJson(value as Map<String, dynamic>) as ReturnType;
case 'ScopeCardOut':
return ScopeCardOut.fromJson(value as Map<String, dynamic>) as ReturnType;
case 'ScopeOut':
return ScopeOut.fromJson(value as Map<String, dynamic>) as ReturnType;
case 'SourceStatus':
@@ -0,0 +1,109 @@
//
// AUTO-GENERATED FILE, DO NOT MODIFY!
//
// ignore_for_file: unused_element
import 'package:fintracker_api/src/model/broker.dart';
import 'package:copy_with_extension/copy_with_extension.dart';
import 'package:json_annotation/json_annotation.dart';
part 'account_create.g.dart';
@CopyWith()
@JsonSerializable(
checked: true,
createToJson: true,
disallowUnrecognizedKeys: false,
explicitToJson: true,
)
class AccountCreate {
/// Returns a new [AccountCreate] instance.
AccountCreate({
required this.broker,
this.currency = 'RUB',
required this.name,
required this.sourceId,
});
@JsonKey(
name: r'broker',
required: true,
includeIfNull: false,
unknownEnumValue: Broker.unknownDefaultOpenApi,
)
final Broker broker;
@JsonKey(
defaultValue: 'RUB',
name: r'currency',
required: false,
includeIfNull: false,
)
final String? currency;
@JsonKey(
name: r'name',
required: true,
includeIfNull: false,
)
final String name;
/// Agreement number exactly as the broker's report prints it
@JsonKey(
name: r'source_id',
required: true,
includeIfNull: false,
)
final String sourceId;
@override
bool operator ==(Object other) => identical(this, other) || other is AccountCreate &&
other.broker == broker &&
other.currency == currency &&
other.name == name &&
other.sourceId == sourceId;
@override
int get hashCode =>
broker.hashCode +
currency.hashCode +
name.hashCode +
sourceId.hashCode;
factory AccountCreate.fromJson(Map<String, dynamic> json) => _$AccountCreateFromJson(json);
Map<String, dynamic> toJson() => _$AccountCreateToJson(this);
@override
String toString() {
return toJson().toString();
}
}
@@ -0,0 +1,127 @@
// GENERATED CODE - DO NOT MODIFY BY HAND
part of 'account_create.dart';
// **************************************************************************
// CopyWithGenerator
// **************************************************************************
abstract class _$AccountCreateCWProxy {
AccountCreate broker(Broker broker);
AccountCreate currency(String? currency);
AccountCreate name(String name);
AccountCreate sourceId(String sourceId);
/// This function **does support** nullification of nullable fields. All `null` values passed to `non-nullable` fields will be ignored. You can also use `AccountCreate(...).copyWith.fieldName(...)` to override fields one at a time with nullification support.
///
/// Usage
/// ```dart
/// AccountCreate(...).copyWith(id: 12, name: "My name")
/// ````
AccountCreate call({
Broker broker,
String? currency,
String name,
String sourceId,
});
}
/// Proxy class for `copyWith` functionality. This is a callable class and can be used as follows: `instanceOfAccountCreate.copyWith(...)`. Additionally contains functions for specific fields e.g. `instanceOfAccountCreate.copyWith.fieldName(...)`
class _$AccountCreateCWProxyImpl implements _$AccountCreateCWProxy {
const _$AccountCreateCWProxyImpl(this._value);
final AccountCreate _value;
@override
AccountCreate broker(Broker broker) => this(broker: broker);
@override
AccountCreate currency(String? currency) => this(currency: currency);
@override
AccountCreate name(String name) => this(name: name);
@override
AccountCreate sourceId(String sourceId) => this(sourceId: sourceId);
@override
/// This function **does support** nullification of nullable fields. All `null` values passed to `non-nullable` fields will be ignored. You can also use `AccountCreate(...).copyWith.fieldName(...)` to override fields one at a time with nullification support.
///
/// Usage
/// ```dart
/// AccountCreate(...).copyWith(id: 12, name: "My name")
/// ````
AccountCreate call({
Object? broker = const $CopyWithPlaceholder(),
Object? currency = const $CopyWithPlaceholder(),
Object? name = const $CopyWithPlaceholder(),
Object? sourceId = const $CopyWithPlaceholder(),
}) {
return AccountCreate(
broker: broker == const $CopyWithPlaceholder()
? _value.broker
// ignore: cast_nullable_to_non_nullable
: broker as Broker,
currency: currency == const $CopyWithPlaceholder()
? _value.currency
// ignore: cast_nullable_to_non_nullable
: currency as String?,
name: name == const $CopyWithPlaceholder()
? _value.name
// ignore: cast_nullable_to_non_nullable
: name as String,
sourceId: sourceId == const $CopyWithPlaceholder()
? _value.sourceId
// ignore: cast_nullable_to_non_nullable
: sourceId as String,
);
}
}
extension $AccountCreateCopyWith on AccountCreate {
/// Returns a callable class that can be used as follows: `instanceOfAccountCreate.copyWith(...)` or like so:`instanceOfAccountCreate.copyWith.fieldName(...)`.
// ignore: library_private_types_in_public_api
_$AccountCreateCWProxy get copyWith => _$AccountCreateCWProxyImpl(this);
}
// **************************************************************************
// JsonSerializableGenerator
// **************************************************************************
AccountCreate _$AccountCreateFromJson(Map<String, dynamic> json) =>
$checkedCreate('AccountCreate', json, ($checkedConvert) {
$checkKeys(json, requiredKeys: const ['broker', 'name', 'source_id']);
final val = AccountCreate(
broker: $checkedConvert(
'broker',
(v) => $enumDecode(
_$BrokerEnumMap,
v,
unknownValue: Broker.unknownDefaultOpenApi,
),
),
currency: $checkedConvert('currency', (v) => v as String? ?? 'RUB'),
name: $checkedConvert('name', (v) => v as String),
sourceId: $checkedConvert('source_id', (v) => v as String),
);
return val;
}, fieldKeyMap: const {'sourceId': 'source_id'});
Map<String, dynamic> _$AccountCreateToJson(AccountCreate instance) =>
<String, dynamic>{
'broker': _$BrokerEnumMap[instance.broker]!,
'currency': ?instance.currency,
'name': instance.name,
'source_id': instance.sourceId,
};
const _$BrokerEnumMap = {
Broker.tinvest: 'tinvest',
Broker.sber: 'sber',
Broker.vtb: 'vtb',
Broker.other: 'other',
Broker.unknownDefaultOpenApi: 'unknown_default_open_api',
};
@@ -36,6 +36,8 @@ class AccountOut {
required this.currency,
required this.disabled,
required this.id,
required this.includeInNetWorth,
@@ -57,6 +59,8 @@ class AccountOut {
required this.sourceId,
required this.startBalance,
this.valueRub,
});
@JsonKey(
@@ -134,6 +138,18 @@ class AccountOut {
@JsonKey(
name: r'disabled',
required: true,
includeIfNull: false,
)
final bool disabled;
@JsonKey(
name: r'id',
@@ -270,6 +286,19 @@ class AccountOut {
/// decimal as string
@JsonKey(
name: r'value_rub',
required: false,
includeIfNull: false,
)
final String? valueRub;
@override
@@ -280,6 +309,7 @@ class AccountOut {
other.broker == broker &&
other.creditLimit == creditLimit &&
other.currency == currency &&
other.disabled == disabled &&
other.id == id &&
other.includeInNetWorth == includeInNetWorth &&
other.kind == kind &&
@@ -290,7 +320,8 @@ class AccountOut {
other.role == role &&
other.source_ == source_ &&
other.sourceId == sourceId &&
other.startBalance == startBalance;
other.startBalance == startBalance &&
other.valueRub == valueRub;
@override
int get hashCode =>
@@ -300,6 +331,7 @@ class AccountOut {
(broker == null ? 0 : broker.hashCode) +
(creditLimit == null ? 0 : creditLimit.hashCode) +
currency.hashCode +
disabled.hashCode +
id.hashCode +
includeInNetWorth.hashCode +
kind.hashCode +
@@ -310,7 +342,8 @@ class AccountOut {
role.hashCode +
source_.hashCode +
sourceId.hashCode +
(startBalance == null ? 0 : startBalance.hashCode);
(startBalance == null ? 0 : startBalance.hashCode) +
(valueRub == null ? 0 : valueRub.hashCode);
factory AccountOut.fromJson(Map<String, dynamic> json) => _$AccountOutFromJson(json);
@@ -19,6 +19,8 @@ abstract class _$AccountOutCWProxy {
AccountOut currency(String currency);
AccountOut disabled(bool disabled);
AccountOut id(int id);
AccountOut includeInNetWorth(bool includeInNetWorth);
@@ -41,6 +43,8 @@ abstract class _$AccountOutCWProxy {
AccountOut startBalance(String? startBalance);
AccountOut valueRub(String? valueRub);
/// This function **does support** nullification of nullable fields. All `null` values passed to `non-nullable` fields will be ignored. You can also use `AccountOut(...).copyWith.fieldName(...)` to override fields one at a time with nullification support.
///
/// Usage
@@ -54,6 +58,7 @@ abstract class _$AccountOutCWProxy {
Broker? broker,
String? creditLimit,
String currency,
bool disabled,
int id,
bool includeInNetWorth,
AccountKind kind,
@@ -65,6 +70,7 @@ abstract class _$AccountOutCWProxy {
String source_,
String sourceId,
String? startBalance,
String? valueRub,
});
}
@@ -93,6 +99,9 @@ class _$AccountOutCWProxyImpl implements _$AccountOutCWProxy {
@override
AccountOut currency(String currency) => this(currency: currency);
@override
AccountOut disabled(bool disabled) => this(disabled: disabled);
@override
AccountOut id(int id) => this(id: id);
@@ -130,6 +139,9 @@ class _$AccountOutCWProxyImpl implements _$AccountOutCWProxy {
AccountOut startBalance(String? startBalance) =>
this(startBalance: startBalance);
@override
AccountOut valueRub(String? valueRub) => this(valueRub: valueRub);
@override
/// This function **does support** nullification of nullable fields. All `null` values passed to `non-nullable` fields will be ignored. You can also use `AccountOut(...).copyWith.fieldName(...)` to override fields one at a time with nullification support.
///
@@ -144,6 +156,7 @@ class _$AccountOutCWProxyImpl implements _$AccountOutCWProxy {
Object? broker = const $CopyWithPlaceholder(),
Object? creditLimit = const $CopyWithPlaceholder(),
Object? currency = const $CopyWithPlaceholder(),
Object? disabled = const $CopyWithPlaceholder(),
Object? id = const $CopyWithPlaceholder(),
Object? includeInNetWorth = const $CopyWithPlaceholder(),
Object? kind = const $CopyWithPlaceholder(),
@@ -155,6 +168,7 @@ class _$AccountOutCWProxyImpl implements _$AccountOutCWProxy {
Object? source_ = const $CopyWithPlaceholder(),
Object? sourceId = const $CopyWithPlaceholder(),
Object? startBalance = const $CopyWithPlaceholder(),
Object? valueRub = const $CopyWithPlaceholder(),
}) {
return AccountOut(
archived: archived == const $CopyWithPlaceholder()
@@ -181,6 +195,10 @@ class _$AccountOutCWProxyImpl implements _$AccountOutCWProxy {
? _value.currency
// ignore: cast_nullable_to_non_nullable
: currency as String,
disabled: disabled == const $CopyWithPlaceholder()
? _value.disabled
// ignore: cast_nullable_to_non_nullable
: disabled as bool,
id: id == const $CopyWithPlaceholder()
? _value.id
// ignore: cast_nullable_to_non_nullable
@@ -225,6 +243,10 @@ class _$AccountOutCWProxyImpl implements _$AccountOutCWProxy {
? _value.startBalance
// ignore: cast_nullable_to_non_nullable
: startBalance as String?,
valueRub: valueRub == const $CopyWithPlaceholder()
? _value.valueRub
// ignore: cast_nullable_to_non_nullable
: valueRub as String?,
);
}
}
@@ -252,6 +274,7 @@ AccountOut _$AccountOutFromJson(Map<String, dynamic> json) => $checkedCreate(
'broker',
'credit_limit',
'currency',
'disabled',
'id',
'include_in_net_worth',
'kind',
@@ -282,6 +305,7 @@ AccountOut _$AccountOutFromJson(Map<String, dynamic> json) => $checkedCreate(
),
creditLimit: $checkedConvert('credit_limit', (v) => v as String?),
currency: $checkedConvert('currency', (v) => v as String),
disabled: $checkedConvert('disabled', (v) => v as bool),
id: $checkedConvert('id', (v) => (v as num).toInt()),
includeInNetWorth: $checkedConvert(
'include_in_net_worth',
@@ -323,6 +347,7 @@ AccountOut _$AccountOutFromJson(Map<String, dynamic> json) => $checkedCreate(
source_: $checkedConvert('source', (v) => v as String),
sourceId: $checkedConvert('source_id', (v) => v as String),
startBalance: $checkedConvert('start_balance', (v) => v as String?),
valueRub: $checkedConvert('value_rub', (v) => v as String?),
);
return val;
},
@@ -336,6 +361,7 @@ AccountOut _$AccountOutFromJson(Map<String, dynamic> json) => $checkedCreate(
'source_': 'source',
'sourceId': 'source_id',
'startBalance': 'start_balance',
'valueRub': 'value_rub',
},
);
@@ -347,6 +373,7 @@ Map<String, dynamic> _$AccountOutToJson(AccountOut instance) =>
'broker': _$BrokerEnumMap[instance.broker],
'credit_limit': instance.creditLimit,
'currency': instance.currency,
'disabled': instance.disabled,
'id': instance.id,
'include_in_net_worth': instance.includeInNetWorth,
'kind': _$AccountKindEnumMap[instance.kind]!,
@@ -358,6 +385,7 @@ Map<String, dynamic> _$AccountOutToJson(AccountOut instance) =>
'source': instance.source_,
'source_id': instance.sourceId,
'start_balance': instance.startBalance,
'value_rub': ?instance.valueRub,
};
const _$BrokerEnumMap = {
@@ -22,6 +22,8 @@ class AccountPatch {
/// Returns a new [AccountPatch] instance.
AccountPatch({
this.disabled,
this.includeInNetWorth,
this.mirrorOfAccountId,
@@ -33,6 +35,18 @@ class AccountPatch {
this.role,
});
@JsonKey(
name: r'disabled',
required: false,
includeIfNull: false,
)
final bool? disabled;
@JsonKey(
name: r'include_in_net_worth',
@@ -99,6 +113,7 @@ class AccountPatch {
@override
bool operator ==(Object other) => identical(this, other) || other is AccountPatch &&
other.disabled == disabled &&
other.includeInNetWorth == includeInNetWorth &&
other.mirrorOfAccountId == mirrorOfAccountId &&
other.name == name &&
@@ -107,6 +122,7 @@ class AccountPatch {
@override
int get hashCode =>
(disabled == null ? 0 : disabled.hashCode) +
(includeInNetWorth == null ? 0 : includeInNetWorth.hashCode) +
(mirrorOfAccountId == null ? 0 : mirrorOfAccountId.hashCode) +
(name == null ? 0 : name.hashCode) +
@@ -7,6 +7,8 @@ part of 'account_patch.dart';
// **************************************************************************
abstract class _$AccountPatchCWProxy {
AccountPatch disabled(bool? disabled);
AccountPatch includeInNetWorth(bool? includeInNetWorth);
AccountPatch mirrorOfAccountId(int? mirrorOfAccountId);
@@ -24,6 +26,7 @@ abstract class _$AccountPatchCWProxy {
/// AccountPatch(...).copyWith(id: 12, name: "My name")
/// ````
AccountPatch call({
bool? disabled,
bool? includeInNetWorth,
int? mirrorOfAccountId,
String? name,
@@ -38,6 +41,9 @@ class _$AccountPatchCWProxyImpl implements _$AccountPatchCWProxy {
final AccountPatch _value;
@override
AccountPatch disabled(bool? disabled) => this(disabled: disabled);
@override
AccountPatch includeInNetWorth(bool? includeInNetWorth) =>
this(includeInNetWorth: includeInNetWorth);
@@ -64,6 +70,7 @@ class _$AccountPatchCWProxyImpl implements _$AccountPatchCWProxy {
/// AccountPatch(...).copyWith(id: 12, name: "My name")
/// ````
AccountPatch call({
Object? disabled = const $CopyWithPlaceholder(),
Object? includeInNetWorth = const $CopyWithPlaceholder(),
Object? mirrorOfAccountId = const $CopyWithPlaceholder(),
Object? name = const $CopyWithPlaceholder(),
@@ -71,6 +78,10 @@ class _$AccountPatchCWProxyImpl implements _$AccountPatchCWProxy {
Object? role = const $CopyWithPlaceholder(),
}) {
return AccountPatch(
disabled: disabled == const $CopyWithPlaceholder()
? _value.disabled
// ignore: cast_nullable_to_non_nullable
: disabled as bool?,
includeInNetWorth: includeInNetWorth == const $CopyWithPlaceholder()
? _value.includeInNetWorth
// ignore: cast_nullable_to_non_nullable
@@ -111,6 +122,7 @@ AccountPatch _$AccountPatchFromJson(Map<String, dynamic> json) =>
json,
($checkedConvert) {
final val = AccountPatch(
disabled: $checkedConvert('disabled', (v) => v as bool?),
includeInNetWorth: $checkedConvert(
'include_in_net_worth',
(v) => v as bool?,
@@ -149,6 +161,7 @@ AccountPatch _$AccountPatchFromJson(Map<String, dynamic> json) =>
Map<String, dynamic> _$AccountPatchToJson(
AccountPatch instance,
) => <String, dynamic>{
'disabled': ?instance.disabled,
'include_in_net_worth': ?instance.includeInNetWorth,
'mirror_of_account_id': ?instance.mirrorOfAccountId,
'name': ?instance.name,
@@ -50,6 +50,8 @@ class EventOut {
required this.quantity,
required this.source_,
required this.status,
required this.tax,
@@ -236,6 +238,18 @@ class EventOut {
@JsonKey(
name: r'source',
required: true,
includeIfNull: false,
)
final String source_;
@JsonKey(
name: r'status',
@@ -316,6 +330,7 @@ class EventOut {
other.price == price &&
other.priceCurrency == priceCurrency &&
other.quantity == quantity &&
other.source_ == source_ &&
other.status == status &&
other.tax == tax &&
other.ticker == ticker &&
@@ -338,6 +353,7 @@ class EventOut {
(price == null ? 0 : price.hashCode) +
(priceCurrency == null ? 0 : priceCurrency.hashCode) +
(quantity == null ? 0 : quantity.hashCode) +
source_.hashCode +
status.hashCode +
(tax == null ? 0 : tax.hashCode) +
(ticker == null ? 0 : ticker.hashCode) +
@@ -35,6 +35,8 @@ abstract class _$EventOutCWProxy {
EventOut quantity(String? quantity);
EventOut source_(String source_);
EventOut status(EventStatus status);
EventOut tax(String? tax);
@@ -66,6 +68,7 @@ abstract class _$EventOutCWProxy {
String? price,
String? priceCurrency,
String? quantity,
String source_,
EventStatus status,
String? tax,
String? ticker,
@@ -124,6 +127,9 @@ class _$EventOutCWProxyImpl implements _$EventOutCWProxy {
@override
EventOut quantity(String? quantity) => this(quantity: quantity);
@override
EventOut source_(String source_) => this(source_: source_);
@override
EventOut status(EventStatus status) => this(status: status);
@@ -161,6 +167,7 @@ class _$EventOutCWProxyImpl implements _$EventOutCWProxy {
Object? price = const $CopyWithPlaceholder(),
Object? priceCurrency = const $CopyWithPlaceholder(),
Object? quantity = const $CopyWithPlaceholder(),
Object? source_ = const $CopyWithPlaceholder(),
Object? status = const $CopyWithPlaceholder(),
Object? tax = const $CopyWithPlaceholder(),
Object? ticker = const $CopyWithPlaceholder(),
@@ -224,6 +231,10 @@ class _$EventOutCWProxyImpl implements _$EventOutCWProxy {
? _value.quantity
// ignore: cast_nullable_to_non_nullable
: quantity as String?,
source_: source_ == const $CopyWithPlaceholder()
? _value.source_
// ignore: cast_nullable_to_non_nullable
: source_ as String,
status: status == const $CopyWithPlaceholder()
? _value.status
// ignore: cast_nullable_to_non_nullable
@@ -279,6 +290,7 @@ EventOut _$EventOutFromJson(Map<String, dynamic> json) => $checkedCreate(
'price',
'price_currency',
'quantity',
'source',
'status',
'tax',
'ticker',
@@ -311,6 +323,7 @@ EventOut _$EventOutFromJson(Map<String, dynamic> json) => $checkedCreate(
price: $checkedConvert('price', (v) => v as String?),
priceCurrency: $checkedConvert('price_currency', (v) => v as String?),
quantity: $checkedConvert('quantity', (v) => v as String?),
source_: $checkedConvert('source', (v) => v as String),
status: $checkedConvert(
'status',
(v) => $enumDecode(
@@ -336,6 +349,7 @@ EventOut _$EventOutFromJson(Map<String, dynamic> json) => $checkedCreate(
'externalFlow': 'external_flow',
'instrumentId': 'instrument_id',
'priceCurrency': 'price_currency',
'source_': 'source',
'tradeDate': 'trade_date',
},
);
@@ -355,6 +369,7 @@ Map<String, dynamic> _$EventOutToJson(EventOut instance) => <String, dynamic>{
'price': instance.price,
'price_currency': instance.priceCurrency,
'quantity': instance.quantity,
'source': instance.source_,
'status': _$EventStatusEnumMap[instance.status]!,
'tax': instance.tax,
'ticker': instance.ticker,
@@ -44,6 +44,10 @@ class HoldingOut {
required this.ldvEligibleQty,
this.logoColor,
this.logoUrl,
required this.marketPrice,
required this.name,
@@ -222,6 +226,30 @@ class HoldingOut {
@JsonKey(
name: r'logo_color',
required: false,
includeIfNull: false,
)
final String? logoColor;
@JsonKey(
name: r'logo_url',
required: false,
includeIfNull: false,
)
final String? logoUrl;
/// decimal as string
@JsonKey(
@@ -415,6 +443,8 @@ class HoldingOut {
other.incomeRub == incomeRub &&
other.instrumentId == instrumentId &&
other.ldvEligibleQty == ldvEligibleQty &&
other.logoColor == logoColor &&
other.logoUrl == logoUrl &&
other.marketPrice == marketPrice &&
other.name == name &&
other.priceCurrency == priceCurrency &&
@@ -444,6 +474,8 @@ class HoldingOut {
(incomeRub == null ? 0 : incomeRub.hashCode) +
instrumentId.hashCode +
ldvEligibleQty.hashCode +
(logoColor == null ? 0 : logoColor.hashCode) +
(logoUrl == null ? 0 : logoUrl.hashCode) +
(marketPrice == null ? 0 : marketPrice.hashCode) +
name.hashCode +
(priceCurrency == null ? 0 : priceCurrency.hashCode) +
@@ -31,6 +31,10 @@ abstract class _$HoldingOutCWProxy {
HoldingOut ldvEligibleQty(String ldvEligibleQty);
HoldingOut logoColor(String? logoColor);
HoldingOut logoUrl(String? logoUrl);
HoldingOut marketPrice(String? marketPrice);
HoldingOut name(String name);
@@ -78,6 +82,8 @@ abstract class _$HoldingOutCWProxy {
String? incomeRub,
int instrumentId,
String ldvEligibleQty,
String? logoColor,
String? logoUrl,
String? marketPrice,
String name,
String? priceCurrency,
@@ -142,6 +148,12 @@ class _$HoldingOutCWProxyImpl implements _$HoldingOutCWProxy {
HoldingOut ldvEligibleQty(String ldvEligibleQty) =>
this(ldvEligibleQty: ldvEligibleQty);
@override
HoldingOut logoColor(String? logoColor) => this(logoColor: logoColor);
@override
HoldingOut logoUrl(String? logoUrl) => this(logoUrl: logoUrl);
@override
HoldingOut marketPrice(String? marketPrice) => this(marketPrice: marketPrice);
@@ -208,6 +220,8 @@ class _$HoldingOutCWProxyImpl implements _$HoldingOutCWProxy {
Object? incomeRub = const $CopyWithPlaceholder(),
Object? instrumentId = const $CopyWithPlaceholder(),
Object? ldvEligibleQty = const $CopyWithPlaceholder(),
Object? logoColor = const $CopyWithPlaceholder(),
Object? logoUrl = const $CopyWithPlaceholder(),
Object? marketPrice = const $CopyWithPlaceholder(),
Object? name = const $CopyWithPlaceholder(),
Object? priceCurrency = const $CopyWithPlaceholder(),
@@ -272,6 +286,14 @@ class _$HoldingOutCWProxyImpl implements _$HoldingOutCWProxy {
? _value.ldvEligibleQty
// ignore: cast_nullable_to_non_nullable
: ldvEligibleQty as String,
logoColor: logoColor == const $CopyWithPlaceholder()
? _value.logoColor
// ignore: cast_nullable_to_non_nullable
: logoColor as String?,
logoUrl: logoUrl == const $CopyWithPlaceholder()
? _value.logoUrl
// ignore: cast_nullable_to_non_nullable
: logoUrl as String?,
marketPrice: marketPrice == const $CopyWithPlaceholder()
? _value.marketPrice
// ignore: cast_nullable_to_non_nullable
@@ -396,6 +418,8 @@ HoldingOut _$HoldingOutFromJson(Map<String, dynamic> json) => $checkedCreate(
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),
logoColor: $checkedConvert('logo_color', (v) => v as String?),
logoUrl: $checkedConvert('logo_url', (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?),
@@ -433,6 +457,8 @@ HoldingOut _$HoldingOutFromJson(Map<String, dynamic> json) => $checkedCreate(
'incomeRub': 'income_rub',
'instrumentId': 'instrument_id',
'ldvEligibleQty': 'ldv_eligible_qty',
'logoColor': 'logo_color',
'logoUrl': 'logo_url',
'marketPrice': 'market_price',
'priceCurrency': 'price_currency',
'priceDate': 'price_date',
@@ -459,6 +485,8 @@ Map<String, dynamic> _$HoldingOutToJson(HoldingOut instance) =>
'income_rub': instance.incomeRub,
'instrument_id': instance.instrumentId,
'ldv_eligible_qty': instance.ldvEligibleQty,
'logo_color': ?instance.logoColor,
'logo_url': ?instance.logoUrl,
'market_price': instance.marketPrice,
'name': instance.name,
'price_currency': instance.priceCurrency,
@@ -40,6 +40,10 @@ class InstrumentOut {
required this.issuer,
this.logoColor,
this.logoUrl,
required this.lot,
required this.maturityDate,
@@ -175,6 +179,30 @@ class InstrumentOut {
@JsonKey(
name: r'logo_color',
required: false,
includeIfNull: false,
)
final String? logoColor;
@JsonKey(
name: r'logo_url',
required: false,
includeIfNull: false,
)
final String? logoUrl;
@JsonKey(
name: r'lot',
@@ -274,6 +302,8 @@ class InstrumentOut {
other.isActive == isActive &&
other.isin == isin &&
other.issuer == issuer &&
other.logoColor == logoColor &&
other.logoUrl == logoUrl &&
other.lot == lot &&
other.maturityDate == maturityDate &&
other.name == name &&
@@ -294,6 +324,8 @@ class InstrumentOut {
isActive.hashCode +
(isin == null ? 0 : isin.hashCode) +
(issuer == null ? 0 : issuer.hashCode) +
(logoColor == null ? 0 : logoColor.hashCode) +
(logoUrl == null ? 0 : logoUrl.hashCode) +
lot.hashCode +
(maturityDate == null ? 0 : maturityDate.hashCode) +
name.hashCode +
@@ -27,6 +27,10 @@ abstract class _$InstrumentOutCWProxy {
InstrumentOut issuer(String? issuer);
InstrumentOut logoColor(String? logoColor);
InstrumentOut logoUrl(String? logoUrl);
InstrumentOut lot(int lot);
InstrumentOut maturityDate(DateTime? maturityDate);
@@ -58,6 +62,8 @@ abstract class _$InstrumentOutCWProxy {
bool isActive,
String? isin,
String? issuer,
String? logoColor,
String? logoUrl,
int lot,
DateTime? maturityDate,
String name,
@@ -104,6 +110,12 @@ class _$InstrumentOutCWProxyImpl implements _$InstrumentOutCWProxy {
@override
InstrumentOut issuer(String? issuer) => this(issuer: issuer);
@override
InstrumentOut logoColor(String? logoColor) => this(logoColor: logoColor);
@override
InstrumentOut logoUrl(String? logoUrl) => this(logoUrl: logoUrl);
@override
InstrumentOut lot(int lot) => this(lot: lot);
@@ -145,6 +157,8 @@ class _$InstrumentOutCWProxyImpl implements _$InstrumentOutCWProxy {
Object? isActive = const $CopyWithPlaceholder(),
Object? isin = const $CopyWithPlaceholder(),
Object? issuer = const $CopyWithPlaceholder(),
Object? logoColor = const $CopyWithPlaceholder(),
Object? logoUrl = const $CopyWithPlaceholder(),
Object? lot = const $CopyWithPlaceholder(),
Object? maturityDate = const $CopyWithPlaceholder(),
Object? name = const $CopyWithPlaceholder(),
@@ -194,6 +208,14 @@ class _$InstrumentOutCWProxyImpl implements _$InstrumentOutCWProxy {
? _value.issuer
// ignore: cast_nullable_to_non_nullable
: issuer as String?,
logoColor: logoColor == const $CopyWithPlaceholder()
? _value.logoColor
// ignore: cast_nullable_to_non_nullable
: logoColor as String?,
logoUrl: logoUrl == const $CopyWithPlaceholder()
? _value.logoUrl
// ignore: cast_nullable_to_non_nullable
: logoUrl as String?,
lot: lot == const $CopyWithPlaceholder()
? _value.lot
// ignore: cast_nullable_to_non_nullable
@@ -274,6 +296,8 @@ InstrumentOut _$InstrumentOutFromJson(Map<String, dynamic> json) =>
isActive: $checkedConvert('is_active', (v) => v as bool),
isin: $checkedConvert('isin', (v) => v as String?),
issuer: $checkedConvert('issuer', (v) => v as String?),
logoColor: $checkedConvert('logo_color', (v) => v as String?),
logoUrl: $checkedConvert('logo_url', (v) => v as String?),
lot: $checkedConvert('lot', (v) => (v as num).toInt()),
maturityDate: $checkedConvert(
'maturity_date',
@@ -293,6 +317,8 @@ InstrumentOut _$InstrumentOutFromJson(Map<String, dynamic> json) =>
fieldKeyMap: const {
'assetClass': 'asset_class',
'isActive': 'is_active',
'logoColor': 'logo_color',
'logoUrl': 'logo_url',
'maturityDate': 'maturity_date',
'nominalCurrency': 'nominal_currency',
},
@@ -310,6 +336,8 @@ Map<String, dynamic> _$InstrumentOutToJson(InstrumentOut instance) =>
'is_active': instance.isActive,
'isin': instance.isin,
'issuer': instance.issuer,
'logo_color': ?instance.logoColor,
'logo_url': ?instance.logoUrl,
'lot': instance.lot,
'maturity_date': instance.maturityDate?.toIso8601String(),
'name': instance.name,
@@ -0,0 +1,123 @@
//
// 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_patch.g.dart';
@CopyWith()
@JsonSerializable(
checked: true,
createToJson: true,
disallowUnrecognizedKeys: false,
explicitToJson: true,
)
class InstrumentPatch {
/// Returns a new [InstrumentPatch] instance.
InstrumentPatch({
this.assetClass,
this.board,
this.lot,
this.name,
this.sector,
});
@JsonKey(
name: r'asset_class',
required: false,
includeIfNull: false,
)
final String? assetClass;
@JsonKey(
name: r'board',
required: false,
includeIfNull: false,
)
final String? board;
// minimum: 1
@JsonKey(
name: r'lot',
required: false,
includeIfNull: false,
)
final int? lot;
@JsonKey(
name: r'name',
required: false,
includeIfNull: false,
)
final String? name;
@JsonKey(
name: r'sector',
required: false,
includeIfNull: false,
)
final String? sector;
@override
bool operator ==(Object other) => identical(this, other) || other is InstrumentPatch &&
other.assetClass == assetClass &&
other.board == board &&
other.lot == lot &&
other.name == name &&
other.sector == sector;
@override
int get hashCode =>
(assetClass == null ? 0 : assetClass.hashCode) +
(board == null ? 0 : board.hashCode) +
(lot == null ? 0 : lot.hashCode) +
(name == null ? 0 : name.hashCode) +
(sector == null ? 0 : sector.hashCode);
factory InstrumentPatch.fromJson(Map<String, dynamic> json) => _$InstrumentPatchFromJson(json);
Map<String, dynamic> toJson() => _$InstrumentPatchToJson(this);
@override
String toString() {
return toJson().toString();
}
}
@@ -0,0 +1,125 @@
// GENERATED CODE - DO NOT MODIFY BY HAND
part of 'instrument_patch.dart';
// **************************************************************************
// CopyWithGenerator
// **************************************************************************
abstract class _$InstrumentPatchCWProxy {
InstrumentPatch assetClass(String? assetClass);
InstrumentPatch board(String? board);
InstrumentPatch lot(int? lot);
InstrumentPatch name(String? name);
InstrumentPatch sector(String? sector);
/// This function **does support** nullification of nullable fields. All `null` values passed to `non-nullable` fields will be ignored. You can also use `InstrumentPatch(...).copyWith.fieldName(...)` to override fields one at a time with nullification support.
///
/// Usage
/// ```dart
/// InstrumentPatch(...).copyWith(id: 12, name: "My name")
/// ````
InstrumentPatch call({
String? assetClass,
String? board,
int? lot,
String? name,
String? sector,
});
}
/// Proxy class for `copyWith` functionality. This is a callable class and can be used as follows: `instanceOfInstrumentPatch.copyWith(...)`. Additionally contains functions for specific fields e.g. `instanceOfInstrumentPatch.copyWith.fieldName(...)`
class _$InstrumentPatchCWProxyImpl implements _$InstrumentPatchCWProxy {
const _$InstrumentPatchCWProxyImpl(this._value);
final InstrumentPatch _value;
@override
InstrumentPatch assetClass(String? assetClass) =>
this(assetClass: assetClass);
@override
InstrumentPatch board(String? board) => this(board: board);
@override
InstrumentPatch lot(int? lot) => this(lot: lot);
@override
InstrumentPatch name(String? name) => this(name: name);
@override
InstrumentPatch sector(String? sector) => this(sector: sector);
@override
/// This function **does support** nullification of nullable fields. All `null` values passed to `non-nullable` fields will be ignored. You can also use `InstrumentPatch(...).copyWith.fieldName(...)` to override fields one at a time with nullification support.
///
/// Usage
/// ```dart
/// InstrumentPatch(...).copyWith(id: 12, name: "My name")
/// ````
InstrumentPatch call({
Object? assetClass = const $CopyWithPlaceholder(),
Object? board = const $CopyWithPlaceholder(),
Object? lot = const $CopyWithPlaceholder(),
Object? name = const $CopyWithPlaceholder(),
Object? sector = const $CopyWithPlaceholder(),
}) {
return InstrumentPatch(
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?,
lot: lot == const $CopyWithPlaceholder()
? _value.lot
// ignore: cast_nullable_to_non_nullable
: lot as int?,
name: name == const $CopyWithPlaceholder()
? _value.name
// ignore: cast_nullable_to_non_nullable
: name as String?,
sector: sector == const $CopyWithPlaceholder()
? _value.sector
// ignore: cast_nullable_to_non_nullable
: sector as String?,
);
}
}
extension $InstrumentPatchCopyWith on InstrumentPatch {
/// Returns a callable class that can be used as follows: `instanceOfInstrumentPatch.copyWith(...)` or like so:`instanceOfInstrumentPatch.copyWith.fieldName(...)`.
// ignore: library_private_types_in_public_api
_$InstrumentPatchCWProxy get copyWith => _$InstrumentPatchCWProxyImpl(this);
}
// **************************************************************************
// JsonSerializableGenerator
// **************************************************************************
InstrumentPatch _$InstrumentPatchFromJson(Map<String, dynamic> json) =>
$checkedCreate('InstrumentPatch', json, ($checkedConvert) {
final val = InstrumentPatch(
assetClass: $checkedConvert('asset_class', (v) => v as String?),
board: $checkedConvert('board', (v) => v as String?),
lot: $checkedConvert('lot', (v) => (v as num?)?.toInt()),
name: $checkedConvert('name', (v) => v as String?),
sector: $checkedConvert('sector', (v) => v as String?),
);
return val;
}, fieldKeyMap: const {'assetClass': 'asset_class'});
Map<String, dynamic> _$InstrumentPatchToJson(InstrumentPatch instance) =>
<String, dynamic>{
'asset_class': ?instance.assetClass,
'board': ?instance.board,
'lot': ?instance.lot,
'name': ?instance.name,
'sector': ?instance.sector,
};
@@ -0,0 +1,225 @@
//
// AUTO-GENERATED FILE, DO NOT MODIFY!
//
// ignore_for_file: unused_element
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 'manual_event_create.g.dart';
@CopyWith()
@JsonSerializable(
checked: true,
createToJson: true,
disallowUnrecognizedKeys: false,
explicitToJson: true,
)
class ManualEventCreate {
/// Returns a new [ManualEventCreate] instance.
ManualEventCreate({
required this.accountId,
this.accruedInterest,
this.amount,
this.currency,
this.description,
this.fee,
this.instrumentId,
required this.kind,
this.price,
this.quantity,
required this.tradeDate,
});
@JsonKey(
name: r'account_id',
required: true,
includeIfNull: false,
)
final int accountId;
/// decimal as string
@JsonKey(
name: r'accrued_interest',
required: false,
includeIfNull: false,
)
final String? accruedInterest;
/// decimal as string
@JsonKey(
name: r'amount',
required: false,
includeIfNull: false,
)
final String? amount;
@JsonKey(
name: r'currency',
required: false,
includeIfNull: false,
)
final String? currency;
@JsonKey(
name: r'description',
required: false,
includeIfNull: false,
)
final String? description;
/// decimal as string
@JsonKey(
name: r'fee',
required: false,
includeIfNull: false,
)
final String? fee;
@JsonKey(
name: r'instrument_id',
required: false,
includeIfNull: false,
)
final int? instrumentId;
@JsonKey(
name: r'kind',
required: true,
includeIfNull: false,
unknownEnumValue: EventKind.unknownDefaultOpenApi,
)
final EventKind kind;
/// decimal as string
@JsonKey(
name: r'price',
required: false,
includeIfNull: false,
)
final String? price;
/// decimal as string
@JsonKey(
name: r'quantity',
required: false,
includeIfNull: false,
)
final String? quantity;
@JsonKey(
name: r'trade_date',
required: true,
includeIfNull: false,
)
final DateTime tradeDate;
@override
bool operator ==(Object other) => identical(this, other) || other is ManualEventCreate &&
other.accountId == accountId &&
other.accruedInterest == accruedInterest &&
other.amount == amount &&
other.currency == currency &&
other.description == description &&
other.fee == fee &&
other.instrumentId == instrumentId &&
other.kind == kind &&
other.price == price &&
other.quantity == quantity &&
other.tradeDate == tradeDate;
@override
int get hashCode =>
accountId.hashCode +
(accruedInterest == null ? 0 : accruedInterest.hashCode) +
(amount == null ? 0 : amount.hashCode) +
(currency == null ? 0 : currency.hashCode) +
(description == null ? 0 : description.hashCode) +
(fee == null ? 0 : fee.hashCode) +
(instrumentId == null ? 0 : instrumentId.hashCode) +
kind.hashCode +
(price == null ? 0 : price.hashCode) +
(quantity == null ? 0 : quantity.hashCode) +
tradeDate.hashCode;
factory ManualEventCreate.fromJson(Map<String, dynamic> json) => _$ManualEventCreateFromJson(json);
Map<String, dynamic> toJson() => _$ManualEventCreateToJson(this);
@override
String toString() {
return toJson().toString();
}
}
@@ -0,0 +1,252 @@
// GENERATED CODE - DO NOT MODIFY BY HAND
part of 'manual_event_create.dart';
// **************************************************************************
// CopyWithGenerator
// **************************************************************************
abstract class _$ManualEventCreateCWProxy {
ManualEventCreate accountId(int accountId);
ManualEventCreate accruedInterest(String? accruedInterest);
ManualEventCreate amount(String? amount);
ManualEventCreate currency(String? currency);
ManualEventCreate description(String? description);
ManualEventCreate fee(String? fee);
ManualEventCreate instrumentId(int? instrumentId);
ManualEventCreate kind(EventKind kind);
ManualEventCreate price(String? price);
ManualEventCreate quantity(String? quantity);
ManualEventCreate tradeDate(DateTime tradeDate);
/// This function **does support** nullification of nullable fields. All `null` values passed to `non-nullable` fields will be ignored. You can also use `ManualEventCreate(...).copyWith.fieldName(...)` to override fields one at a time with nullification support.
///
/// Usage
/// ```dart
/// ManualEventCreate(...).copyWith(id: 12, name: "My name")
/// ````
ManualEventCreate call({
int accountId,
String? accruedInterest,
String? amount,
String? currency,
String? description,
String? fee,
int? instrumentId,
EventKind kind,
String? price,
String? quantity,
DateTime tradeDate,
});
}
/// Proxy class for `copyWith` functionality. This is a callable class and can be used as follows: `instanceOfManualEventCreate.copyWith(...)`. Additionally contains functions for specific fields e.g. `instanceOfManualEventCreate.copyWith.fieldName(...)`
class _$ManualEventCreateCWProxyImpl implements _$ManualEventCreateCWProxy {
const _$ManualEventCreateCWProxyImpl(this._value);
final ManualEventCreate _value;
@override
ManualEventCreate accountId(int accountId) => this(accountId: accountId);
@override
ManualEventCreate accruedInterest(String? accruedInterest) =>
this(accruedInterest: accruedInterest);
@override
ManualEventCreate amount(String? amount) => this(amount: amount);
@override
ManualEventCreate currency(String? currency) => this(currency: currency);
@override
ManualEventCreate description(String? description) =>
this(description: description);
@override
ManualEventCreate fee(String? fee) => this(fee: fee);
@override
ManualEventCreate instrumentId(int? instrumentId) =>
this(instrumentId: instrumentId);
@override
ManualEventCreate kind(EventKind kind) => this(kind: kind);
@override
ManualEventCreate price(String? price) => this(price: price);
@override
ManualEventCreate quantity(String? quantity) => this(quantity: quantity);
@override
ManualEventCreate tradeDate(DateTime tradeDate) => this(tradeDate: tradeDate);
@override
/// This function **does support** nullification of nullable fields. All `null` values passed to `non-nullable` fields will be ignored. You can also use `ManualEventCreate(...).copyWith.fieldName(...)` to override fields one at a time with nullification support.
///
/// Usage
/// ```dart
/// ManualEventCreate(...).copyWith(id: 12, name: "My name")
/// ````
ManualEventCreate call({
Object? accountId = const $CopyWithPlaceholder(),
Object? accruedInterest = const $CopyWithPlaceholder(),
Object? amount = const $CopyWithPlaceholder(),
Object? currency = const $CopyWithPlaceholder(),
Object? description = const $CopyWithPlaceholder(),
Object? fee = const $CopyWithPlaceholder(),
Object? instrumentId = const $CopyWithPlaceholder(),
Object? kind = const $CopyWithPlaceholder(),
Object? price = const $CopyWithPlaceholder(),
Object? quantity = const $CopyWithPlaceholder(),
Object? tradeDate = const $CopyWithPlaceholder(),
}) {
return ManualEventCreate(
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?,
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?,
fee: fee == const $CopyWithPlaceholder()
? _value.fee
// ignore: cast_nullable_to_non_nullable
: fee as String?,
instrumentId: instrumentId == const $CopyWithPlaceholder()
? _value.instrumentId
// ignore: cast_nullable_to_non_nullable
: instrumentId as int?,
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?,
quantity: quantity == const $CopyWithPlaceholder()
? _value.quantity
// ignore: cast_nullable_to_non_nullable
: quantity as String?,
tradeDate: tradeDate == const $CopyWithPlaceholder()
? _value.tradeDate
// ignore: cast_nullable_to_non_nullable
: tradeDate as DateTime,
);
}
}
extension $ManualEventCreateCopyWith on ManualEventCreate {
/// Returns a callable class that can be used as follows: `instanceOfManualEventCreate.copyWith(...)` or like so:`instanceOfManualEventCreate.copyWith.fieldName(...)`.
// ignore: library_private_types_in_public_api
_$ManualEventCreateCWProxy get copyWith =>
_$ManualEventCreateCWProxyImpl(this);
}
// **************************************************************************
// JsonSerializableGenerator
// **************************************************************************
ManualEventCreate _$ManualEventCreateFromJson(
Map<String, dynamic> json,
) => $checkedCreate(
'ManualEventCreate',
json,
($checkedConvert) {
$checkKeys(json, requiredKeys: const ['account_id', 'kind', 'trade_date']);
final val = ManualEventCreate(
accountId: $checkedConvert('account_id', (v) => (v as num).toInt()),
accruedInterest: $checkedConvert('accrued_interest', (v) => v as String?),
amount: $checkedConvert('amount', (v) => v as String?),
currency: $checkedConvert('currency', (v) => v as String?),
description: $checkedConvert('description', (v) => v as String?),
fee: $checkedConvert('fee', (v) => v as String?),
instrumentId: $checkedConvert(
'instrument_id',
(v) => (v as num?)?.toInt(),
),
kind: $checkedConvert(
'kind',
(v) => $enumDecode(
_$EventKindEnumMap,
v,
unknownValue: EventKind.unknownDefaultOpenApi,
),
),
price: $checkedConvert('price', (v) => v as String?),
quantity: $checkedConvert('quantity', (v) => v as String?),
tradeDate: $checkedConvert(
'trade_date',
(v) => DateTime.parse(v as String),
),
);
return val;
},
fieldKeyMap: const {
'accountId': 'account_id',
'accruedInterest': 'accrued_interest',
'instrumentId': 'instrument_id',
'tradeDate': 'trade_date',
},
);
Map<String, dynamic> _$ManualEventCreateToJson(ManualEventCreate instance) =>
<String, dynamic>{
'account_id': instance.accountId,
'accrued_interest': ?instance.accruedInterest,
'amount': ?instance.amount,
'currency': ?instance.currency,
'description': ?instance.description,
'fee': ?instance.fee,
'instrument_id': ?instance.instrumentId,
'kind': _$EventKindEnumMap[instance.kind]!,
'price': ?instance.price,
'quantity': ?instance.quantity,
'trade_date': instance.tradeDate.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',
};
@@ -0,0 +1,91 @@
//
// AUTO-GENERATED FILE, DO NOT MODIFY!
//
// ignore_for_file: unused_element
import 'package:fintracker_api/src/model/refresh_log_out.dart';
import 'package:copy_with_extension/copy_with_extension.dart';
import 'package:json_annotation/json_annotation.dart';
part 'metrics_status_out.g.dart';
@CopyWith()
@JsonSerializable(
checked: true,
createToJson: true,
disallowUnrecognizedKeys: false,
explicitToJson: true,
)
class MetricsStatusOut {
/// Returns a new [MetricsStatusOut] instance.
MetricsStatusOut({
required this.consistent,
required this.lastRefresh,
required this.refreshing,
});
@JsonKey(
name: r'consistent',
required: true,
includeIfNull: false,
)
final bool consistent;
@JsonKey(
name: r'last_refresh',
required: true,
includeIfNull: true,
)
final RefreshLogOut? lastRefresh;
@JsonKey(
name: r'refreshing',
required: true,
includeIfNull: false,
)
final bool refreshing;
@override
bool operator ==(Object other) => identical(this, other) || other is MetricsStatusOut &&
other.consistent == consistent &&
other.lastRefresh == lastRefresh &&
other.refreshing == refreshing;
@override
int get hashCode =>
consistent.hashCode +
(lastRefresh == null ? 0 : lastRefresh.hashCode) +
refreshing.hashCode;
factory MetricsStatusOut.fromJson(Map<String, dynamic> json) => _$MetricsStatusOutFromJson(json);
Map<String, dynamic> toJson() => _$MetricsStatusOutToJson(this);
@override
String toString() {
return toJson().toString();
}
}
@@ -0,0 +1,108 @@
// GENERATED CODE - DO NOT MODIFY BY HAND
part of 'metrics_status_out.dart';
// **************************************************************************
// CopyWithGenerator
// **************************************************************************
abstract class _$MetricsStatusOutCWProxy {
MetricsStatusOut consistent(bool consistent);
MetricsStatusOut lastRefresh(RefreshLogOut? lastRefresh);
MetricsStatusOut refreshing(bool refreshing);
/// This function **does support** nullification of nullable fields. All `null` values passed to `non-nullable` fields will be ignored. You can also use `MetricsStatusOut(...).copyWith.fieldName(...)` to override fields one at a time with nullification support.
///
/// Usage
/// ```dart
/// MetricsStatusOut(...).copyWith(id: 12, name: "My name")
/// ````
MetricsStatusOut call({
bool consistent,
RefreshLogOut? lastRefresh,
bool refreshing,
});
}
/// Proxy class for `copyWith` functionality. This is a callable class and can be used as follows: `instanceOfMetricsStatusOut.copyWith(...)`. Additionally contains functions for specific fields e.g. `instanceOfMetricsStatusOut.copyWith.fieldName(...)`
class _$MetricsStatusOutCWProxyImpl implements _$MetricsStatusOutCWProxy {
const _$MetricsStatusOutCWProxyImpl(this._value);
final MetricsStatusOut _value;
@override
MetricsStatusOut consistent(bool consistent) => this(consistent: consistent);
@override
MetricsStatusOut lastRefresh(RefreshLogOut? lastRefresh) =>
this(lastRefresh: lastRefresh);
@override
MetricsStatusOut refreshing(bool refreshing) => this(refreshing: refreshing);
@override
/// This function **does support** nullification of nullable fields. All `null` values passed to `non-nullable` fields will be ignored. You can also use `MetricsStatusOut(...).copyWith.fieldName(...)` to override fields one at a time with nullification support.
///
/// Usage
/// ```dart
/// MetricsStatusOut(...).copyWith(id: 12, name: "My name")
/// ````
MetricsStatusOut call({
Object? consistent = const $CopyWithPlaceholder(),
Object? lastRefresh = const $CopyWithPlaceholder(),
Object? refreshing = const $CopyWithPlaceholder(),
}) {
return MetricsStatusOut(
consistent: consistent == const $CopyWithPlaceholder()
? _value.consistent
// ignore: cast_nullable_to_non_nullable
: consistent as bool,
lastRefresh: lastRefresh == const $CopyWithPlaceholder()
? _value.lastRefresh
// ignore: cast_nullable_to_non_nullable
: lastRefresh as RefreshLogOut?,
refreshing: refreshing == const $CopyWithPlaceholder()
? _value.refreshing
// ignore: cast_nullable_to_non_nullable
: refreshing as bool,
);
}
}
extension $MetricsStatusOutCopyWith on MetricsStatusOut {
/// Returns a callable class that can be used as follows: `instanceOfMetricsStatusOut.copyWith(...)` or like so:`instanceOfMetricsStatusOut.copyWith.fieldName(...)`.
// ignore: library_private_types_in_public_api
_$MetricsStatusOutCWProxy get copyWith => _$MetricsStatusOutCWProxyImpl(this);
}
// **************************************************************************
// JsonSerializableGenerator
// **************************************************************************
MetricsStatusOut _$MetricsStatusOutFromJson(Map<String, dynamic> json) =>
$checkedCreate('MetricsStatusOut', json, ($checkedConvert) {
$checkKeys(
json,
requiredKeys: const ['consistent', 'last_refresh', 'refreshing'],
);
final val = MetricsStatusOut(
consistent: $checkedConvert('consistent', (v) => v as bool),
lastRefresh: $checkedConvert(
'last_refresh',
(v) => v == null
? null
: RefreshLogOut.fromJson(v as Map<String, dynamic>),
),
refreshing: $checkedConvert('refreshing', (v) => v as bool),
);
return val;
}, fieldKeyMap: const {'lastRefresh': 'last_refresh'});
Map<String, dynamic> _$MetricsStatusOutToJson(MetricsStatusOut instance) =>
<String, dynamic>{
'consistent': instance.consistent,
'last_refresh': instance.lastRefresh?.toJson(),
'refreshing': instance.refreshing,
};
@@ -0,0 +1,58 @@
//
// AUTO-GENERATED FILE, DO NOT MODIFY!
//
// ignore_for_file: unused_element
import 'package:copy_with_extension/copy_with_extension.dart';
import 'package:json_annotation/json_annotation.dart';
part 'portfolio_accounts_in.g.dart';
@CopyWith()
@JsonSerializable(
checked: true,
createToJson: true,
disallowUnrecognizedKeys: false,
explicitToJson: true,
)
class PortfolioAccountsIn {
/// Returns a new [PortfolioAccountsIn] instance.
PortfolioAccountsIn({
required this.accountIds,
});
@JsonKey(
name: r'account_ids',
required: true,
includeIfNull: false,
)
final List<int> accountIds;
@override
bool operator ==(Object other) => identical(this, other) || other is PortfolioAccountsIn &&
other.accountIds == accountIds;
@override
int get hashCode =>
accountIds.hashCode;
factory PortfolioAccountsIn.fromJson(Map<String, dynamic> json) => _$PortfolioAccountsInFromJson(json);
Map<String, dynamic> toJson() => _$PortfolioAccountsInToJson(this);
@override
String toString() {
return toJson().toString();
}
}
@@ -0,0 +1,75 @@
// GENERATED CODE - DO NOT MODIFY BY HAND
part of 'portfolio_accounts_in.dart';
// **************************************************************************
// CopyWithGenerator
// **************************************************************************
abstract class _$PortfolioAccountsInCWProxy {
PortfolioAccountsIn accountIds(List<int> accountIds);
/// This function **does support** nullification of nullable fields. All `null` values passed to `non-nullable` fields will be ignored. You can also use `PortfolioAccountsIn(...).copyWith.fieldName(...)` to override fields one at a time with nullification support.
///
/// Usage
/// ```dart
/// PortfolioAccountsIn(...).copyWith(id: 12, name: "My name")
/// ````
PortfolioAccountsIn call({List<int> accountIds});
}
/// Proxy class for `copyWith` functionality. This is a callable class and can be used as follows: `instanceOfPortfolioAccountsIn.copyWith(...)`. Additionally contains functions for specific fields e.g. `instanceOfPortfolioAccountsIn.copyWith.fieldName(...)`
class _$PortfolioAccountsInCWProxyImpl implements _$PortfolioAccountsInCWProxy {
const _$PortfolioAccountsInCWProxyImpl(this._value);
final PortfolioAccountsIn _value;
@override
PortfolioAccountsIn accountIds(List<int> accountIds) =>
this(accountIds: accountIds);
@override
/// This function **does support** nullification of nullable fields. All `null` values passed to `non-nullable` fields will be ignored. You can also use `PortfolioAccountsIn(...).copyWith.fieldName(...)` to override fields one at a time with nullification support.
///
/// Usage
/// ```dart
/// PortfolioAccountsIn(...).copyWith(id: 12, name: "My name")
/// ````
PortfolioAccountsIn call({
Object? accountIds = const $CopyWithPlaceholder(),
}) {
return PortfolioAccountsIn(
accountIds: accountIds == const $CopyWithPlaceholder()
? _value.accountIds
// ignore: cast_nullable_to_non_nullable
: accountIds as List<int>,
);
}
}
extension $PortfolioAccountsInCopyWith on PortfolioAccountsIn {
/// Returns a callable class that can be used as follows: `instanceOfPortfolioAccountsIn.copyWith(...)` or like so:`instanceOfPortfolioAccountsIn.copyWith.fieldName(...)`.
// ignore: library_private_types_in_public_api
_$PortfolioAccountsInCWProxy get copyWith =>
_$PortfolioAccountsInCWProxyImpl(this);
}
// **************************************************************************
// JsonSerializableGenerator
// **************************************************************************
PortfolioAccountsIn _$PortfolioAccountsInFromJson(Map<String, dynamic> json) =>
$checkedCreate('PortfolioAccountsIn', json, ($checkedConvert) {
$checkKeys(json, requiredKeys: const ['account_ids']);
final val = PortfolioAccountsIn(
accountIds: $checkedConvert(
'account_ids',
(v) => (v as List<dynamic>).map((e) => (e as num).toInt()).toList(),
),
);
return val;
}, fieldKeyMap: const {'accountIds': 'account_ids'});
Map<String, dynamic> _$PortfolioAccountsInToJson(
PortfolioAccountsIn instance,
) => <String, dynamic>{'account_ids': instance.accountIds};
@@ -0,0 +1,74 @@
//
// AUTO-GENERATED FILE, DO NOT MODIFY!
//
// ignore_for_file: unused_element
import 'package:copy_with_extension/copy_with_extension.dart';
import 'package:json_annotation/json_annotation.dart';
part 'portfolio_create.g.dart';
@CopyWith()
@JsonSerializable(
checked: true,
createToJson: true,
disallowUnrecognizedKeys: false,
explicitToJson: true,
)
class PortfolioCreate {
/// Returns a new [PortfolioCreate] instance.
PortfolioCreate({
this.accountIds,
required this.name,
});
@JsonKey(
name: r'account_ids',
required: false,
includeIfNull: false,
)
final List<int>? accountIds;
@JsonKey(
name: r'name',
required: true,
includeIfNull: false,
)
final String name;
@override
bool operator ==(Object other) => identical(this, other) || other is PortfolioCreate &&
other.accountIds == accountIds &&
other.name == name;
@override
int get hashCode =>
accountIds.hashCode +
name.hashCode;
factory PortfolioCreate.fromJson(Map<String, dynamic> json) => _$PortfolioCreateFromJson(json);
Map<String, dynamic> toJson() => _$PortfolioCreateToJson(this);
@override
String toString() {
return toJson().toString();
}
}
@@ -0,0 +1,87 @@
// GENERATED CODE - DO NOT MODIFY BY HAND
part of 'portfolio_create.dart';
// **************************************************************************
// CopyWithGenerator
// **************************************************************************
abstract class _$PortfolioCreateCWProxy {
PortfolioCreate accountIds(List<int>? accountIds);
PortfolioCreate name(String name);
/// This function **does support** nullification of nullable fields. All `null` values passed to `non-nullable` fields will be ignored. You can also use `PortfolioCreate(...).copyWith.fieldName(...)` to override fields one at a time with nullification support.
///
/// Usage
/// ```dart
/// PortfolioCreate(...).copyWith(id: 12, name: "My name")
/// ````
PortfolioCreate call({List<int>? accountIds, String name});
}
/// Proxy class for `copyWith` functionality. This is a callable class and can be used as follows: `instanceOfPortfolioCreate.copyWith(...)`. Additionally contains functions for specific fields e.g. `instanceOfPortfolioCreate.copyWith.fieldName(...)`
class _$PortfolioCreateCWProxyImpl implements _$PortfolioCreateCWProxy {
const _$PortfolioCreateCWProxyImpl(this._value);
final PortfolioCreate _value;
@override
PortfolioCreate accountIds(List<int>? accountIds) =>
this(accountIds: accountIds);
@override
PortfolioCreate name(String name) => this(name: name);
@override
/// This function **does support** nullification of nullable fields. All `null` values passed to `non-nullable` fields will be ignored. You can also use `PortfolioCreate(...).copyWith.fieldName(...)` to override fields one at a time with nullification support.
///
/// Usage
/// ```dart
/// PortfolioCreate(...).copyWith(id: 12, name: "My name")
/// ````
PortfolioCreate call({
Object? accountIds = const $CopyWithPlaceholder(),
Object? name = const $CopyWithPlaceholder(),
}) {
return PortfolioCreate(
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,
);
}
}
extension $PortfolioCreateCopyWith on PortfolioCreate {
/// Returns a callable class that can be used as follows: `instanceOfPortfolioCreate.copyWith(...)` or like so:`instanceOfPortfolioCreate.copyWith.fieldName(...)`.
// ignore: library_private_types_in_public_api
_$PortfolioCreateCWProxy get copyWith => _$PortfolioCreateCWProxyImpl(this);
}
// **************************************************************************
// JsonSerializableGenerator
// **************************************************************************
PortfolioCreate _$PortfolioCreateFromJson(Map<String, dynamic> json) =>
$checkedCreate('PortfolioCreate', json, ($checkedConvert) {
$checkKeys(json, requiredKeys: const ['name']);
final val = PortfolioCreate(
accountIds: $checkedConvert(
'account_ids',
(v) => (v as List<dynamic>?)?.map((e) => (e as num).toInt()).toList(),
),
name: $checkedConvert('name', (v) => v as String),
);
return val;
}, fieldKeyMap: const {'accountIds': 'account_ids'});
Map<String, dynamic> _$PortfolioCreateToJson(PortfolioCreate instance) =>
<String, dynamic>{
'account_ids': ?instance.accountIds,
'name': instance.name,
};
@@ -0,0 +1,106 @@
//
// AUTO-GENERATED FILE, DO NOT MODIFY!
//
// ignore_for_file: unused_element
import 'package:copy_with_extension/copy_with_extension.dart';
import 'package:json_annotation/json_annotation.dart';
part 'portfolio_out.g.dart';
@CopyWith()
@JsonSerializable(
checked: true,
createToJson: true,
disallowUnrecognizedKeys: false,
explicitToJson: true,
)
class PortfolioOut {
/// Returns a new [PortfolioOut] instance.
PortfolioOut({
required this.accountIds,
required this.baseCurrency,
required this.id,
required this.name,
});
@JsonKey(
name: r'account_ids',
required: true,
includeIfNull: false,
)
final List<int> accountIds;
@JsonKey(
name: r'base_currency',
required: true,
includeIfNull: false,
)
final String baseCurrency;
@JsonKey(
name: r'id',
required: true,
includeIfNull: false,
)
final int id;
@JsonKey(
name: r'name',
required: true,
includeIfNull: false,
)
final String name;
@override
bool operator ==(Object other) => identical(this, other) || other is PortfolioOut &&
other.accountIds == accountIds &&
other.baseCurrency == baseCurrency &&
other.id == id &&
other.name == name;
@override
int get hashCode =>
accountIds.hashCode +
baseCurrency.hashCode +
id.hashCode +
name.hashCode;
factory PortfolioOut.fromJson(Map<String, dynamic> json) => _$PortfolioOutFromJson(json);
Map<String, dynamic> toJson() => _$PortfolioOutToJson(this);
@override
String toString() {
return toJson().toString();
}
}
@@ -0,0 +1,127 @@
// GENERATED CODE - DO NOT MODIFY BY HAND
part of 'portfolio_out.dart';
// **************************************************************************
// CopyWithGenerator
// **************************************************************************
abstract class _$PortfolioOutCWProxy {
PortfolioOut accountIds(List<int> accountIds);
PortfolioOut baseCurrency(String baseCurrency);
PortfolioOut id(int id);
PortfolioOut name(String name);
/// This function **does support** nullification of nullable fields. All `null` values passed to `non-nullable` fields will be ignored. You can also use `PortfolioOut(...).copyWith.fieldName(...)` to override fields one at a time with nullification support.
///
/// Usage
/// ```dart
/// PortfolioOut(...).copyWith(id: 12, name: "My name")
/// ````
PortfolioOut call({
List<int> accountIds,
String baseCurrency,
int id,
String name,
});
}
/// Proxy class for `copyWith` functionality. This is a callable class and can be used as follows: `instanceOfPortfolioOut.copyWith(...)`. Additionally contains functions for specific fields e.g. `instanceOfPortfolioOut.copyWith.fieldName(...)`
class _$PortfolioOutCWProxyImpl implements _$PortfolioOutCWProxy {
const _$PortfolioOutCWProxyImpl(this._value);
final PortfolioOut _value;
@override
PortfolioOut accountIds(List<int> accountIds) => this(accountIds: accountIds);
@override
PortfolioOut baseCurrency(String baseCurrency) =>
this(baseCurrency: baseCurrency);
@override
PortfolioOut id(int id) => this(id: id);
@override
PortfolioOut name(String name) => this(name: name);
@override
/// This function **does support** nullification of nullable fields. All `null` values passed to `non-nullable` fields will be ignored. You can also use `PortfolioOut(...).copyWith.fieldName(...)` to override fields one at a time with nullification support.
///
/// Usage
/// ```dart
/// PortfolioOut(...).copyWith(id: 12, name: "My name")
/// ````
PortfolioOut call({
Object? accountIds = const $CopyWithPlaceholder(),
Object? baseCurrency = const $CopyWithPlaceholder(),
Object? id = const $CopyWithPlaceholder(),
Object? name = const $CopyWithPlaceholder(),
}) {
return PortfolioOut(
accountIds: accountIds == const $CopyWithPlaceholder()
? _value.accountIds
// ignore: cast_nullable_to_non_nullable
: accountIds as List<int>,
baseCurrency: baseCurrency == const $CopyWithPlaceholder()
? _value.baseCurrency
// ignore: cast_nullable_to_non_nullable
: baseCurrency as String,
id: id == const $CopyWithPlaceholder()
? _value.id
// ignore: cast_nullable_to_non_nullable
: id as int,
name: name == const $CopyWithPlaceholder()
? _value.name
// ignore: cast_nullable_to_non_nullable
: name as String,
);
}
}
extension $PortfolioOutCopyWith on PortfolioOut {
/// Returns a callable class that can be used as follows: `instanceOfPortfolioOut.copyWith(...)` or like so:`instanceOfPortfolioOut.copyWith.fieldName(...)`.
// ignore: library_private_types_in_public_api
_$PortfolioOutCWProxy get copyWith => _$PortfolioOutCWProxyImpl(this);
}
// **************************************************************************
// JsonSerializableGenerator
// **************************************************************************
PortfolioOut _$PortfolioOutFromJson(Map<String, dynamic> json) =>
$checkedCreate(
'PortfolioOut',
json,
($checkedConvert) {
$checkKeys(
json,
requiredKeys: const ['account_ids', 'base_currency', 'id', 'name'],
);
final val = PortfolioOut(
accountIds: $checkedConvert(
'account_ids',
(v) => (v as List<dynamic>).map((e) => (e as num).toInt()).toList(),
),
baseCurrency: $checkedConvert('base_currency', (v) => v as String),
id: $checkedConvert('id', (v) => (v as num).toInt()),
name: $checkedConvert('name', (v) => v as String),
);
return val;
},
fieldKeyMap: const {
'accountIds': 'account_ids',
'baseCurrency': 'base_currency',
},
);
Map<String, dynamic> _$PortfolioOutToJson(PortfolioOut instance) =>
<String, dynamic>{
'account_ids': instance.accountIds,
'base_currency': instance.baseCurrency,
'id': instance.id,
'name': instance.name,
};
@@ -0,0 +1,58 @@
//
// AUTO-GENERATED FILE, DO NOT MODIFY!
//
// ignore_for_file: unused_element
import 'package:copy_with_extension/copy_with_extension.dart';
import 'package:json_annotation/json_annotation.dart';
part 'portfolio_patch.g.dart';
@CopyWith()
@JsonSerializable(
checked: true,
createToJson: true,
disallowUnrecognizedKeys: false,
explicitToJson: true,
)
class PortfolioPatch {
/// Returns a new [PortfolioPatch] instance.
PortfolioPatch({
required this.name,
});
@JsonKey(
name: r'name',
required: true,
includeIfNull: false,
)
final String name;
@override
bool operator ==(Object other) => identical(this, other) || other is PortfolioPatch &&
other.name == name;
@override
int get hashCode =>
name.hashCode;
factory PortfolioPatch.fromJson(Map<String, dynamic> json) => _$PortfolioPatchFromJson(json);
Map<String, dynamic> toJson() => _$PortfolioPatchToJson(this);
@override
String toString() {
return toJson().toString();
}
}
@@ -0,0 +1,67 @@
// GENERATED CODE - DO NOT MODIFY BY HAND
part of 'portfolio_patch.dart';
// **************************************************************************
// CopyWithGenerator
// **************************************************************************
abstract class _$PortfolioPatchCWProxy {
PortfolioPatch name(String name);
/// This function **does support** nullification of nullable fields. All `null` values passed to `non-nullable` fields will be ignored. You can also use `PortfolioPatch(...).copyWith.fieldName(...)` to override fields one at a time with nullification support.
///
/// Usage
/// ```dart
/// PortfolioPatch(...).copyWith(id: 12, name: "My name")
/// ````
PortfolioPatch call({String name});
}
/// Proxy class for `copyWith` functionality. This is a callable class and can be used as follows: `instanceOfPortfolioPatch.copyWith(...)`. Additionally contains functions for specific fields e.g. `instanceOfPortfolioPatch.copyWith.fieldName(...)`
class _$PortfolioPatchCWProxyImpl implements _$PortfolioPatchCWProxy {
const _$PortfolioPatchCWProxyImpl(this._value);
final PortfolioPatch _value;
@override
PortfolioPatch name(String name) => this(name: name);
@override
/// This function **does support** nullification of nullable fields. All `null` values passed to `non-nullable` fields will be ignored. You can also use `PortfolioPatch(...).copyWith.fieldName(...)` to override fields one at a time with nullification support.
///
/// Usage
/// ```dart
/// PortfolioPatch(...).copyWith(id: 12, name: "My name")
/// ````
PortfolioPatch call({Object? name = const $CopyWithPlaceholder()}) {
return PortfolioPatch(
name: name == const $CopyWithPlaceholder()
? _value.name
// ignore: cast_nullable_to_non_nullable
: name as String,
);
}
}
extension $PortfolioPatchCopyWith on PortfolioPatch {
/// Returns a callable class that can be used as follows: `instanceOfPortfolioPatch.copyWith(...)` or like so:`instanceOfPortfolioPatch.copyWith.fieldName(...)`.
// ignore: library_private_types_in_public_api
_$PortfolioPatchCWProxy get copyWith => _$PortfolioPatchCWProxyImpl(this);
}
// **************************************************************************
// JsonSerializableGenerator
// **************************************************************************
PortfolioPatch _$PortfolioPatchFromJson(Map<String, dynamic> json) =>
$checkedCreate('PortfolioPatch', json, ($checkedConvert) {
$checkKeys(json, requiredKeys: const ['name']);
final val = PortfolioPatch(
name: $checkedConvert('name', (v) => v as String),
);
return val;
});
Map<String, dynamic> _$PortfolioPatchToJson(PortfolioPatch instance) =>
<String, dynamic>{'name': instance.name};
@@ -22,12 +22,16 @@ class RefreshLogOut {
required this.error,
required this.failedStep,
required this.finishedAt,
required this.id,
required this.startedAt,
required this.stepTimings,
required this.trigger,
});
@@ -43,6 +47,18 @@ class RefreshLogOut {
@JsonKey(
name: r'failed_step',
required: true,
includeIfNull: true,
)
final String? failedStep;
@JsonKey(
name: r'finished_at',
@@ -79,6 +95,18 @@ class RefreshLogOut {
@JsonKey(
name: r'step_timings',
required: true,
includeIfNull: true,
)
final Map<String, num>? stepTimings;
@JsonKey(
name: r'trigger',
@@ -96,17 +124,21 @@ class RefreshLogOut {
@override
bool operator ==(Object other) => identical(this, other) || other is RefreshLogOut &&
other.error == error &&
other.failedStep == failedStep &&
other.finishedAt == finishedAt &&
other.id == id &&
other.startedAt == startedAt &&
other.stepTimings == stepTimings &&
other.trigger == trigger;
@override
int get hashCode =>
(error == null ? 0 : error.hashCode) +
(failedStep == null ? 0 : failedStep.hashCode) +
(finishedAt == null ? 0 : finishedAt.hashCode) +
id.hashCode +
startedAt.hashCode +
(stepTimings == null ? 0 : stepTimings.hashCode) +
trigger.hashCode;
factory RefreshLogOut.fromJson(Map<String, dynamic> json) => _$RefreshLogOutFromJson(json);
@@ -9,12 +9,16 @@ part of 'refresh_log_out.dart';
abstract class _$RefreshLogOutCWProxy {
RefreshLogOut error(String? error);
RefreshLogOut failedStep(String? failedStep);
RefreshLogOut finishedAt(DateTime? finishedAt);
RefreshLogOut id(int id);
RefreshLogOut startedAt(DateTime startedAt);
RefreshLogOut stepTimings(Map<String, num>? stepTimings);
RefreshLogOut trigger(String trigger);
/// This function **does support** nullification of nullable fields. All `null` values passed to `non-nullable` fields will be ignored. You can also use `RefreshLogOut(...).copyWith.fieldName(...)` to override fields one at a time with nullification support.
@@ -25,9 +29,11 @@ abstract class _$RefreshLogOutCWProxy {
/// ````
RefreshLogOut call({
String? error,
String? failedStep,
DateTime? finishedAt,
int id,
DateTime startedAt,
Map<String, num>? stepTimings,
String trigger,
});
}
@@ -41,6 +47,9 @@ class _$RefreshLogOutCWProxyImpl implements _$RefreshLogOutCWProxy {
@override
RefreshLogOut error(String? error) => this(error: error);
@override
RefreshLogOut failedStep(String? failedStep) => this(failedStep: failedStep);
@override
RefreshLogOut finishedAt(DateTime? finishedAt) =>
this(finishedAt: finishedAt);
@@ -51,6 +60,10 @@ class _$RefreshLogOutCWProxyImpl implements _$RefreshLogOutCWProxy {
@override
RefreshLogOut startedAt(DateTime startedAt) => this(startedAt: startedAt);
@override
RefreshLogOut stepTimings(Map<String, num>? stepTimings) =>
this(stepTimings: stepTimings);
@override
RefreshLogOut trigger(String trigger) => this(trigger: trigger);
@@ -63,9 +76,11 @@ class _$RefreshLogOutCWProxyImpl implements _$RefreshLogOutCWProxy {
/// ````
RefreshLogOut call({
Object? error = const $CopyWithPlaceholder(),
Object? failedStep = const $CopyWithPlaceholder(),
Object? finishedAt = const $CopyWithPlaceholder(),
Object? id = const $CopyWithPlaceholder(),
Object? startedAt = const $CopyWithPlaceholder(),
Object? stepTimings = const $CopyWithPlaceholder(),
Object? trigger = const $CopyWithPlaceholder(),
}) {
return RefreshLogOut(
@@ -73,6 +88,10 @@ class _$RefreshLogOutCWProxyImpl implements _$RefreshLogOutCWProxy {
? _value.error
// ignore: cast_nullable_to_non_nullable
: error as String?,
failedStep: failedStep == const $CopyWithPlaceholder()
? _value.failedStep
// ignore: cast_nullable_to_non_nullable
: failedStep as String?,
finishedAt: finishedAt == const $CopyWithPlaceholder()
? _value.finishedAt
// ignore: cast_nullable_to_non_nullable
@@ -85,6 +104,10 @@ class _$RefreshLogOutCWProxyImpl implements _$RefreshLogOutCWProxy {
? _value.startedAt
// ignore: cast_nullable_to_non_nullable
: startedAt as DateTime,
stepTimings: stepTimings == const $CopyWithPlaceholder()
? _value.stepTimings
// ignore: cast_nullable_to_non_nullable
: stepTimings as Map<String, num>?,
trigger: trigger == const $CopyWithPlaceholder()
? _value.trigger
// ignore: cast_nullable_to_non_nullable
@@ -112,14 +135,17 @@ RefreshLogOut _$RefreshLogOutFromJson(Map<String, dynamic> json) =>
json,
requiredKeys: const [
'error',
'failed_step',
'finished_at',
'id',
'started_at',
'step_timings',
'trigger',
],
);
final val = RefreshLogOut(
error: $checkedConvert('error', (v) => v as String?),
failedStep: $checkedConvert('failed_step', (v) => v as String?),
finishedAt: $checkedConvert(
'finished_at',
(v) => v == null ? null : DateTime.parse(v as String),
@@ -129,21 +155,31 @@ RefreshLogOut _$RefreshLogOutFromJson(Map<String, dynamic> json) =>
'started_at',
(v) => DateTime.parse(v as String),
),
stepTimings: $checkedConvert(
'step_timings',
(v) => (v as Map<String, dynamic>?)?.map(
(k, e) => MapEntry(k, e as num),
),
),
trigger: $checkedConvert('trigger', (v) => v as String),
);
return val;
},
fieldKeyMap: const {
'failedStep': 'failed_step',
'finishedAt': 'finished_at',
'startedAt': 'started_at',
'stepTimings': 'step_timings',
},
);
Map<String, dynamic> _$RefreshLogOutToJson(RefreshLogOut instance) =>
<String, dynamic>{
'error': instance.error,
'failed_step': instance.failedStep,
'finished_at': instance.finishedAt?.toIso8601String(),
'id': instance.id,
'started_at': instance.startedAt.toIso8601String(),
'step_timings': instance.stepTimings,
'trigger': instance.trigger,
};
@@ -0,0 +1,259 @@
//
// 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_card_out.g.dart';
@CopyWith()
@JsonSerializable(
checked: true,
createToJson: true,
disallowUnrecognizedKeys: false,
explicitToJson: true,
)
class ScopeCardOut {
/// Returns a new [ScopeCardOut] instance.
ScopeCardOut({
required this.asOf,
required this.dayChangePct,
required this.dayChangeRub,
required this.incomeYearPct,
required this.incomeYearRub,
required this.investedRub,
required this.kind,
required this.name,
required this.pnlPct,
required this.pnlRub,
required this.scope,
required this.totalRub,
required this.xirr,
});
@JsonKey(
name: r'as_of',
required: true,
includeIfNull: true,
)
final DateTime? asOf;
/// decimal as string
@JsonKey(
name: r'day_change_pct',
required: true,
includeIfNull: true,
)
final String? dayChangePct;
/// decimal as string
@JsonKey(
name: r'day_change_rub',
required: true,
includeIfNull: true,
)
final String? dayChangeRub;
/// decimal as string
@JsonKey(
name: r'income_year_pct',
required: true,
includeIfNull: true,
)
final String? incomeYearPct;
/// decimal as string
@JsonKey(
name: r'income_year_rub',
required: true,
includeIfNull: false,
)
final String incomeYearRub;
/// decimal as string
@JsonKey(
name: r'invested_rub',
required: true,
includeIfNull: false,
)
final String investedRub;
@JsonKey(
name: r'kind',
required: true,
includeIfNull: false,
)
final String kind;
@JsonKey(
name: r'name',
required: true,
includeIfNull: false,
)
final String name;
/// decimal as string
@JsonKey(
name: r'pnl_pct',
required: true,
includeIfNull: true,
)
final String? pnlPct;
/// decimal as string
@JsonKey(
name: r'pnl_rub',
required: true,
includeIfNull: true,
)
final String? pnlRub;
@JsonKey(
name: r'scope',
required: true,
includeIfNull: false,
)
final String scope;
/// decimal as string
@JsonKey(
name: r'total_rub',
required: true,
includeIfNull: false,
)
final String totalRub;
/// decimal as string
@JsonKey(
name: r'xirr',
required: true,
includeIfNull: true,
)
final String? xirr;
@override
bool operator ==(Object other) => identical(this, other) || other is ScopeCardOut &&
other.asOf == asOf &&
other.dayChangePct == dayChangePct &&
other.dayChangeRub == dayChangeRub &&
other.incomeYearPct == incomeYearPct &&
other.incomeYearRub == incomeYearRub &&
other.investedRub == investedRub &&
other.kind == kind &&
other.name == name &&
other.pnlPct == pnlPct &&
other.pnlRub == pnlRub &&
other.scope == scope &&
other.totalRub == totalRub &&
other.xirr == xirr;
@override
int get hashCode =>
(asOf == null ? 0 : asOf.hashCode) +
(dayChangePct == null ? 0 : dayChangePct.hashCode) +
(dayChangeRub == null ? 0 : dayChangeRub.hashCode) +
(incomeYearPct == null ? 0 : incomeYearPct.hashCode) +
incomeYearRub.hashCode +
investedRub.hashCode +
kind.hashCode +
name.hashCode +
(pnlPct == null ? 0 : pnlPct.hashCode) +
(pnlRub == null ? 0 : pnlRub.hashCode) +
scope.hashCode +
totalRub.hashCode +
(xirr == null ? 0 : xirr.hashCode);
factory ScopeCardOut.fromJson(Map<String, dynamic> json) => _$ScopeCardOutFromJson(json);
Map<String, dynamic> toJson() => _$ScopeCardOutToJson(this);
@override
String toString() {
return toJson().toString();
}
}
@@ -0,0 +1,272 @@
// GENERATED CODE - DO NOT MODIFY BY HAND
part of 'scope_card_out.dart';
// **************************************************************************
// CopyWithGenerator
// **************************************************************************
abstract class _$ScopeCardOutCWProxy {
ScopeCardOut asOf(DateTime? asOf);
ScopeCardOut dayChangePct(String? dayChangePct);
ScopeCardOut dayChangeRub(String? dayChangeRub);
ScopeCardOut incomeYearPct(String? incomeYearPct);
ScopeCardOut incomeYearRub(String incomeYearRub);
ScopeCardOut investedRub(String investedRub);
ScopeCardOut kind(String kind);
ScopeCardOut name(String name);
ScopeCardOut pnlPct(String? pnlPct);
ScopeCardOut pnlRub(String? pnlRub);
ScopeCardOut scope(String scope);
ScopeCardOut totalRub(String totalRub);
ScopeCardOut 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 `ScopeCardOut(...).copyWith.fieldName(...)` to override fields one at a time with nullification support.
///
/// Usage
/// ```dart
/// ScopeCardOut(...).copyWith(id: 12, name: "My name")
/// ````
ScopeCardOut call({
DateTime? asOf,
String? dayChangePct,
String? dayChangeRub,
String? incomeYearPct,
String incomeYearRub,
String investedRub,
String kind,
String name,
String? pnlPct,
String? pnlRub,
String scope,
String totalRub,
String? xirr,
});
}
/// Proxy class for `copyWith` functionality. This is a callable class and can be used as follows: `instanceOfScopeCardOut.copyWith(...)`. Additionally contains functions for specific fields e.g. `instanceOfScopeCardOut.copyWith.fieldName(...)`
class _$ScopeCardOutCWProxyImpl implements _$ScopeCardOutCWProxy {
const _$ScopeCardOutCWProxyImpl(this._value);
final ScopeCardOut _value;
@override
ScopeCardOut asOf(DateTime? asOf) => this(asOf: asOf);
@override
ScopeCardOut dayChangePct(String? dayChangePct) =>
this(dayChangePct: dayChangePct);
@override
ScopeCardOut dayChangeRub(String? dayChangeRub) =>
this(dayChangeRub: dayChangeRub);
@override
ScopeCardOut incomeYearPct(String? incomeYearPct) =>
this(incomeYearPct: incomeYearPct);
@override
ScopeCardOut incomeYearRub(String incomeYearRub) =>
this(incomeYearRub: incomeYearRub);
@override
ScopeCardOut investedRub(String investedRub) =>
this(investedRub: investedRub);
@override
ScopeCardOut kind(String kind) => this(kind: kind);
@override
ScopeCardOut name(String name) => this(name: name);
@override
ScopeCardOut pnlPct(String? pnlPct) => this(pnlPct: pnlPct);
@override
ScopeCardOut pnlRub(String? pnlRub) => this(pnlRub: pnlRub);
@override
ScopeCardOut scope(String scope) => this(scope: scope);
@override
ScopeCardOut totalRub(String totalRub) => this(totalRub: totalRub);
@override
ScopeCardOut 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 `ScopeCardOut(...).copyWith.fieldName(...)` to override fields one at a time with nullification support.
///
/// Usage
/// ```dart
/// ScopeCardOut(...).copyWith(id: 12, name: "My name")
/// ````
ScopeCardOut call({
Object? asOf = const $CopyWithPlaceholder(),
Object? dayChangePct = const $CopyWithPlaceholder(),
Object? dayChangeRub = const $CopyWithPlaceholder(),
Object? incomeYearPct = const $CopyWithPlaceholder(),
Object? incomeYearRub = const $CopyWithPlaceholder(),
Object? investedRub = const $CopyWithPlaceholder(),
Object? kind = const $CopyWithPlaceholder(),
Object? name = const $CopyWithPlaceholder(),
Object? pnlPct = const $CopyWithPlaceholder(),
Object? pnlRub = const $CopyWithPlaceholder(),
Object? scope = const $CopyWithPlaceholder(),
Object? totalRub = const $CopyWithPlaceholder(),
Object? xirr = const $CopyWithPlaceholder(),
}) {
return ScopeCardOut(
asOf: asOf == const $CopyWithPlaceholder()
? _value.asOf
// ignore: cast_nullable_to_non_nullable
: asOf as DateTime?,
dayChangePct: dayChangePct == const $CopyWithPlaceholder()
? _value.dayChangePct
// ignore: cast_nullable_to_non_nullable
: dayChangePct as String?,
dayChangeRub: dayChangeRub == const $CopyWithPlaceholder()
? _value.dayChangeRub
// ignore: cast_nullable_to_non_nullable
: dayChangeRub as String?,
incomeYearPct: incomeYearPct == const $CopyWithPlaceholder()
? _value.incomeYearPct
// ignore: cast_nullable_to_non_nullable
: incomeYearPct as String?,
incomeYearRub: incomeYearRub == const $CopyWithPlaceholder()
? _value.incomeYearRub
// ignore: cast_nullable_to_non_nullable
: incomeYearRub as String,
investedRub: investedRub == const $CopyWithPlaceholder()
? _value.investedRub
// ignore: cast_nullable_to_non_nullable
: investedRub as String,
kind: kind == const $CopyWithPlaceholder()
? _value.kind
// ignore: cast_nullable_to_non_nullable
: kind as String,
name: name == const $CopyWithPlaceholder()
? _value.name
// ignore: cast_nullable_to_non_nullable
: name as String,
pnlPct: pnlPct == const $CopyWithPlaceholder()
? _value.pnlPct
// ignore: cast_nullable_to_non_nullable
: pnlPct as String?,
pnlRub: pnlRub == const $CopyWithPlaceholder()
? _value.pnlRub
// ignore: cast_nullable_to_non_nullable
: pnlRub as String?,
scope: scope == const $CopyWithPlaceholder()
? _value.scope
// ignore: cast_nullable_to_non_nullable
: scope as String,
totalRub: totalRub == const $CopyWithPlaceholder()
? _value.totalRub
// ignore: cast_nullable_to_non_nullable
: totalRub as String,
xirr: xirr == const $CopyWithPlaceholder()
? _value.xirr
// ignore: cast_nullable_to_non_nullable
: xirr as String?,
);
}
}
extension $ScopeCardOutCopyWith on ScopeCardOut {
/// Returns a callable class that can be used as follows: `instanceOfScopeCardOut.copyWith(...)` or like so:`instanceOfScopeCardOut.copyWith.fieldName(...)`.
// ignore: library_private_types_in_public_api
_$ScopeCardOutCWProxy get copyWith => _$ScopeCardOutCWProxyImpl(this);
}
// **************************************************************************
// JsonSerializableGenerator
// **************************************************************************
ScopeCardOut _$ScopeCardOutFromJson(Map<String, dynamic> json) =>
$checkedCreate(
'ScopeCardOut',
json,
($checkedConvert) {
$checkKeys(
json,
requiredKeys: const [
'as_of',
'day_change_pct',
'day_change_rub',
'income_year_pct',
'income_year_rub',
'invested_rub',
'kind',
'name',
'pnl_pct',
'pnl_rub',
'scope',
'total_rub',
'xirr',
],
);
final val = ScopeCardOut(
asOf: $checkedConvert(
'as_of',
(v) => v == null ? null : DateTime.parse(v as String),
),
dayChangePct: $checkedConvert('day_change_pct', (v) => v as String?),
dayChangeRub: $checkedConvert('day_change_rub', (v) => v as String?),
incomeYearPct: $checkedConvert(
'income_year_pct',
(v) => v as String?,
),
incomeYearRub: $checkedConvert('income_year_rub', (v) => v as String),
investedRub: $checkedConvert('invested_rub', (v) => v as String),
kind: $checkedConvert('kind', (v) => v as String),
name: $checkedConvert('name', (v) => v as String),
pnlPct: $checkedConvert('pnl_pct', (v) => v as String?),
pnlRub: $checkedConvert('pnl_rub', (v) => v as String?),
scope: $checkedConvert('scope', (v) => v as String),
totalRub: $checkedConvert('total_rub', (v) => v as String),
xirr: $checkedConvert('xirr', (v) => v as String?),
);
return val;
},
fieldKeyMap: const {
'asOf': 'as_of',
'dayChangePct': 'day_change_pct',
'dayChangeRub': 'day_change_rub',
'incomeYearPct': 'income_year_pct',
'incomeYearRub': 'income_year_rub',
'investedRub': 'invested_rub',
'pnlPct': 'pnl_pct',
'pnlRub': 'pnl_rub',
'totalRub': 'total_rub',
},
);
Map<String, dynamic> _$ScopeCardOutToJson(ScopeCardOut instance) =>
<String, dynamic>{
'as_of': instance.asOf?.toIso8601String(),
'day_change_pct': instance.dayChangePct,
'day_change_rub': instance.dayChangeRub,
'income_year_pct': instance.incomeYearPct,
'income_year_rub': instance.incomeYearRub,
'invested_rub': instance.investedRub,
'kind': instance.kind,
'name': instance.name,
'pnl_pct': instance.pnlPct,
'pnl_rub': instance.pnlRub,
'scope': instance.scope,
'total_rub': instance.totalRub,
'xirr': instance.xirr,
};