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

just gen-client — покрывает links, cashflow-broker, ручные цены,
imports/pending, goals/income/rebalance/tax/benchmarks.
This commit is contained in:
Dmitry
2026-09-19 10:46:09 +03:00
parent b69bb4a0c9
commit ccd06f32f7
242 changed files with 25877 additions and 3 deletions
@@ -385,6 +385,7 @@ const _$EventSourceEnumMap = {
EventSource.tinvestApi: 'tinvest_api',
EventSource.reportSber: 'report_sber',
EventSource.reportVtb: 'report_vtb',
EventSource.csv: 'csv',
EventSource.manual: 'manual',
EventSource.unknownDefaultOpenApi: 'unknown_default_open_api',
};
@@ -160,6 +160,7 @@ const _$EventSourceEnumMap = {
EventSource.tinvestApi: 'tinvest_api',
EventSource.reportSber: 'report_sber',
EventSource.reportVtb: 'report_vtb',
EventSource.csv: 'csv',
EventSource.manual: 'manual',
EventSource.unknownDefaultOpenApi: 'unknown_default_open_api',
};
@@ -0,0 +1,106 @@
//
// AUTO-GENERATED FILE, DO NOT MODIFY!
//
// ignore_for_file: unused_element
import 'package:copy_with_extension/copy_with_extension.dart';
import 'package:json_annotation/json_annotation.dart';
part 'account_suggestion.g.dart';
@CopyWith()
@JsonSerializable(
checked: true,
createToJson: true,
disallowUnrecognizedKeys: false,
explicitToJson: true,
)
class AccountSuggestion {
/// Returns a new [AccountSuggestion] instance.
AccountSuggestion({
required this.broker,
required this.id,
required this.name,
required this.sourceId,
});
@JsonKey(
name: r'broker',
required: true,
includeIfNull: true,
)
final String? broker;
@JsonKey(
name: r'id',
required: true,
includeIfNull: false,
)
final int id;
@JsonKey(
name: r'name',
required: true,
includeIfNull: false,
)
final String name;
@JsonKey(
name: r'source_id',
required: true,
includeIfNull: false,
)
final String sourceId;
@override
bool operator ==(Object other) => identical(this, other) || other is AccountSuggestion &&
other.broker == broker &&
other.id == id &&
other.name == name &&
other.sourceId == sourceId;
@override
int get hashCode =>
(broker == null ? 0 : broker.hashCode) +
id.hashCode +
name.hashCode +
sourceId.hashCode;
factory AccountSuggestion.fromJson(Map<String, dynamic> json) => _$AccountSuggestionFromJson(json);
Map<String, dynamic> toJson() => _$AccountSuggestionToJson(this);
@override
String toString() {
return toJson().toString();
}
}
@@ -0,0 +1,116 @@
// GENERATED CODE - DO NOT MODIFY BY HAND
part of 'account_suggestion.dart';
// **************************************************************************
// CopyWithGenerator
// **************************************************************************
abstract class _$AccountSuggestionCWProxy {
AccountSuggestion broker(String? broker);
AccountSuggestion id(int id);
AccountSuggestion name(String name);
AccountSuggestion sourceId(String sourceId);
/// This function **does support** nullification of nullable fields. All `null` values passed to `non-nullable` fields will be ignored. You can also use `AccountSuggestion(...).copyWith.fieldName(...)` to override fields one at a time with nullification support.
///
/// Usage
/// ```dart
/// AccountSuggestion(...).copyWith(id: 12, name: "My name")
/// ````
AccountSuggestion call({
String? broker,
int id,
String name,
String sourceId,
});
}
/// Proxy class for `copyWith` functionality. This is a callable class and can be used as follows: `instanceOfAccountSuggestion.copyWith(...)`. Additionally contains functions for specific fields e.g. `instanceOfAccountSuggestion.copyWith.fieldName(...)`
class _$AccountSuggestionCWProxyImpl implements _$AccountSuggestionCWProxy {
const _$AccountSuggestionCWProxyImpl(this._value);
final AccountSuggestion _value;
@override
AccountSuggestion broker(String? broker) => this(broker: broker);
@override
AccountSuggestion id(int id) => this(id: id);
@override
AccountSuggestion name(String name) => this(name: name);
@override
AccountSuggestion sourceId(String sourceId) => this(sourceId: sourceId);
@override
/// This function **does support** nullification of nullable fields. All `null` values passed to `non-nullable` fields will be ignored. You can also use `AccountSuggestion(...).copyWith.fieldName(...)` to override fields one at a time with nullification support.
///
/// Usage
/// ```dart
/// AccountSuggestion(...).copyWith(id: 12, name: "My name")
/// ````
AccountSuggestion call({
Object? broker = const $CopyWithPlaceholder(),
Object? id = const $CopyWithPlaceholder(),
Object? name = const $CopyWithPlaceholder(),
Object? sourceId = const $CopyWithPlaceholder(),
}) {
return AccountSuggestion(
broker: broker == const $CopyWithPlaceholder()
? _value.broker
// ignore: cast_nullable_to_non_nullable
: broker as String?,
id: id == const $CopyWithPlaceholder()
? _value.id
// ignore: cast_nullable_to_non_nullable
: id as int,
name: name == const $CopyWithPlaceholder()
? _value.name
// ignore: cast_nullable_to_non_nullable
: name as String,
sourceId: sourceId == const $CopyWithPlaceholder()
? _value.sourceId
// ignore: cast_nullable_to_non_nullable
: sourceId as String,
);
}
}
extension $AccountSuggestionCopyWith on AccountSuggestion {
/// Returns a callable class that can be used as follows: `instanceOfAccountSuggestion.copyWith(...)` or like so:`instanceOfAccountSuggestion.copyWith.fieldName(...)`.
// ignore: library_private_types_in_public_api
_$AccountSuggestionCWProxy get copyWith =>
_$AccountSuggestionCWProxyImpl(this);
}
// **************************************************************************
// JsonSerializableGenerator
// **************************************************************************
AccountSuggestion _$AccountSuggestionFromJson(Map<String, dynamic> json) =>
$checkedCreate('AccountSuggestion', json, ($checkedConvert) {
$checkKeys(
json,
requiredKeys: const ['broker', 'id', 'name', 'source_id'],
);
final val = AccountSuggestion(
broker: $checkedConvert('broker', (v) => v as String?),
id: $checkedConvert('id', (v) => (v as num).toInt()),
name: $checkedConvert('name', (v) => v as String),
sourceId: $checkedConvert('source_id', (v) => v as String),
);
return val;
}, fieldKeyMap: const {'sourceId': 'source_id'});
Map<String, dynamic> _$AccountSuggestionToJson(AccountSuggestion instance) =>
<String, dynamic>{
'broker': instance.broker,
'id': instance.id,
'name': instance.name,
'source_id': instance.sourceId,
};
@@ -0,0 +1,59 @@
//
// AUTO-GENERATED FILE, DO NOT MODIFY!
//
// ignore_for_file: unused_element
import 'package:fintracker_api/src/model/benchmark_comparison_out.dart';
import 'package:copy_with_extension/copy_with_extension.dart';
import 'package:json_annotation/json_annotation.dart';
part 'benchmark_comparison.g.dart';
@CopyWith()
@JsonSerializable(
checked: true,
createToJson: true,
disallowUnrecognizedKeys: false,
explicitToJson: true,
)
class BenchmarkComparison {
/// Returns a new [BenchmarkComparison] instance.
BenchmarkComparison({
required this.rows,
});
@JsonKey(
name: r'rows',
required: true,
includeIfNull: false,
)
final List<BenchmarkComparisonOut> rows;
@override
bool operator ==(Object other) => identical(this, other) || other is BenchmarkComparison &&
other.rows == rows;
@override
int get hashCode =>
rows.hashCode;
factory BenchmarkComparison.fromJson(Map<String, dynamic> json) => _$BenchmarkComparisonFromJson(json);
Map<String, dynamic> toJson() => _$BenchmarkComparisonToJson(this);
@override
String toString() {
return toJson().toString();
}
}
@@ -0,0 +1,78 @@
// GENERATED CODE - DO NOT MODIFY BY HAND
part of 'benchmark_comparison.dart';
// **************************************************************************
// CopyWithGenerator
// **************************************************************************
abstract class _$BenchmarkComparisonCWProxy {
BenchmarkComparison rows(List<BenchmarkComparisonOut> rows);
/// This function **does support** nullification of nullable fields. All `null` values passed to `non-nullable` fields will be ignored. You can also use `BenchmarkComparison(...).copyWith.fieldName(...)` to override fields one at a time with nullification support.
///
/// Usage
/// ```dart
/// BenchmarkComparison(...).copyWith(id: 12, name: "My name")
/// ````
BenchmarkComparison call({List<BenchmarkComparisonOut> rows});
}
/// Proxy class for `copyWith` functionality. This is a callable class and can be used as follows: `instanceOfBenchmarkComparison.copyWith(...)`. Additionally contains functions for specific fields e.g. `instanceOfBenchmarkComparison.copyWith.fieldName(...)`
class _$BenchmarkComparisonCWProxyImpl implements _$BenchmarkComparisonCWProxy {
const _$BenchmarkComparisonCWProxyImpl(this._value);
final BenchmarkComparison _value;
@override
BenchmarkComparison rows(List<BenchmarkComparisonOut> rows) =>
this(rows: rows);
@override
/// This function **does support** nullification of nullable fields. All `null` values passed to `non-nullable` fields will be ignored. You can also use `BenchmarkComparison(...).copyWith.fieldName(...)` to override fields one at a time with nullification support.
///
/// Usage
/// ```dart
/// BenchmarkComparison(...).copyWith(id: 12, name: "My name")
/// ````
BenchmarkComparison call({Object? rows = const $CopyWithPlaceholder()}) {
return BenchmarkComparison(
rows: rows == const $CopyWithPlaceholder()
? _value.rows
// ignore: cast_nullable_to_non_nullable
: rows as List<BenchmarkComparisonOut>,
);
}
}
extension $BenchmarkComparisonCopyWith on BenchmarkComparison {
/// Returns a callable class that can be used as follows: `instanceOfBenchmarkComparison.copyWith(...)` or like so:`instanceOfBenchmarkComparison.copyWith.fieldName(...)`.
// ignore: library_private_types_in_public_api
_$BenchmarkComparisonCWProxy get copyWith =>
_$BenchmarkComparisonCWProxyImpl(this);
}
// **************************************************************************
// JsonSerializableGenerator
// **************************************************************************
BenchmarkComparison _$BenchmarkComparisonFromJson(Map<String, dynamic> json) =>
$checkedCreate('BenchmarkComparison', json, ($checkedConvert) {
$checkKeys(json, requiredKeys: const ['rows']);
final val = BenchmarkComparison(
rows: $checkedConvert(
'rows',
(v) => (v as List<dynamic>)
.map(
(e) =>
BenchmarkComparisonOut.fromJson(e as Map<String, dynamic>),
)
.toList(),
),
);
return val;
});
Map<String, dynamic> _$BenchmarkComparisonToJson(
BenchmarkComparison instance,
) => <String, dynamic>{'rows': instance.rows.map((e) => e.toJson()).toList()};
@@ -0,0 +1,157 @@
//
// AUTO-GENERATED FILE, DO NOT MODIFY!
//
// ignore_for_file: unused_element
import 'package:fintracker_api/src/model/benchmark_return_out.dart';
import 'package:copy_with_extension/copy_with_extension.dart';
import 'package:json_annotation/json_annotation.dart';
part 'benchmark_comparison_out.g.dart';
@CopyWith()
@JsonSerializable(
checked: true,
createToJson: true,
disallowUnrecognizedKeys: false,
explicitToJson: true,
)
class BenchmarkComparisonOut {
/// Returns a new [BenchmarkComparisonOut] instance.
BenchmarkComparisonOut({
required this.benchmarks,
required this.dateFrom,
required this.dateTo,
required this.period,
required this.portfolioDaysSkipped,
required this.portfolioTwr,
required this.portfolioTwrAnnualized,
});
@JsonKey(
name: r'benchmarks',
required: true,
includeIfNull: false,
)
final List<BenchmarkReturnOut> benchmarks;
@JsonKey(
name: r'date_from',
required: true,
includeIfNull: false,
)
final DateTime dateFrom;
@JsonKey(
name: r'date_to',
required: true,
includeIfNull: false,
)
final DateTime dateTo;
@JsonKey(
name: r'period',
required: true,
includeIfNull: false,
)
final String period;
@JsonKey(
name: r'portfolio_days_skipped',
required: true,
includeIfNull: false,
)
final int portfolioDaysSkipped;
/// decimal as string
@JsonKey(
name: r'portfolio_twr',
required: true,
includeIfNull: true,
)
final String? portfolioTwr;
/// decimal as string
@JsonKey(
name: r'portfolio_twr_annualized',
required: true,
includeIfNull: true,
)
final String? portfolioTwrAnnualized;
@override
bool operator ==(Object other) => identical(this, other) || other is BenchmarkComparisonOut &&
other.benchmarks == benchmarks &&
other.dateFrom == dateFrom &&
other.dateTo == dateTo &&
other.period == period &&
other.portfolioDaysSkipped == portfolioDaysSkipped &&
other.portfolioTwr == portfolioTwr &&
other.portfolioTwrAnnualized == portfolioTwrAnnualized;
@override
int get hashCode =>
benchmarks.hashCode +
dateFrom.hashCode +
dateTo.hashCode +
period.hashCode +
portfolioDaysSkipped.hashCode +
(portfolioTwr == null ? 0 : portfolioTwr.hashCode) +
(portfolioTwrAnnualized == null ? 0 : portfolioTwrAnnualized.hashCode);
factory BenchmarkComparisonOut.fromJson(Map<String, dynamic> json) => _$BenchmarkComparisonOutFromJson(json);
Map<String, dynamic> toJson() => _$BenchmarkComparisonOutToJson(this);
@override
String toString() {
return toJson().toString();
}
}
@@ -0,0 +1,198 @@
// GENERATED CODE - DO NOT MODIFY BY HAND
part of 'benchmark_comparison_out.dart';
// **************************************************************************
// CopyWithGenerator
// **************************************************************************
abstract class _$BenchmarkComparisonOutCWProxy {
BenchmarkComparisonOut benchmarks(List<BenchmarkReturnOut> benchmarks);
BenchmarkComparisonOut dateFrom(DateTime dateFrom);
BenchmarkComparisonOut dateTo(DateTime dateTo);
BenchmarkComparisonOut period(String period);
BenchmarkComparisonOut portfolioDaysSkipped(int portfolioDaysSkipped);
BenchmarkComparisonOut portfolioTwr(String? portfolioTwr);
BenchmarkComparisonOut portfolioTwrAnnualized(String? portfolioTwrAnnualized);
/// This function **does support** nullification of nullable fields. All `null` values passed to `non-nullable` fields will be ignored. You can also use `BenchmarkComparisonOut(...).copyWith.fieldName(...)` to override fields one at a time with nullification support.
///
/// Usage
/// ```dart
/// BenchmarkComparisonOut(...).copyWith(id: 12, name: "My name")
/// ````
BenchmarkComparisonOut call({
List<BenchmarkReturnOut> benchmarks,
DateTime dateFrom,
DateTime dateTo,
String period,
int portfolioDaysSkipped,
String? portfolioTwr,
String? portfolioTwrAnnualized,
});
}
/// Proxy class for `copyWith` functionality. This is a callable class and can be used as follows: `instanceOfBenchmarkComparisonOut.copyWith(...)`. Additionally contains functions for specific fields e.g. `instanceOfBenchmarkComparisonOut.copyWith.fieldName(...)`
class _$BenchmarkComparisonOutCWProxyImpl
implements _$BenchmarkComparisonOutCWProxy {
const _$BenchmarkComparisonOutCWProxyImpl(this._value);
final BenchmarkComparisonOut _value;
@override
BenchmarkComparisonOut benchmarks(List<BenchmarkReturnOut> benchmarks) =>
this(benchmarks: benchmarks);
@override
BenchmarkComparisonOut dateFrom(DateTime dateFrom) =>
this(dateFrom: dateFrom);
@override
BenchmarkComparisonOut dateTo(DateTime dateTo) => this(dateTo: dateTo);
@override
BenchmarkComparisonOut period(String period) => this(period: period);
@override
BenchmarkComparisonOut portfolioDaysSkipped(int portfolioDaysSkipped) =>
this(portfolioDaysSkipped: portfolioDaysSkipped);
@override
BenchmarkComparisonOut portfolioTwr(String? portfolioTwr) =>
this(portfolioTwr: portfolioTwr);
@override
BenchmarkComparisonOut portfolioTwrAnnualized(
String? portfolioTwrAnnualized,
) => this(portfolioTwrAnnualized: portfolioTwrAnnualized);
@override
/// This function **does support** nullification of nullable fields. All `null` values passed to `non-nullable` fields will be ignored. You can also use `BenchmarkComparisonOut(...).copyWith.fieldName(...)` to override fields one at a time with nullification support.
///
/// Usage
/// ```dart
/// BenchmarkComparisonOut(...).copyWith(id: 12, name: "My name")
/// ````
BenchmarkComparisonOut call({
Object? benchmarks = const $CopyWithPlaceholder(),
Object? dateFrom = const $CopyWithPlaceholder(),
Object? dateTo = const $CopyWithPlaceholder(),
Object? period = const $CopyWithPlaceholder(),
Object? portfolioDaysSkipped = const $CopyWithPlaceholder(),
Object? portfolioTwr = const $CopyWithPlaceholder(),
Object? portfolioTwrAnnualized = const $CopyWithPlaceholder(),
}) {
return BenchmarkComparisonOut(
benchmarks: benchmarks == const $CopyWithPlaceholder()
? _value.benchmarks
// ignore: cast_nullable_to_non_nullable
: benchmarks as List<BenchmarkReturnOut>,
dateFrom: dateFrom == const $CopyWithPlaceholder()
? _value.dateFrom
// ignore: cast_nullable_to_non_nullable
: dateFrom as DateTime,
dateTo: dateTo == const $CopyWithPlaceholder()
? _value.dateTo
// ignore: cast_nullable_to_non_nullable
: dateTo as DateTime,
period: period == const $CopyWithPlaceholder()
? _value.period
// ignore: cast_nullable_to_non_nullable
: period as String,
portfolioDaysSkipped: portfolioDaysSkipped == const $CopyWithPlaceholder()
? _value.portfolioDaysSkipped
// ignore: cast_nullable_to_non_nullable
: portfolioDaysSkipped as int,
portfolioTwr: portfolioTwr == const $CopyWithPlaceholder()
? _value.portfolioTwr
// ignore: cast_nullable_to_non_nullable
: portfolioTwr as String?,
portfolioTwrAnnualized:
portfolioTwrAnnualized == const $CopyWithPlaceholder()
? _value.portfolioTwrAnnualized
// ignore: cast_nullable_to_non_nullable
: portfolioTwrAnnualized as String?,
);
}
}
extension $BenchmarkComparisonOutCopyWith on BenchmarkComparisonOut {
/// Returns a callable class that can be used as follows: `instanceOfBenchmarkComparisonOut.copyWith(...)` or like so:`instanceOfBenchmarkComparisonOut.copyWith.fieldName(...)`.
// ignore: library_private_types_in_public_api
_$BenchmarkComparisonOutCWProxy get copyWith =>
_$BenchmarkComparisonOutCWProxyImpl(this);
}
// **************************************************************************
// JsonSerializableGenerator
// **************************************************************************
BenchmarkComparisonOut _$BenchmarkComparisonOutFromJson(
Map<String, dynamic> json,
) => $checkedCreate(
'BenchmarkComparisonOut',
json,
($checkedConvert) {
$checkKeys(
json,
requiredKeys: const [
'benchmarks',
'date_from',
'date_to',
'period',
'portfolio_days_skipped',
'portfolio_twr',
'portfolio_twr_annualized',
],
);
final val = BenchmarkComparisonOut(
benchmarks: $checkedConvert(
'benchmarks',
(v) => (v as List<dynamic>)
.map((e) => BenchmarkReturnOut.fromJson(e as Map<String, dynamic>))
.toList(),
),
dateFrom: $checkedConvert(
'date_from',
(v) => DateTime.parse(v as String),
),
dateTo: $checkedConvert('date_to', (v) => DateTime.parse(v as String)),
period: $checkedConvert('period', (v) => v as String),
portfolioDaysSkipped: $checkedConvert(
'portfolio_days_skipped',
(v) => (v as num).toInt(),
),
portfolioTwr: $checkedConvert('portfolio_twr', (v) => v as String?),
portfolioTwrAnnualized: $checkedConvert(
'portfolio_twr_annualized',
(v) => v as String?,
),
);
return val;
},
fieldKeyMap: const {
'dateFrom': 'date_from',
'dateTo': 'date_to',
'portfolioDaysSkipped': 'portfolio_days_skipped',
'portfolioTwr': 'portfolio_twr',
'portfolioTwrAnnualized': 'portfolio_twr_annualized',
},
);
Map<String, dynamic> _$BenchmarkComparisonOutToJson(
BenchmarkComparisonOut instance,
) => <String, dynamic>{
'benchmarks': instance.benchmarks.map((e) => e.toJson()).toList(),
'date_from': instance.dateFrom.toIso8601String(),
'date_to': instance.dateTo.toIso8601String(),
'period': instance.period,
'portfolio_days_skipped': instance.portfolioDaysSkipped,
'portfolio_twr': instance.portfolioTwr,
'portfolio_twr_annualized': instance.portfolioTwrAnnualized,
};
@@ -0,0 +1,170 @@
//
// AUTO-GENERATED FILE, DO NOT MODIFY!
//
// ignore_for_file: unused_element
import 'package:copy_with_extension/copy_with_extension.dart';
import 'package:json_annotation/json_annotation.dart';
part 'benchmark_create.g.dart';
@CopyWith()
@JsonSerializable(
checked: true,
createToJson: true,
disallowUnrecognizedKeys: false,
explicitToJson: true,
)
class BenchmarkCreate {
/// Returns a new [BenchmarkCreate] instance.
BenchmarkCreate({
required this.code,
this.currency = 'RUB',
this.instrumentId,
this.isActive = true,
this.isDefault = false,
required this.kind,
required this.name,
this.source_ = 'moex',
});
@JsonKey(
name: r'code',
required: true,
includeIfNull: false,
)
final String code;
@JsonKey(
defaultValue: 'RUB',
name: r'currency',
required: false,
includeIfNull: false,
)
final String? currency;
@JsonKey(
name: r'instrument_id',
required: false,
includeIfNull: false,
)
final int? instrumentId;
@JsonKey(
defaultValue: true,
name: r'is_active',
required: false,
includeIfNull: false,
)
final bool? isActive;
@JsonKey(
defaultValue: false,
name: r'is_default',
required: false,
includeIfNull: false,
)
final bool? isDefault;
@JsonKey(
name: r'kind',
required: true,
includeIfNull: false,
)
final String kind;
@JsonKey(
name: r'name',
required: true,
includeIfNull: false,
)
final String name;
@JsonKey(
defaultValue: 'moex',
name: r'source',
required: false,
includeIfNull: false,
)
final String? source_;
@override
bool operator ==(Object other) => identical(this, other) || other is BenchmarkCreate &&
other.code == code &&
other.currency == currency &&
other.instrumentId == instrumentId &&
other.isActive == isActive &&
other.isDefault == isDefault &&
other.kind == kind &&
other.name == name &&
other.source_ == source_;
@override
int get hashCode =>
code.hashCode +
currency.hashCode +
(instrumentId == null ? 0 : instrumentId.hashCode) +
isActive.hashCode +
isDefault.hashCode +
kind.hashCode +
name.hashCode +
source_.hashCode;
factory BenchmarkCreate.fromJson(Map<String, dynamic> json) => _$BenchmarkCreateFromJson(json);
Map<String, dynamic> toJson() => _$BenchmarkCreateToJson(this);
@override
String toString() {
return toJson().toString();
}
}
@@ -0,0 +1,178 @@
// GENERATED CODE - DO NOT MODIFY BY HAND
part of 'benchmark_create.dart';
// **************************************************************************
// CopyWithGenerator
// **************************************************************************
abstract class _$BenchmarkCreateCWProxy {
BenchmarkCreate code(String code);
BenchmarkCreate currency(String? currency);
BenchmarkCreate instrumentId(int? instrumentId);
BenchmarkCreate isActive(bool? isActive);
BenchmarkCreate isDefault(bool? isDefault);
BenchmarkCreate kind(String kind);
BenchmarkCreate name(String name);
BenchmarkCreate source_(String? source_);
/// This function **does support** nullification of nullable fields. All `null` values passed to `non-nullable` fields will be ignored. You can also use `BenchmarkCreate(...).copyWith.fieldName(...)` to override fields one at a time with nullification support.
///
/// Usage
/// ```dart
/// BenchmarkCreate(...).copyWith(id: 12, name: "My name")
/// ````
BenchmarkCreate call({
String code,
String? currency,
int? instrumentId,
bool? isActive,
bool? isDefault,
String kind,
String name,
String? source_,
});
}
/// Proxy class for `copyWith` functionality. This is a callable class and can be used as follows: `instanceOfBenchmarkCreate.copyWith(...)`. Additionally contains functions for specific fields e.g. `instanceOfBenchmarkCreate.copyWith.fieldName(...)`
class _$BenchmarkCreateCWProxyImpl implements _$BenchmarkCreateCWProxy {
const _$BenchmarkCreateCWProxyImpl(this._value);
final BenchmarkCreate _value;
@override
BenchmarkCreate code(String code) => this(code: code);
@override
BenchmarkCreate currency(String? currency) => this(currency: currency);
@override
BenchmarkCreate instrumentId(int? instrumentId) =>
this(instrumentId: instrumentId);
@override
BenchmarkCreate isActive(bool? isActive) => this(isActive: isActive);
@override
BenchmarkCreate isDefault(bool? isDefault) => this(isDefault: isDefault);
@override
BenchmarkCreate kind(String kind) => this(kind: kind);
@override
BenchmarkCreate name(String name) => this(name: name);
@override
BenchmarkCreate source_(String? source_) => this(source_: source_);
@override
/// This function **does support** nullification of nullable fields. All `null` values passed to `non-nullable` fields will be ignored. You can also use `BenchmarkCreate(...).copyWith.fieldName(...)` to override fields one at a time with nullification support.
///
/// Usage
/// ```dart
/// BenchmarkCreate(...).copyWith(id: 12, name: "My name")
/// ````
BenchmarkCreate call({
Object? code = const $CopyWithPlaceholder(),
Object? currency = const $CopyWithPlaceholder(),
Object? instrumentId = const $CopyWithPlaceholder(),
Object? isActive = const $CopyWithPlaceholder(),
Object? isDefault = const $CopyWithPlaceholder(),
Object? kind = const $CopyWithPlaceholder(),
Object? name = const $CopyWithPlaceholder(),
Object? source_ = const $CopyWithPlaceholder(),
}) {
return BenchmarkCreate(
code: code == const $CopyWithPlaceholder()
? _value.code
// ignore: cast_nullable_to_non_nullable
: code as String,
currency: currency == const $CopyWithPlaceholder()
? _value.currency
// ignore: cast_nullable_to_non_nullable
: currency as String?,
instrumentId: instrumentId == const $CopyWithPlaceholder()
? _value.instrumentId
// ignore: cast_nullable_to_non_nullable
: instrumentId as int?,
isActive: isActive == const $CopyWithPlaceholder()
? _value.isActive
// ignore: cast_nullable_to_non_nullable
: isActive as bool?,
isDefault: isDefault == const $CopyWithPlaceholder()
? _value.isDefault
// ignore: cast_nullable_to_non_nullable
: isDefault as bool?,
kind: kind == const $CopyWithPlaceholder()
? _value.kind
// ignore: cast_nullable_to_non_nullable
: kind as String,
name: name == const $CopyWithPlaceholder()
? _value.name
// ignore: cast_nullable_to_non_nullable
: name as String,
source_: source_ == const $CopyWithPlaceholder()
? _value.source_
// ignore: cast_nullable_to_non_nullable
: source_ as String?,
);
}
}
extension $BenchmarkCreateCopyWith on BenchmarkCreate {
/// Returns a callable class that can be used as follows: `instanceOfBenchmarkCreate.copyWith(...)` or like so:`instanceOfBenchmarkCreate.copyWith.fieldName(...)`.
// ignore: library_private_types_in_public_api
_$BenchmarkCreateCWProxy get copyWith => _$BenchmarkCreateCWProxyImpl(this);
}
// **************************************************************************
// JsonSerializableGenerator
// **************************************************************************
BenchmarkCreate _$BenchmarkCreateFromJson(Map<String, dynamic> json) =>
$checkedCreate(
'BenchmarkCreate',
json,
($checkedConvert) {
$checkKeys(json, requiredKeys: const ['code', 'kind', 'name']);
final val = BenchmarkCreate(
code: $checkedConvert('code', (v) => v as String),
currency: $checkedConvert('currency', (v) => v as String? ?? 'RUB'),
instrumentId: $checkedConvert(
'instrument_id',
(v) => (v as num?)?.toInt(),
),
isActive: $checkedConvert('is_active', (v) => v as bool? ?? true),
isDefault: $checkedConvert('is_default', (v) => v as bool? ?? false),
kind: $checkedConvert('kind', (v) => v as String),
name: $checkedConvert('name', (v) => v as String),
source_: $checkedConvert('source', (v) => v as String? ?? 'moex'),
);
return val;
},
fieldKeyMap: const {
'instrumentId': 'instrument_id',
'isActive': 'is_active',
'isDefault': 'is_default',
'source_': 'source',
},
);
Map<String, dynamic> _$BenchmarkCreateToJson(BenchmarkCreate instance) =>
<String, dynamic>{
'code': instance.code,
'currency': ?instance.currency,
'instrument_id': ?instance.instrumentId,
'is_active': ?instance.isActive,
'is_default': ?instance.isDefault,
'kind': instance.kind,
'name': instance.name,
'source': ?instance.source_,
};
@@ -0,0 +1,218 @@
//
// AUTO-GENERATED FILE, DO NOT MODIFY!
//
// ignore_for_file: unused_element
import 'package:copy_with_extension/copy_with_extension.dart';
import 'package:json_annotation/json_annotation.dart';
part 'benchmark_out.g.dart';
@CopyWith()
@JsonSerializable(
checked: true,
createToJson: true,
disallowUnrecognizedKeys: false,
explicitToJson: true,
)
class BenchmarkOut {
/// Returns a new [BenchmarkOut] instance.
BenchmarkOut({
required this.code,
required this.currency,
required this.historyFrom,
required this.historyTo,
required this.id,
required this.instrumentId,
required this.isActive,
required this.isDefault,
required this.kind,
required this.name,
required this.source_,
});
@JsonKey(
name: r'code',
required: true,
includeIfNull: false,
)
final String code;
@JsonKey(
name: r'currency',
required: true,
includeIfNull: false,
)
final String currency;
@JsonKey(
name: r'history_from',
required: true,
includeIfNull: true,
)
final DateTime? historyFrom;
@JsonKey(
name: r'history_to',
required: true,
includeIfNull: true,
)
final DateTime? historyTo;
@JsonKey(
name: r'id',
required: true,
includeIfNull: false,
)
final int id;
@JsonKey(
name: r'instrument_id',
required: true,
includeIfNull: true,
)
final int? instrumentId;
@JsonKey(
name: r'is_active',
required: true,
includeIfNull: false,
)
final bool isActive;
@JsonKey(
name: r'is_default',
required: true,
includeIfNull: false,
)
final bool isDefault;
@JsonKey(
name: r'kind',
required: true,
includeIfNull: false,
)
final String kind;
@JsonKey(
name: r'name',
required: true,
includeIfNull: false,
)
final String name;
@JsonKey(
name: r'source',
required: true,
includeIfNull: false,
)
final String source_;
@override
bool operator ==(Object other) => identical(this, other) || other is BenchmarkOut &&
other.code == code &&
other.currency == currency &&
other.historyFrom == historyFrom &&
other.historyTo == historyTo &&
other.id == id &&
other.instrumentId == instrumentId &&
other.isActive == isActive &&
other.isDefault == isDefault &&
other.kind == kind &&
other.name == name &&
other.source_ == source_;
@override
int get hashCode =>
code.hashCode +
currency.hashCode +
(historyFrom == null ? 0 : historyFrom.hashCode) +
(historyTo == null ? 0 : historyTo.hashCode) +
id.hashCode +
(instrumentId == null ? 0 : instrumentId.hashCode) +
isActive.hashCode +
isDefault.hashCode +
kind.hashCode +
name.hashCode +
source_.hashCode;
factory BenchmarkOut.fromJson(Map<String, dynamic> json) => _$BenchmarkOutFromJson(json);
Map<String, dynamic> toJson() => _$BenchmarkOutToJson(this);
@override
String toString() {
return toJson().toString();
}
}
@@ -0,0 +1,241 @@
// GENERATED CODE - DO NOT MODIFY BY HAND
part of 'benchmark_out.dart';
// **************************************************************************
// CopyWithGenerator
// **************************************************************************
abstract class _$BenchmarkOutCWProxy {
BenchmarkOut code(String code);
BenchmarkOut currency(String currency);
BenchmarkOut historyFrom(DateTime? historyFrom);
BenchmarkOut historyTo(DateTime? historyTo);
BenchmarkOut id(int id);
BenchmarkOut instrumentId(int? instrumentId);
BenchmarkOut isActive(bool isActive);
BenchmarkOut isDefault(bool isDefault);
BenchmarkOut kind(String kind);
BenchmarkOut name(String name);
BenchmarkOut source_(String source_);
/// This function **does support** nullification of nullable fields. All `null` values passed to `non-nullable` fields will be ignored. You can also use `BenchmarkOut(...).copyWith.fieldName(...)` to override fields one at a time with nullification support.
///
/// Usage
/// ```dart
/// BenchmarkOut(...).copyWith(id: 12, name: "My name")
/// ````
BenchmarkOut call({
String code,
String currency,
DateTime? historyFrom,
DateTime? historyTo,
int id,
int? instrumentId,
bool isActive,
bool isDefault,
String kind,
String name,
String source_,
});
}
/// Proxy class for `copyWith` functionality. This is a callable class and can be used as follows: `instanceOfBenchmarkOut.copyWith(...)`. Additionally contains functions for specific fields e.g. `instanceOfBenchmarkOut.copyWith.fieldName(...)`
class _$BenchmarkOutCWProxyImpl implements _$BenchmarkOutCWProxy {
const _$BenchmarkOutCWProxyImpl(this._value);
final BenchmarkOut _value;
@override
BenchmarkOut code(String code) => this(code: code);
@override
BenchmarkOut currency(String currency) => this(currency: currency);
@override
BenchmarkOut historyFrom(DateTime? historyFrom) =>
this(historyFrom: historyFrom);
@override
BenchmarkOut historyTo(DateTime? historyTo) => this(historyTo: historyTo);
@override
BenchmarkOut id(int id) => this(id: id);
@override
BenchmarkOut instrumentId(int? instrumentId) =>
this(instrumentId: instrumentId);
@override
BenchmarkOut isActive(bool isActive) => this(isActive: isActive);
@override
BenchmarkOut isDefault(bool isDefault) => this(isDefault: isDefault);
@override
BenchmarkOut kind(String kind) => this(kind: kind);
@override
BenchmarkOut name(String name) => this(name: name);
@override
BenchmarkOut source_(String source_) => this(source_: source_);
@override
/// This function **does support** nullification of nullable fields. All `null` values passed to `non-nullable` fields will be ignored. You can also use `BenchmarkOut(...).copyWith.fieldName(...)` to override fields one at a time with nullification support.
///
/// Usage
/// ```dart
/// BenchmarkOut(...).copyWith(id: 12, name: "My name")
/// ````
BenchmarkOut call({
Object? code = const $CopyWithPlaceholder(),
Object? currency = const $CopyWithPlaceholder(),
Object? historyFrom = const $CopyWithPlaceholder(),
Object? historyTo = const $CopyWithPlaceholder(),
Object? id = const $CopyWithPlaceholder(),
Object? instrumentId = const $CopyWithPlaceholder(),
Object? isActive = const $CopyWithPlaceholder(),
Object? isDefault = const $CopyWithPlaceholder(),
Object? kind = const $CopyWithPlaceholder(),
Object? name = const $CopyWithPlaceholder(),
Object? source_ = const $CopyWithPlaceholder(),
}) {
return BenchmarkOut(
code: code == const $CopyWithPlaceholder()
? _value.code
// ignore: cast_nullable_to_non_nullable
: code as String,
currency: currency == const $CopyWithPlaceholder()
? _value.currency
// ignore: cast_nullable_to_non_nullable
: currency as String,
historyFrom: historyFrom == const $CopyWithPlaceholder()
? _value.historyFrom
// ignore: cast_nullable_to_non_nullable
: historyFrom as DateTime?,
historyTo: historyTo == const $CopyWithPlaceholder()
? _value.historyTo
// ignore: cast_nullable_to_non_nullable
: historyTo as DateTime?,
id: id == const $CopyWithPlaceholder()
? _value.id
// ignore: cast_nullable_to_non_nullable
: id as int,
instrumentId: instrumentId == const $CopyWithPlaceholder()
? _value.instrumentId
// ignore: cast_nullable_to_non_nullable
: instrumentId as int?,
isActive: isActive == const $CopyWithPlaceholder()
? _value.isActive
// ignore: cast_nullable_to_non_nullable
: isActive as bool,
isDefault: isDefault == const $CopyWithPlaceholder()
? _value.isDefault
// ignore: cast_nullable_to_non_nullable
: isDefault as bool,
kind: kind == const $CopyWithPlaceholder()
? _value.kind
// ignore: cast_nullable_to_non_nullable
: kind as String,
name: name == const $CopyWithPlaceholder()
? _value.name
// ignore: cast_nullable_to_non_nullable
: name as String,
source_: source_ == const $CopyWithPlaceholder()
? _value.source_
// ignore: cast_nullable_to_non_nullable
: source_ as String,
);
}
}
extension $BenchmarkOutCopyWith on BenchmarkOut {
/// Returns a callable class that can be used as follows: `instanceOfBenchmarkOut.copyWith(...)` or like so:`instanceOfBenchmarkOut.copyWith.fieldName(...)`.
// ignore: library_private_types_in_public_api
_$BenchmarkOutCWProxy get copyWith => _$BenchmarkOutCWProxyImpl(this);
}
// **************************************************************************
// JsonSerializableGenerator
// **************************************************************************
BenchmarkOut _$BenchmarkOutFromJson(Map<String, dynamic> json) =>
$checkedCreate(
'BenchmarkOut',
json,
($checkedConvert) {
$checkKeys(
json,
requiredKeys: const [
'code',
'currency',
'history_from',
'history_to',
'id',
'instrument_id',
'is_active',
'is_default',
'kind',
'name',
'source',
],
);
final val = BenchmarkOut(
code: $checkedConvert('code', (v) => v as String),
currency: $checkedConvert('currency', (v) => v as String),
historyFrom: $checkedConvert(
'history_from',
(v) => v == null ? null : DateTime.parse(v as String),
),
historyTo: $checkedConvert(
'history_to',
(v) => v == null ? null : DateTime.parse(v as String),
),
id: $checkedConvert('id', (v) => (v as num).toInt()),
instrumentId: $checkedConvert(
'instrument_id',
(v) => (v as num?)?.toInt(),
),
isActive: $checkedConvert('is_active', (v) => v as bool),
isDefault: $checkedConvert('is_default', (v) => v as bool),
kind: $checkedConvert('kind', (v) => v as String),
name: $checkedConvert('name', (v) => v as String),
source_: $checkedConvert('source', (v) => v as String),
);
return val;
},
fieldKeyMap: const {
'historyFrom': 'history_from',
'historyTo': 'history_to',
'instrumentId': 'instrument_id',
'isActive': 'is_active',
'isDefault': 'is_default',
'source_': 'source',
},
);
Map<String, dynamic> _$BenchmarkOutToJson(BenchmarkOut instance) =>
<String, dynamic>{
'code': instance.code,
'currency': instance.currency,
'history_from': instance.historyFrom?.toIso8601String(),
'history_to': instance.historyTo?.toIso8601String(),
'id': instance.id,
'instrument_id': instance.instrumentId,
'is_active': instance.isActive,
'is_default': instance.isDefault,
'kind': instance.kind,
'name': instance.name,
'source': instance.source_,
};
@@ -0,0 +1,170 @@
//
// AUTO-GENERATED FILE, DO NOT MODIFY!
//
// ignore_for_file: unused_element
import 'package:copy_with_extension/copy_with_extension.dart';
import 'package:json_annotation/json_annotation.dart';
part 'benchmark_patch.g.dart';
@CopyWith()
@JsonSerializable(
checked: true,
createToJson: true,
disallowUnrecognizedKeys: false,
explicitToJson: true,
)
class BenchmarkPatch {
/// Returns a new [BenchmarkPatch] instance.
BenchmarkPatch({
this.code,
this.currency,
this.instrumentId,
this.isActive,
this.isDefault,
this.kind,
this.name,
this.source_,
});
@JsonKey(
name: r'code',
required: false,
includeIfNull: false,
)
final String? code;
@JsonKey(
name: r'currency',
required: false,
includeIfNull: false,
)
final String? currency;
@JsonKey(
name: r'instrument_id',
required: false,
includeIfNull: false,
)
final int? instrumentId;
@JsonKey(
name: r'is_active',
required: false,
includeIfNull: false,
)
final bool? isActive;
@JsonKey(
name: r'is_default',
required: false,
includeIfNull: false,
)
final bool? isDefault;
@JsonKey(
name: r'kind',
required: false,
includeIfNull: false,
)
final String? kind;
@JsonKey(
name: r'name',
required: false,
includeIfNull: false,
)
final String? name;
@JsonKey(
name: r'source',
required: false,
includeIfNull: false,
)
final String? source_;
@override
bool operator ==(Object other) => identical(this, other) || other is BenchmarkPatch &&
other.code == code &&
other.currency == currency &&
other.instrumentId == instrumentId &&
other.isActive == isActive &&
other.isDefault == isDefault &&
other.kind == kind &&
other.name == name &&
other.source_ == source_;
@override
int get hashCode =>
(code == null ? 0 : code.hashCode) +
(currency == null ? 0 : currency.hashCode) +
(instrumentId == null ? 0 : instrumentId.hashCode) +
(isActive == null ? 0 : isActive.hashCode) +
(isDefault == null ? 0 : isDefault.hashCode) +
(kind == null ? 0 : kind.hashCode) +
(name == null ? 0 : name.hashCode) +
(source_ == null ? 0 : source_.hashCode);
factory BenchmarkPatch.fromJson(Map<String, dynamic> json) => _$BenchmarkPatchFromJson(json);
Map<String, dynamic> toJson() => _$BenchmarkPatchToJson(this);
@override
String toString() {
return toJson().toString();
}
}
@@ -0,0 +1,177 @@
// GENERATED CODE - DO NOT MODIFY BY HAND
part of 'benchmark_patch.dart';
// **************************************************************************
// CopyWithGenerator
// **************************************************************************
abstract class _$BenchmarkPatchCWProxy {
BenchmarkPatch code(String? code);
BenchmarkPatch currency(String? currency);
BenchmarkPatch instrumentId(int? instrumentId);
BenchmarkPatch isActive(bool? isActive);
BenchmarkPatch isDefault(bool? isDefault);
BenchmarkPatch kind(String? kind);
BenchmarkPatch name(String? name);
BenchmarkPatch source_(String? source_);
/// This function **does support** nullification of nullable fields. All `null` values passed to `non-nullable` fields will be ignored. You can also use `BenchmarkPatch(...).copyWith.fieldName(...)` to override fields one at a time with nullification support.
///
/// Usage
/// ```dart
/// BenchmarkPatch(...).copyWith(id: 12, name: "My name")
/// ````
BenchmarkPatch call({
String? code,
String? currency,
int? instrumentId,
bool? isActive,
bool? isDefault,
String? kind,
String? name,
String? source_,
});
}
/// Proxy class for `copyWith` functionality. This is a callable class and can be used as follows: `instanceOfBenchmarkPatch.copyWith(...)`. Additionally contains functions for specific fields e.g. `instanceOfBenchmarkPatch.copyWith.fieldName(...)`
class _$BenchmarkPatchCWProxyImpl implements _$BenchmarkPatchCWProxy {
const _$BenchmarkPatchCWProxyImpl(this._value);
final BenchmarkPatch _value;
@override
BenchmarkPatch code(String? code) => this(code: code);
@override
BenchmarkPatch currency(String? currency) => this(currency: currency);
@override
BenchmarkPatch instrumentId(int? instrumentId) =>
this(instrumentId: instrumentId);
@override
BenchmarkPatch isActive(bool? isActive) => this(isActive: isActive);
@override
BenchmarkPatch isDefault(bool? isDefault) => this(isDefault: isDefault);
@override
BenchmarkPatch kind(String? kind) => this(kind: kind);
@override
BenchmarkPatch name(String? name) => this(name: name);
@override
BenchmarkPatch source_(String? source_) => this(source_: source_);
@override
/// This function **does support** nullification of nullable fields. All `null` values passed to `non-nullable` fields will be ignored. You can also use `BenchmarkPatch(...).copyWith.fieldName(...)` to override fields one at a time with nullification support.
///
/// Usage
/// ```dart
/// BenchmarkPatch(...).copyWith(id: 12, name: "My name")
/// ````
BenchmarkPatch call({
Object? code = const $CopyWithPlaceholder(),
Object? currency = const $CopyWithPlaceholder(),
Object? instrumentId = const $CopyWithPlaceholder(),
Object? isActive = const $CopyWithPlaceholder(),
Object? isDefault = const $CopyWithPlaceholder(),
Object? kind = const $CopyWithPlaceholder(),
Object? name = const $CopyWithPlaceholder(),
Object? source_ = const $CopyWithPlaceholder(),
}) {
return BenchmarkPatch(
code: code == const $CopyWithPlaceholder()
? _value.code
// ignore: cast_nullable_to_non_nullable
: code as String?,
currency: currency == const $CopyWithPlaceholder()
? _value.currency
// ignore: cast_nullable_to_non_nullable
: currency as String?,
instrumentId: instrumentId == const $CopyWithPlaceholder()
? _value.instrumentId
// ignore: cast_nullable_to_non_nullable
: instrumentId as int?,
isActive: isActive == const $CopyWithPlaceholder()
? _value.isActive
// ignore: cast_nullable_to_non_nullable
: isActive as bool?,
isDefault: isDefault == const $CopyWithPlaceholder()
? _value.isDefault
// ignore: cast_nullable_to_non_nullable
: isDefault as bool?,
kind: kind == const $CopyWithPlaceholder()
? _value.kind
// ignore: cast_nullable_to_non_nullable
: kind as String?,
name: name == const $CopyWithPlaceholder()
? _value.name
// ignore: cast_nullable_to_non_nullable
: name as String?,
source_: source_ == const $CopyWithPlaceholder()
? _value.source_
// ignore: cast_nullable_to_non_nullable
: source_ as String?,
);
}
}
extension $BenchmarkPatchCopyWith on BenchmarkPatch {
/// Returns a callable class that can be used as follows: `instanceOfBenchmarkPatch.copyWith(...)` or like so:`instanceOfBenchmarkPatch.copyWith.fieldName(...)`.
// ignore: library_private_types_in_public_api
_$BenchmarkPatchCWProxy get copyWith => _$BenchmarkPatchCWProxyImpl(this);
}
// **************************************************************************
// JsonSerializableGenerator
// **************************************************************************
BenchmarkPatch _$BenchmarkPatchFromJson(Map<String, dynamic> json) =>
$checkedCreate(
'BenchmarkPatch',
json,
($checkedConvert) {
final val = BenchmarkPatch(
code: $checkedConvert('code', (v) => v as String?),
currency: $checkedConvert('currency', (v) => v as String?),
instrumentId: $checkedConvert(
'instrument_id',
(v) => (v as num?)?.toInt(),
),
isActive: $checkedConvert('is_active', (v) => v as bool?),
isDefault: $checkedConvert('is_default', (v) => v as bool?),
kind: $checkedConvert('kind', (v) => v as String?),
name: $checkedConvert('name', (v) => v as String?),
source_: $checkedConvert('source', (v) => v as String?),
);
return val;
},
fieldKeyMap: const {
'instrumentId': 'instrument_id',
'isActive': 'is_active',
'isDefault': 'is_default',
'source_': 'source',
},
);
Map<String, dynamic> _$BenchmarkPatchToJson(BenchmarkPatch instance) =>
<String, dynamic>{
'code': ?instance.code,
'currency': ?instance.currency,
'instrument_id': ?instance.instrumentId,
'is_active': ?instance.isActive,
'is_default': ?instance.isDefault,
'kind': ?instance.kind,
'name': ?instance.name,
'source': ?instance.source_,
};
@@ -0,0 +1,173 @@
//
// AUTO-GENERATED FILE, DO NOT MODIFY!
//
// ignore_for_file: unused_element
import 'package:copy_with_extension/copy_with_extension.dart';
import 'package:json_annotation/json_annotation.dart';
part 'benchmark_return_out.g.dart';
@CopyWith()
@JsonSerializable(
checked: true,
createToJson: true,
disallowUnrecognizedKeys: false,
explicitToJson: true,
)
class BenchmarkReturnOut {
/// Returns a new [BenchmarkReturnOut] instance.
BenchmarkReturnOut({
required this.benchmarkId,
required this.code,
required this.daysSkipped,
required this.excess,
required this.kind,
required this.name,
required this.twr,
required this.twrAnnualized,
});
@JsonKey(
name: r'benchmark_id',
required: true,
includeIfNull: false,
)
final int benchmarkId;
@JsonKey(
name: r'code',
required: true,
includeIfNull: false,
)
final String code;
@JsonKey(
name: r'days_skipped',
required: true,
includeIfNull: false,
)
final int daysSkipped;
/// decimal as string
@JsonKey(
name: r'excess',
required: true,
includeIfNull: true,
)
final String? excess;
@JsonKey(
name: r'kind',
required: true,
includeIfNull: false,
)
final String kind;
@JsonKey(
name: r'name',
required: true,
includeIfNull: false,
)
final String name;
/// decimal as string
@JsonKey(
name: r'twr',
required: true,
includeIfNull: true,
)
final String? twr;
/// decimal as string
@JsonKey(
name: r'twr_annualized',
required: true,
includeIfNull: true,
)
final String? twrAnnualized;
@override
bool operator ==(Object other) => identical(this, other) || other is BenchmarkReturnOut &&
other.benchmarkId == benchmarkId &&
other.code == code &&
other.daysSkipped == daysSkipped &&
other.excess == excess &&
other.kind == kind &&
other.name == name &&
other.twr == twr &&
other.twrAnnualized == twrAnnualized;
@override
int get hashCode =>
benchmarkId.hashCode +
code.hashCode +
daysSkipped.hashCode +
(excess == null ? 0 : excess.hashCode) +
kind.hashCode +
name.hashCode +
(twr == null ? 0 : twr.hashCode) +
(twrAnnualized == null ? 0 : twrAnnualized.hashCode);
factory BenchmarkReturnOut.fromJson(Map<String, dynamic> json) => _$BenchmarkReturnOutFromJson(json);
Map<String, dynamic> toJson() => _$BenchmarkReturnOutToJson(this);
@override
String toString() {
return toJson().toString();
}
}
@@ -0,0 +1,190 @@
// GENERATED CODE - DO NOT MODIFY BY HAND
part of 'benchmark_return_out.dart';
// **************************************************************************
// CopyWithGenerator
// **************************************************************************
abstract class _$BenchmarkReturnOutCWProxy {
BenchmarkReturnOut benchmarkId(int benchmarkId);
BenchmarkReturnOut code(String code);
BenchmarkReturnOut daysSkipped(int daysSkipped);
BenchmarkReturnOut excess(String? excess);
BenchmarkReturnOut kind(String kind);
BenchmarkReturnOut name(String name);
BenchmarkReturnOut twr(String? twr);
BenchmarkReturnOut twrAnnualized(String? twrAnnualized);
/// This function **does support** nullification of nullable fields. All `null` values passed to `non-nullable` fields will be ignored. You can also use `BenchmarkReturnOut(...).copyWith.fieldName(...)` to override fields one at a time with nullification support.
///
/// Usage
/// ```dart
/// BenchmarkReturnOut(...).copyWith(id: 12, name: "My name")
/// ````
BenchmarkReturnOut call({
int benchmarkId,
String code,
int daysSkipped,
String? excess,
String kind,
String name,
String? twr,
String? twrAnnualized,
});
}
/// Proxy class for `copyWith` functionality. This is a callable class and can be used as follows: `instanceOfBenchmarkReturnOut.copyWith(...)`. Additionally contains functions for specific fields e.g. `instanceOfBenchmarkReturnOut.copyWith.fieldName(...)`
class _$BenchmarkReturnOutCWProxyImpl implements _$BenchmarkReturnOutCWProxy {
const _$BenchmarkReturnOutCWProxyImpl(this._value);
final BenchmarkReturnOut _value;
@override
BenchmarkReturnOut benchmarkId(int benchmarkId) =>
this(benchmarkId: benchmarkId);
@override
BenchmarkReturnOut code(String code) => this(code: code);
@override
BenchmarkReturnOut daysSkipped(int daysSkipped) =>
this(daysSkipped: daysSkipped);
@override
BenchmarkReturnOut excess(String? excess) => this(excess: excess);
@override
BenchmarkReturnOut kind(String kind) => this(kind: kind);
@override
BenchmarkReturnOut name(String name) => this(name: name);
@override
BenchmarkReturnOut twr(String? twr) => this(twr: twr);
@override
BenchmarkReturnOut twrAnnualized(String? twrAnnualized) =>
this(twrAnnualized: twrAnnualized);
@override
/// This function **does support** nullification of nullable fields. All `null` values passed to `non-nullable` fields will be ignored. You can also use `BenchmarkReturnOut(...).copyWith.fieldName(...)` to override fields one at a time with nullification support.
///
/// Usage
/// ```dart
/// BenchmarkReturnOut(...).copyWith(id: 12, name: "My name")
/// ````
BenchmarkReturnOut call({
Object? benchmarkId = const $CopyWithPlaceholder(),
Object? code = const $CopyWithPlaceholder(),
Object? daysSkipped = const $CopyWithPlaceholder(),
Object? excess = const $CopyWithPlaceholder(),
Object? kind = const $CopyWithPlaceholder(),
Object? name = const $CopyWithPlaceholder(),
Object? twr = const $CopyWithPlaceholder(),
Object? twrAnnualized = const $CopyWithPlaceholder(),
}) {
return BenchmarkReturnOut(
benchmarkId: benchmarkId == const $CopyWithPlaceholder()
? _value.benchmarkId
// ignore: cast_nullable_to_non_nullable
: benchmarkId as int,
code: code == const $CopyWithPlaceholder()
? _value.code
// ignore: cast_nullable_to_non_nullable
: code as String,
daysSkipped: daysSkipped == const $CopyWithPlaceholder()
? _value.daysSkipped
// ignore: cast_nullable_to_non_nullable
: daysSkipped as int,
excess: excess == const $CopyWithPlaceholder()
? _value.excess
// ignore: cast_nullable_to_non_nullable
: excess as String?,
kind: kind == const $CopyWithPlaceholder()
? _value.kind
// ignore: cast_nullable_to_non_nullable
: kind as String,
name: name == const $CopyWithPlaceholder()
? _value.name
// ignore: cast_nullable_to_non_nullable
: name as String,
twr: twr == const $CopyWithPlaceholder()
? _value.twr
// ignore: cast_nullable_to_non_nullable
: twr as String?,
twrAnnualized: twrAnnualized == const $CopyWithPlaceholder()
? _value.twrAnnualized
// ignore: cast_nullable_to_non_nullable
: twrAnnualized as String?,
);
}
}
extension $BenchmarkReturnOutCopyWith on BenchmarkReturnOut {
/// Returns a callable class that can be used as follows: `instanceOfBenchmarkReturnOut.copyWith(...)` or like so:`instanceOfBenchmarkReturnOut.copyWith.fieldName(...)`.
// ignore: library_private_types_in_public_api
_$BenchmarkReturnOutCWProxy get copyWith =>
_$BenchmarkReturnOutCWProxyImpl(this);
}
// **************************************************************************
// JsonSerializableGenerator
// **************************************************************************
BenchmarkReturnOut _$BenchmarkReturnOutFromJson(
Map<String, dynamic> json,
) => $checkedCreate(
'BenchmarkReturnOut',
json,
($checkedConvert) {
$checkKeys(
json,
requiredKeys: const [
'benchmark_id',
'code',
'days_skipped',
'excess',
'kind',
'name',
'twr',
'twr_annualized',
],
);
final val = BenchmarkReturnOut(
benchmarkId: $checkedConvert('benchmark_id', (v) => (v as num).toInt()),
code: $checkedConvert('code', (v) => v as String),
daysSkipped: $checkedConvert('days_skipped', (v) => (v as num).toInt()),
excess: $checkedConvert('excess', (v) => v as String?),
kind: $checkedConvert('kind', (v) => v as String),
name: $checkedConvert('name', (v) => v as String),
twr: $checkedConvert('twr', (v) => v as String?),
twrAnnualized: $checkedConvert('twr_annualized', (v) => v as String?),
);
return val;
},
fieldKeyMap: const {
'benchmarkId': 'benchmark_id',
'daysSkipped': 'days_skipped',
'twrAnnualized': 'twr_annualized',
},
);
Map<String, dynamic> _$BenchmarkReturnOutToJson(BenchmarkReturnOut instance) =>
<String, dynamic>{
'benchmark_id': instance.benchmarkId,
'code': instance.code,
'days_skipped': instance.daysSkipped,
'excess': instance.excess,
'kind': instance.kind,
'name': instance.name,
'twr': instance.twr,
'twr_annualized': instance.twrAnnualized,
};
@@ -0,0 +1,255 @@
//
// AUTO-GENERATED FILE, DO NOT MODIFY!
//
// ignore_for_file: unused_element
import 'package:copy_with_extension/copy_with_extension.dart';
import 'package:json_annotation/json_annotation.dart';
part 'calendar_entry.g.dart';
@CopyWith()
@JsonSerializable(
checked: true,
createToJson: true,
disallowUnrecognizedKeys: false,
explicitToJson: true,
)
class CalendarEntry {
/// Returns a new [CalendarEntry] instance.
CalendarEntry({
required this.amount,
required this.amountRub,
required this.basis,
required this.currency,
required this.expectedDate,
required this.instrumentId,
required this.kind,
required this.name,
required this.perUnit,
required this.qty,
required this.recordDate,
required this.taxWithheld,
required this.ticker,
});
/// decimal as string
@JsonKey(
name: r'amount',
required: true,
includeIfNull: false,
)
final String amount;
/// decimal as string
@JsonKey(
name: r'amount_rub',
required: true,
includeIfNull: true,
)
final String? amountRub;
@JsonKey(
name: r'basis',
required: true,
includeIfNull: false,
)
final String basis;
@JsonKey(
name: r'currency',
required: true,
includeIfNull: false,
)
final String currency;
@JsonKey(
name: r'expected_date',
required: true,
includeIfNull: false,
)
final DateTime expectedDate;
@JsonKey(
name: r'instrument_id',
required: true,
includeIfNull: false,
)
final int instrumentId;
@JsonKey(
name: r'kind',
required: true,
includeIfNull: false,
)
final String kind;
@JsonKey(
name: r'name',
required: true,
includeIfNull: false,
)
final String name;
/// decimal as string
@JsonKey(
name: r'per_unit',
required: true,
includeIfNull: true,
)
final String? perUnit;
/// decimal as string
@JsonKey(
name: r'qty',
required: true,
includeIfNull: false,
)
final String qty;
@JsonKey(
name: r'record_date',
required: true,
includeIfNull: true,
)
final DateTime? recordDate;
/// decimal as string
@JsonKey(
name: r'tax_withheld',
required: true,
includeIfNull: true,
)
final String? taxWithheld;
@JsonKey(
name: r'ticker',
required: true,
includeIfNull: true,
)
final String? ticker;
@override
bool operator ==(Object other) => identical(this, other) || other is CalendarEntry &&
other.amount == amount &&
other.amountRub == amountRub &&
other.basis == basis &&
other.currency == currency &&
other.expectedDate == expectedDate &&
other.instrumentId == instrumentId &&
other.kind == kind &&
other.name == name &&
other.perUnit == perUnit &&
other.qty == qty &&
other.recordDate == recordDate &&
other.taxWithheld == taxWithheld &&
other.ticker == ticker;
@override
int get hashCode =>
amount.hashCode +
(amountRub == null ? 0 : amountRub.hashCode) +
basis.hashCode +
currency.hashCode +
expectedDate.hashCode +
instrumentId.hashCode +
kind.hashCode +
name.hashCode +
(perUnit == null ? 0 : perUnit.hashCode) +
qty.hashCode +
(recordDate == null ? 0 : recordDate.hashCode) +
(taxWithheld == null ? 0 : taxWithheld.hashCode) +
(ticker == null ? 0 : ticker.hashCode);
factory CalendarEntry.fromJson(Map<String, dynamic> json) => _$CalendarEntryFromJson(json);
Map<String, dynamic> toJson() => _$CalendarEntryToJson(this);
@override
String toString() {
return toJson().toString();
}
}
@@ -0,0 +1,271 @@
// GENERATED CODE - DO NOT MODIFY BY HAND
part of 'calendar_entry.dart';
// **************************************************************************
// CopyWithGenerator
// **************************************************************************
abstract class _$CalendarEntryCWProxy {
CalendarEntry amount(String amount);
CalendarEntry amountRub(String? amountRub);
CalendarEntry basis(String basis);
CalendarEntry currency(String currency);
CalendarEntry expectedDate(DateTime expectedDate);
CalendarEntry instrumentId(int instrumentId);
CalendarEntry kind(String kind);
CalendarEntry name(String name);
CalendarEntry perUnit(String? perUnit);
CalendarEntry qty(String qty);
CalendarEntry recordDate(DateTime? recordDate);
CalendarEntry taxWithheld(String? taxWithheld);
CalendarEntry ticker(String? ticker);
/// This function **does support** nullification of nullable fields. All `null` values passed to `non-nullable` fields will be ignored. You can also use `CalendarEntry(...).copyWith.fieldName(...)` to override fields one at a time with nullification support.
///
/// Usage
/// ```dart
/// CalendarEntry(...).copyWith(id: 12, name: "My name")
/// ````
CalendarEntry call({
String amount,
String? amountRub,
String basis,
String currency,
DateTime expectedDate,
int instrumentId,
String kind,
String name,
String? perUnit,
String qty,
DateTime? recordDate,
String? taxWithheld,
String? ticker,
});
}
/// Proxy class for `copyWith` functionality. This is a callable class and can be used as follows: `instanceOfCalendarEntry.copyWith(...)`. Additionally contains functions for specific fields e.g. `instanceOfCalendarEntry.copyWith.fieldName(...)`
class _$CalendarEntryCWProxyImpl implements _$CalendarEntryCWProxy {
const _$CalendarEntryCWProxyImpl(this._value);
final CalendarEntry _value;
@override
CalendarEntry amount(String amount) => this(amount: amount);
@override
CalendarEntry amountRub(String? amountRub) => this(amountRub: amountRub);
@override
CalendarEntry basis(String basis) => this(basis: basis);
@override
CalendarEntry currency(String currency) => this(currency: currency);
@override
CalendarEntry expectedDate(DateTime expectedDate) =>
this(expectedDate: expectedDate);
@override
CalendarEntry instrumentId(int instrumentId) =>
this(instrumentId: instrumentId);
@override
CalendarEntry kind(String kind) => this(kind: kind);
@override
CalendarEntry name(String name) => this(name: name);
@override
CalendarEntry perUnit(String? perUnit) => this(perUnit: perUnit);
@override
CalendarEntry qty(String qty) => this(qty: qty);
@override
CalendarEntry recordDate(DateTime? recordDate) =>
this(recordDate: recordDate);
@override
CalendarEntry taxWithheld(String? taxWithheld) =>
this(taxWithheld: taxWithheld);
@override
CalendarEntry ticker(String? ticker) => this(ticker: ticker);
@override
/// This function **does support** nullification of nullable fields. All `null` values passed to `non-nullable` fields will be ignored. You can also use `CalendarEntry(...).copyWith.fieldName(...)` to override fields one at a time with nullification support.
///
/// Usage
/// ```dart
/// CalendarEntry(...).copyWith(id: 12, name: "My name")
/// ````
CalendarEntry call({
Object? amount = const $CopyWithPlaceholder(),
Object? amountRub = const $CopyWithPlaceholder(),
Object? basis = const $CopyWithPlaceholder(),
Object? currency = const $CopyWithPlaceholder(),
Object? expectedDate = const $CopyWithPlaceholder(),
Object? instrumentId = const $CopyWithPlaceholder(),
Object? kind = const $CopyWithPlaceholder(),
Object? name = const $CopyWithPlaceholder(),
Object? perUnit = const $CopyWithPlaceholder(),
Object? qty = const $CopyWithPlaceholder(),
Object? recordDate = const $CopyWithPlaceholder(),
Object? taxWithheld = const $CopyWithPlaceholder(),
Object? ticker = const $CopyWithPlaceholder(),
}) {
return CalendarEntry(
amount: amount == const $CopyWithPlaceholder()
? _value.amount
// ignore: cast_nullable_to_non_nullable
: amount as String,
amountRub: amountRub == const $CopyWithPlaceholder()
? _value.amountRub
// ignore: cast_nullable_to_non_nullable
: amountRub as String?,
basis: basis == const $CopyWithPlaceholder()
? _value.basis
// ignore: cast_nullable_to_non_nullable
: basis as String,
currency: currency == const $CopyWithPlaceholder()
? _value.currency
// ignore: cast_nullable_to_non_nullable
: currency as String,
expectedDate: expectedDate == const $CopyWithPlaceholder()
? _value.expectedDate
// ignore: cast_nullable_to_non_nullable
: expectedDate as DateTime,
instrumentId: instrumentId == const $CopyWithPlaceholder()
? _value.instrumentId
// ignore: cast_nullable_to_non_nullable
: instrumentId as int,
kind: kind == const $CopyWithPlaceholder()
? _value.kind
// ignore: cast_nullable_to_non_nullable
: kind as String,
name: name == const $CopyWithPlaceholder()
? _value.name
// ignore: cast_nullable_to_non_nullable
: name as String,
perUnit: perUnit == const $CopyWithPlaceholder()
? _value.perUnit
// ignore: cast_nullable_to_non_nullable
: perUnit as String?,
qty: qty == const $CopyWithPlaceholder()
? _value.qty
// ignore: cast_nullable_to_non_nullable
: qty as String,
recordDate: recordDate == const $CopyWithPlaceholder()
? _value.recordDate
// ignore: cast_nullable_to_non_nullable
: recordDate as DateTime?,
taxWithheld: taxWithheld == const $CopyWithPlaceholder()
? _value.taxWithheld
// ignore: cast_nullable_to_non_nullable
: taxWithheld as String?,
ticker: ticker == const $CopyWithPlaceholder()
? _value.ticker
// ignore: cast_nullable_to_non_nullable
: ticker as String?,
);
}
}
extension $CalendarEntryCopyWith on CalendarEntry {
/// Returns a callable class that can be used as follows: `instanceOfCalendarEntry.copyWith(...)` or like so:`instanceOfCalendarEntry.copyWith.fieldName(...)`.
// ignore: library_private_types_in_public_api
_$CalendarEntryCWProxy get copyWith => _$CalendarEntryCWProxyImpl(this);
}
// **************************************************************************
// JsonSerializableGenerator
// **************************************************************************
CalendarEntry _$CalendarEntryFromJson(Map<String, dynamic> json) =>
$checkedCreate(
'CalendarEntry',
json,
($checkedConvert) {
$checkKeys(
json,
requiredKeys: const [
'amount',
'amount_rub',
'basis',
'currency',
'expected_date',
'instrument_id',
'kind',
'name',
'per_unit',
'qty',
'record_date',
'tax_withheld',
'ticker',
],
);
final val = CalendarEntry(
amount: $checkedConvert('amount', (v) => v as String),
amountRub: $checkedConvert('amount_rub', (v) => v as String?),
basis: $checkedConvert('basis', (v) => v as String),
currency: $checkedConvert('currency', (v) => v as String),
expectedDate: $checkedConvert(
'expected_date',
(v) => DateTime.parse(v as String),
),
instrumentId: $checkedConvert(
'instrument_id',
(v) => (v as num).toInt(),
),
kind: $checkedConvert('kind', (v) => v as String),
name: $checkedConvert('name', (v) => v as String),
perUnit: $checkedConvert('per_unit', (v) => v as String?),
qty: $checkedConvert('qty', (v) => v as String),
recordDate: $checkedConvert(
'record_date',
(v) => v == null ? null : DateTime.parse(v as String),
),
taxWithheld: $checkedConvert('tax_withheld', (v) => v as String?),
ticker: $checkedConvert('ticker', (v) => v as String?),
);
return val;
},
fieldKeyMap: const {
'amountRub': 'amount_rub',
'expectedDate': 'expected_date',
'instrumentId': 'instrument_id',
'perUnit': 'per_unit',
'recordDate': 'record_date',
'taxWithheld': 'tax_withheld',
},
);
Map<String, dynamic> _$CalendarEntryToJson(CalendarEntry instance) =>
<String, dynamic>{
'amount': instance.amount,
'amount_rub': instance.amountRub,
'basis': instance.basis,
'currency': instance.currency,
'expected_date': instance.expectedDate.toIso8601String(),
'instrument_id': instance.instrumentId,
'kind': instance.kind,
'name': instance.name,
'per_unit': instance.perUnit,
'qty': instance.qty,
'record_date': instance.recordDate?.toIso8601String(),
'tax_withheld': instance.taxWithheld,
'ticker': instance.ticker,
};
@@ -0,0 +1,124 @@
//
// AUTO-GENERATED FILE, DO NOT MODIFY!
//
// ignore_for_file: unused_element
import 'package:fintracker_api/src/model/calendar_entry.dart';
import 'package:copy_with_extension/copy_with_extension.dart';
import 'package:json_annotation/json_annotation.dart';
part 'calendar_out.g.dart';
@CopyWith()
@JsonSerializable(
checked: true,
createToJson: true,
disallowUnrecognizedKeys: false,
explicitToJson: true,
)
class CalendarOut {
/// Returns a new [CalendarOut] instance.
CalendarOut({
required this.asOf,
required this.byBasis,
required this.currency,
required this.entries,
required this.totalExpectedRub,
});
@JsonKey(
name: r'as_of',
required: true,
includeIfNull: false,
)
final DateTime asOf;
@JsonKey(
name: r'by_basis',
required: true,
includeIfNull: false,
)
final Map<String, String> byBasis;
@JsonKey(
name: r'currency',
required: true,
includeIfNull: false,
)
final String currency;
@JsonKey(
name: r'entries',
required: true,
includeIfNull: false,
)
final List<CalendarEntry> entries;
/// decimal as string
@JsonKey(
name: r'total_expected_rub',
required: true,
includeIfNull: false,
)
final String totalExpectedRub;
@override
bool operator ==(Object other) => identical(this, other) || other is CalendarOut &&
other.asOf == asOf &&
other.byBasis == byBasis &&
other.currency == currency &&
other.entries == entries &&
other.totalExpectedRub == totalExpectedRub;
@override
int get hashCode =>
asOf.hashCode +
byBasis.hashCode +
currency.hashCode +
entries.hashCode +
totalExpectedRub.hashCode;
factory CalendarOut.fromJson(Map<String, dynamic> json) => _$CalendarOutFromJson(json);
Map<String, dynamic> toJson() => _$CalendarOutToJson(this);
@override
String toString() {
return toJson().toString();
}
}
@@ -0,0 +1,154 @@
// GENERATED CODE - DO NOT MODIFY BY HAND
part of 'calendar_out.dart';
// **************************************************************************
// CopyWithGenerator
// **************************************************************************
abstract class _$CalendarOutCWProxy {
CalendarOut asOf(DateTime asOf);
CalendarOut byBasis(Map<String, String> byBasis);
CalendarOut currency(String currency);
CalendarOut entries(List<CalendarEntry> entries);
CalendarOut totalExpectedRub(String totalExpectedRub);
/// This function **does support** nullification of nullable fields. All `null` values passed to `non-nullable` fields will be ignored. You can also use `CalendarOut(...).copyWith.fieldName(...)` to override fields one at a time with nullification support.
///
/// Usage
/// ```dart
/// CalendarOut(...).copyWith(id: 12, name: "My name")
/// ````
CalendarOut call({
DateTime asOf,
Map<String, String> byBasis,
String currency,
List<CalendarEntry> entries,
String totalExpectedRub,
});
}
/// Proxy class for `copyWith` functionality. This is a callable class and can be used as follows: `instanceOfCalendarOut.copyWith(...)`. Additionally contains functions for specific fields e.g. `instanceOfCalendarOut.copyWith.fieldName(...)`
class _$CalendarOutCWProxyImpl implements _$CalendarOutCWProxy {
const _$CalendarOutCWProxyImpl(this._value);
final CalendarOut _value;
@override
CalendarOut asOf(DateTime asOf) => this(asOf: asOf);
@override
CalendarOut byBasis(Map<String, String> byBasis) => this(byBasis: byBasis);
@override
CalendarOut currency(String currency) => this(currency: currency);
@override
CalendarOut entries(List<CalendarEntry> entries) => this(entries: entries);
@override
CalendarOut totalExpectedRub(String totalExpectedRub) =>
this(totalExpectedRub: totalExpectedRub);
@override
/// This function **does support** nullification of nullable fields. All `null` values passed to `non-nullable` fields will be ignored. You can also use `CalendarOut(...).copyWith.fieldName(...)` to override fields one at a time with nullification support.
///
/// Usage
/// ```dart
/// CalendarOut(...).copyWith(id: 12, name: "My name")
/// ````
CalendarOut call({
Object? asOf = const $CopyWithPlaceholder(),
Object? byBasis = const $CopyWithPlaceholder(),
Object? currency = const $CopyWithPlaceholder(),
Object? entries = const $CopyWithPlaceholder(),
Object? totalExpectedRub = const $CopyWithPlaceholder(),
}) {
return CalendarOut(
asOf: asOf == const $CopyWithPlaceholder()
? _value.asOf
// ignore: cast_nullable_to_non_nullable
: asOf as DateTime,
byBasis: byBasis == const $CopyWithPlaceholder()
? _value.byBasis
// ignore: cast_nullable_to_non_nullable
: byBasis as Map<String, String>,
currency: currency == const $CopyWithPlaceholder()
? _value.currency
// ignore: cast_nullable_to_non_nullable
: currency as String,
entries: entries == const $CopyWithPlaceholder()
? _value.entries
// ignore: cast_nullable_to_non_nullable
: entries as List<CalendarEntry>,
totalExpectedRub: totalExpectedRub == const $CopyWithPlaceholder()
? _value.totalExpectedRub
// ignore: cast_nullable_to_non_nullable
: totalExpectedRub as String,
);
}
}
extension $CalendarOutCopyWith on CalendarOut {
/// Returns a callable class that can be used as follows: `instanceOfCalendarOut.copyWith(...)` or like so:`instanceOfCalendarOut.copyWith.fieldName(...)`.
// ignore: library_private_types_in_public_api
_$CalendarOutCWProxy get copyWith => _$CalendarOutCWProxyImpl(this);
}
// **************************************************************************
// JsonSerializableGenerator
// **************************************************************************
CalendarOut _$CalendarOutFromJson(Map<String, dynamic> json) => $checkedCreate(
'CalendarOut',
json,
($checkedConvert) {
$checkKeys(
json,
requiredKeys: const [
'as_of',
'by_basis',
'currency',
'entries',
'total_expected_rub',
],
);
final val = CalendarOut(
asOf: $checkedConvert('as_of', (v) => DateTime.parse(v as String)),
byBasis: $checkedConvert(
'by_basis',
(v) => Map<String, String>.from(v as Map),
),
currency: $checkedConvert('currency', (v) => v as String),
entries: $checkedConvert(
'entries',
(v) => (v as List<dynamic>)
.map((e) => CalendarEntry.fromJson(e as Map<String, dynamic>))
.toList(),
),
totalExpectedRub: $checkedConvert(
'total_expected_rub',
(v) => v as String,
),
);
return val;
},
fieldKeyMap: const {
'asOf': 'as_of',
'byBasis': 'by_basis',
'totalExpectedRub': 'total_expected_rub',
},
);
Map<String, dynamic> _$CalendarOutToJson(CalendarOut instance) =>
<String, dynamic>{
'as_of': instance.asOf.toIso8601String(),
'by_basis': instance.byBasis,
'currency': instance.currency,
'entries': instance.entries.map((e) => e.toJson()).toList(),
'total_expected_rub': instance.totalExpectedRub,
};
@@ -0,0 +1,42 @@
//
// AUTO-GENERATED FILE, DO NOT MODIFY!
//
// ignore_for_file: unused_element
import 'package:copy_with_extension/copy_with_extension.dart';
import 'package:json_annotation/json_annotation.dart';
part 'cash_available.g.dart';
@CopyWith()
@JsonSerializable(
checked: true,
createToJson: true,
disallowUnrecognizedKeys: false,
explicitToJson: true,
)
class CashAvailable {
/// Returns a new [CashAvailable] instance.
CashAvailable({
});
@override
bool operator ==(Object other) => identical(this, other) || other is CashAvailable &&
@override
int get hashCode =>
factory CashAvailable.fromJson(Map<String, dynamic> json) => _$CashAvailableFromJson(json);
Map<String, dynamic> toJson() => _$CashAvailableToJson(this);
@override
String toString() {
return toJson().toString();
}
}
@@ -0,0 +1,125 @@
//
// AUTO-GENERATED FILE, DO NOT MODIFY!
//
// ignore_for_file: unused_element
import 'package:copy_with_extension/copy_with_extension.dart';
import 'package:json_annotation/json_annotation.dart';
part 'cash_flow_broker_month.g.dart';
@CopyWith()
@JsonSerializable(
checked: true,
createToJson: true,
disallowUnrecognizedKeys: false,
explicitToJson: true,
)
class CashFlowBrokerMonth {
/// Returns a new [CashFlowBrokerMonth] instance.
CashFlowBrokerMonth({
required this.depositsRub,
required this.eventCount,
required this.month,
required this.netRub,
required this.withdrawalsRub,
});
/// decimal as string
@JsonKey(
name: r'deposits_rub',
required: true,
includeIfNull: false,
)
final String depositsRub;
@JsonKey(
name: r'event_count',
required: true,
includeIfNull: false,
)
final int eventCount;
@JsonKey(
name: r'month',
required: true,
includeIfNull: false,
)
final DateTime month;
/// decimal as string
@JsonKey(
name: r'net_rub',
required: true,
includeIfNull: false,
)
final String netRub;
/// decimal as string
@JsonKey(
name: r'withdrawals_rub',
required: true,
includeIfNull: false,
)
final String withdrawalsRub;
@override
bool operator ==(Object other) => identical(this, other) || other is CashFlowBrokerMonth &&
other.depositsRub == depositsRub &&
other.eventCount == eventCount &&
other.month == month &&
other.netRub == netRub &&
other.withdrawalsRub == withdrawalsRub;
@override
int get hashCode =>
depositsRub.hashCode +
eventCount.hashCode +
month.hashCode +
netRub.hashCode +
withdrawalsRub.hashCode;
factory CashFlowBrokerMonth.fromJson(Map<String, dynamic> json) => _$CashFlowBrokerMonthFromJson(json);
Map<String, dynamic> toJson() => _$CashFlowBrokerMonthToJson(this);
@override
String toString() {
return toJson().toString();
}
}
@@ -0,0 +1,152 @@
// GENERATED CODE - DO NOT MODIFY BY HAND
part of 'cash_flow_broker_month.dart';
// **************************************************************************
// CopyWithGenerator
// **************************************************************************
abstract class _$CashFlowBrokerMonthCWProxy {
CashFlowBrokerMonth depositsRub(String depositsRub);
CashFlowBrokerMonth eventCount(int eventCount);
CashFlowBrokerMonth month(DateTime month);
CashFlowBrokerMonth netRub(String netRub);
CashFlowBrokerMonth withdrawalsRub(String withdrawalsRub);
/// This function **does support** nullification of nullable fields. All `null` values passed to `non-nullable` fields will be ignored. You can also use `CashFlowBrokerMonth(...).copyWith.fieldName(...)` to override fields one at a time with nullification support.
///
/// Usage
/// ```dart
/// CashFlowBrokerMonth(...).copyWith(id: 12, name: "My name")
/// ````
CashFlowBrokerMonth call({
String depositsRub,
int eventCount,
DateTime month,
String netRub,
String withdrawalsRub,
});
}
/// Proxy class for `copyWith` functionality. This is a callable class and can be used as follows: `instanceOfCashFlowBrokerMonth.copyWith(...)`. Additionally contains functions for specific fields e.g. `instanceOfCashFlowBrokerMonth.copyWith.fieldName(...)`
class _$CashFlowBrokerMonthCWProxyImpl implements _$CashFlowBrokerMonthCWProxy {
const _$CashFlowBrokerMonthCWProxyImpl(this._value);
final CashFlowBrokerMonth _value;
@override
CashFlowBrokerMonth depositsRub(String depositsRub) =>
this(depositsRub: depositsRub);
@override
CashFlowBrokerMonth eventCount(int eventCount) =>
this(eventCount: eventCount);
@override
CashFlowBrokerMonth month(DateTime month) => this(month: month);
@override
CashFlowBrokerMonth netRub(String netRub) => this(netRub: netRub);
@override
CashFlowBrokerMonth withdrawalsRub(String withdrawalsRub) =>
this(withdrawalsRub: withdrawalsRub);
@override
/// This function **does support** nullification of nullable fields. All `null` values passed to `non-nullable` fields will be ignored. You can also use `CashFlowBrokerMonth(...).copyWith.fieldName(...)` to override fields one at a time with nullification support.
///
/// Usage
/// ```dart
/// CashFlowBrokerMonth(...).copyWith(id: 12, name: "My name")
/// ````
CashFlowBrokerMonth call({
Object? depositsRub = const $CopyWithPlaceholder(),
Object? eventCount = const $CopyWithPlaceholder(),
Object? month = const $CopyWithPlaceholder(),
Object? netRub = const $CopyWithPlaceholder(),
Object? withdrawalsRub = const $CopyWithPlaceholder(),
}) {
return CashFlowBrokerMonth(
depositsRub: depositsRub == const $CopyWithPlaceholder()
? _value.depositsRub
// ignore: cast_nullable_to_non_nullable
: depositsRub as String,
eventCount: eventCount == const $CopyWithPlaceholder()
? _value.eventCount
// ignore: cast_nullable_to_non_nullable
: eventCount as int,
month: month == const $CopyWithPlaceholder()
? _value.month
// ignore: cast_nullable_to_non_nullable
: month as DateTime,
netRub: netRub == const $CopyWithPlaceholder()
? _value.netRub
// ignore: cast_nullable_to_non_nullable
: netRub as String,
withdrawalsRub: withdrawalsRub == const $CopyWithPlaceholder()
? _value.withdrawalsRub
// ignore: cast_nullable_to_non_nullable
: withdrawalsRub as String,
);
}
}
extension $CashFlowBrokerMonthCopyWith on CashFlowBrokerMonth {
/// Returns a callable class that can be used as follows: `instanceOfCashFlowBrokerMonth.copyWith(...)` or like so:`instanceOfCashFlowBrokerMonth.copyWith.fieldName(...)`.
// ignore: library_private_types_in_public_api
_$CashFlowBrokerMonthCWProxy get copyWith =>
_$CashFlowBrokerMonthCWProxyImpl(this);
}
// **************************************************************************
// JsonSerializableGenerator
// **************************************************************************
CashFlowBrokerMonth _$CashFlowBrokerMonthFromJson(Map<String, dynamic> json) =>
$checkedCreate(
'CashFlowBrokerMonth',
json,
($checkedConvert) {
$checkKeys(
json,
requiredKeys: const [
'deposits_rub',
'event_count',
'month',
'net_rub',
'withdrawals_rub',
],
);
final val = CashFlowBrokerMonth(
depositsRub: $checkedConvert('deposits_rub', (v) => v as String),
eventCount: $checkedConvert('event_count', (v) => (v as num).toInt()),
month: $checkedConvert('month', (v) => DateTime.parse(v as String)),
netRub: $checkedConvert('net_rub', (v) => v as String),
withdrawalsRub: $checkedConvert(
'withdrawals_rub',
(v) => v as String,
),
);
return val;
},
fieldKeyMap: const {
'depositsRub': 'deposits_rub',
'eventCount': 'event_count',
'netRub': 'net_rub',
'withdrawalsRub': 'withdrawals_rub',
},
);
Map<String, dynamic> _$CashFlowBrokerMonthToJson(
CashFlowBrokerMonth instance,
) => <String, dynamic>{
'deposits_rub': instance.depositsRub,
'event_count': instance.eventCount,
'month': instance.month.toIso8601String(),
'net_rub': instance.netRub,
'withdrawals_rub': instance.withdrawalsRub,
};
@@ -0,0 +1,90 @@
//
// AUTO-GENERATED FILE, DO NOT MODIFY!
//
// ignore_for_file: unused_element
import 'package:copy_with_extension/copy_with_extension.dart';
import 'package:json_annotation/json_annotation.dart';
part 'commit_request.g.dart';
@CopyWith()
@JsonSerializable(
checked: true,
createToJson: true,
disallowUnrecognizedKeys: false,
explicitToJson: true,
)
class CommitRequest {
/// Returns a new [CommitRequest] instance.
CommitRequest({
this.accountId,
this.confirmDuplicates = false,
this.dryRun = false,
});
@JsonKey(
name: r'account_id',
required: false,
includeIfNull: false,
)
final int? accountId;
@JsonKey(
defaultValue: false,
name: r'confirm_duplicates',
required: false,
includeIfNull: false,
)
final bool? confirmDuplicates;
@JsonKey(
defaultValue: false,
name: r'dry_run',
required: false,
includeIfNull: false,
)
final bool? dryRun;
@override
bool operator ==(Object other) => identical(this, other) || other is CommitRequest &&
other.accountId == accountId &&
other.confirmDuplicates == confirmDuplicates &&
other.dryRun == dryRun;
@override
int get hashCode =>
(accountId == null ? 0 : accountId.hashCode) +
confirmDuplicates.hashCode +
dryRun.hashCode;
factory CommitRequest.fromJson(Map<String, dynamic> json) => _$CommitRequestFromJson(json);
Map<String, dynamic> toJson() => _$CommitRequestToJson(this);
@override
String toString() {
return toJson().toString();
}
}
@@ -0,0 +1,107 @@
// GENERATED CODE - DO NOT MODIFY BY HAND
part of 'commit_request.dart';
// **************************************************************************
// CopyWithGenerator
// **************************************************************************
abstract class _$CommitRequestCWProxy {
CommitRequest accountId(int? accountId);
CommitRequest confirmDuplicates(bool? confirmDuplicates);
CommitRequest dryRun(bool? dryRun);
/// This function **does support** nullification of nullable fields. All `null` values passed to `non-nullable` fields will be ignored. You can also use `CommitRequest(...).copyWith.fieldName(...)` to override fields one at a time with nullification support.
///
/// Usage
/// ```dart
/// CommitRequest(...).copyWith(id: 12, name: "My name")
/// ````
CommitRequest call({int? accountId, bool? confirmDuplicates, bool? dryRun});
}
/// Proxy class for `copyWith` functionality. This is a callable class and can be used as follows: `instanceOfCommitRequest.copyWith(...)`. Additionally contains functions for specific fields e.g. `instanceOfCommitRequest.copyWith.fieldName(...)`
class _$CommitRequestCWProxyImpl implements _$CommitRequestCWProxy {
const _$CommitRequestCWProxyImpl(this._value);
final CommitRequest _value;
@override
CommitRequest accountId(int? accountId) => this(accountId: accountId);
@override
CommitRequest confirmDuplicates(bool? confirmDuplicates) =>
this(confirmDuplicates: confirmDuplicates);
@override
CommitRequest dryRun(bool? dryRun) => this(dryRun: dryRun);
@override
/// This function **does support** nullification of nullable fields. All `null` values passed to `non-nullable` fields will be ignored. You can also use `CommitRequest(...).copyWith.fieldName(...)` to override fields one at a time with nullification support.
///
/// Usage
/// ```dart
/// CommitRequest(...).copyWith(id: 12, name: "My name")
/// ````
CommitRequest call({
Object? accountId = const $CopyWithPlaceholder(),
Object? confirmDuplicates = const $CopyWithPlaceholder(),
Object? dryRun = const $CopyWithPlaceholder(),
}) {
return CommitRequest(
accountId: accountId == const $CopyWithPlaceholder()
? _value.accountId
// ignore: cast_nullable_to_non_nullable
: accountId as int?,
confirmDuplicates: confirmDuplicates == const $CopyWithPlaceholder()
? _value.confirmDuplicates
// ignore: cast_nullable_to_non_nullable
: confirmDuplicates as bool?,
dryRun: dryRun == const $CopyWithPlaceholder()
? _value.dryRun
// ignore: cast_nullable_to_non_nullable
: dryRun as bool?,
);
}
}
extension $CommitRequestCopyWith on CommitRequest {
/// Returns a callable class that can be used as follows: `instanceOfCommitRequest.copyWith(...)` or like so:`instanceOfCommitRequest.copyWith.fieldName(...)`.
// ignore: library_private_types_in_public_api
_$CommitRequestCWProxy get copyWith => _$CommitRequestCWProxyImpl(this);
}
// **************************************************************************
// JsonSerializableGenerator
// **************************************************************************
CommitRequest _$CommitRequestFromJson(Map<String, dynamic> json) =>
$checkedCreate(
'CommitRequest',
json,
($checkedConvert) {
final val = CommitRequest(
accountId: $checkedConvert('account_id', (v) => (v as num?)?.toInt()),
confirmDuplicates: $checkedConvert(
'confirm_duplicates',
(v) => v as bool? ?? false,
),
dryRun: $checkedConvert('dry_run', (v) => v as bool? ?? false),
);
return val;
},
fieldKeyMap: const {
'accountId': 'account_id',
'confirmDuplicates': 'confirm_duplicates',
'dryRun': 'dry_run',
},
);
Map<String, dynamic> _$CommitRequestToJson(CommitRequest instance) =>
<String, dynamic>{
'account_id': ?instance.accountId,
'confirm_duplicates': ?instance.confirmDuplicates,
'dry_run': ?instance.dryRun,
};
@@ -13,6 +13,8 @@ enum EventSource {
reportSber(r'report_sber'),
@JsonValue(r'report_vtb')
reportVtb(r'report_vtb'),
@JsonValue(r'csv')
csv(r'csv'),
@JsonValue(r'manual')
manual(r'manual'),
@JsonValue(r'unknown_default_open_api')
@@ -0,0 +1,91 @@
//
// AUTO-GENERATED FILE, DO NOT MODIFY!
//
// ignore_for_file: unused_element
import 'package:copy_with_extension/copy_with_extension.dart';
import 'package:json_annotation/json_annotation.dart';
part 'forecast_month.g.dart';
@CopyWith()
@JsonSerializable(
checked: true,
createToJson: true,
disallowUnrecognizedKeys: false,
explicitToJson: true,
)
class ForecastMonth {
/// Returns a new [ForecastMonth] instance.
ForecastMonth({
required this.amountRub,
required this.byBasis,
required this.month,
});
/// decimal as string
@JsonKey(
name: r'amount_rub',
required: true,
includeIfNull: false,
)
final String amountRub;
@JsonKey(
name: r'by_basis',
required: true,
includeIfNull: false,
)
final Map<String, String> byBasis;
@JsonKey(
name: r'month',
required: true,
includeIfNull: false,
)
final DateTime month;
@override
bool operator ==(Object other) => identical(this, other) || other is ForecastMonth &&
other.amountRub == amountRub &&
other.byBasis == byBasis &&
other.month == month;
@override
int get hashCode =>
amountRub.hashCode +
byBasis.hashCode +
month.hashCode;
factory ForecastMonth.fromJson(Map<String, dynamic> json) => _$ForecastMonthFromJson(json);
Map<String, dynamic> toJson() => _$ForecastMonthToJson(this);
@override
String toString() {
return toJson().toString();
}
}
@@ -0,0 +1,110 @@
// GENERATED CODE - DO NOT MODIFY BY HAND
part of 'forecast_month.dart';
// **************************************************************************
// CopyWithGenerator
// **************************************************************************
abstract class _$ForecastMonthCWProxy {
ForecastMonth amountRub(String amountRub);
ForecastMonth byBasis(Map<String, String> byBasis);
ForecastMonth month(DateTime month);
/// This function **does support** nullification of nullable fields. All `null` values passed to `non-nullable` fields will be ignored. You can also use `ForecastMonth(...).copyWith.fieldName(...)` to override fields one at a time with nullification support.
///
/// Usage
/// ```dart
/// ForecastMonth(...).copyWith(id: 12, name: "My name")
/// ````
ForecastMonth call({
String amountRub,
Map<String, String> byBasis,
DateTime month,
});
}
/// Proxy class for `copyWith` functionality. This is a callable class and can be used as follows: `instanceOfForecastMonth.copyWith(...)`. Additionally contains functions for specific fields e.g. `instanceOfForecastMonth.copyWith.fieldName(...)`
class _$ForecastMonthCWProxyImpl implements _$ForecastMonthCWProxy {
const _$ForecastMonthCWProxyImpl(this._value);
final ForecastMonth _value;
@override
ForecastMonth amountRub(String amountRub) => this(amountRub: amountRub);
@override
ForecastMonth byBasis(Map<String, String> byBasis) => this(byBasis: byBasis);
@override
ForecastMonth month(DateTime month) => this(month: month);
@override
/// This function **does support** nullification of nullable fields. All `null` values passed to `non-nullable` fields will be ignored. You can also use `ForecastMonth(...).copyWith.fieldName(...)` to override fields one at a time with nullification support.
///
/// Usage
/// ```dart
/// ForecastMonth(...).copyWith(id: 12, name: "My name")
/// ````
ForecastMonth call({
Object? amountRub = const $CopyWithPlaceholder(),
Object? byBasis = const $CopyWithPlaceholder(),
Object? month = const $CopyWithPlaceholder(),
}) {
return ForecastMonth(
amountRub: amountRub == const $CopyWithPlaceholder()
? _value.amountRub
// ignore: cast_nullable_to_non_nullable
: amountRub as String,
byBasis: byBasis == const $CopyWithPlaceholder()
? _value.byBasis
// ignore: cast_nullable_to_non_nullable
: byBasis as Map<String, String>,
month: month == const $CopyWithPlaceholder()
? _value.month
// ignore: cast_nullable_to_non_nullable
: month as DateTime,
);
}
}
extension $ForecastMonthCopyWith on ForecastMonth {
/// Returns a callable class that can be used as follows: `instanceOfForecastMonth.copyWith(...)` or like so:`instanceOfForecastMonth.copyWith.fieldName(...)`.
// ignore: library_private_types_in_public_api
_$ForecastMonthCWProxy get copyWith => _$ForecastMonthCWProxyImpl(this);
}
// **************************************************************************
// JsonSerializableGenerator
// **************************************************************************
ForecastMonth _$ForecastMonthFromJson(Map<String, dynamic> json) =>
$checkedCreate(
'ForecastMonth',
json,
($checkedConvert) {
$checkKeys(
json,
requiredKeys: const ['amount_rub', 'by_basis', 'month'],
);
final val = ForecastMonth(
amountRub: $checkedConvert('amount_rub', (v) => v as String),
byBasis: $checkedConvert(
'by_basis',
(v) => Map<String, String>.from(v as Map),
),
month: $checkedConvert('month', (v) => DateTime.parse(v as String)),
);
return val;
},
fieldKeyMap: const {'amountRub': 'amount_rub', 'byBasis': 'by_basis'},
);
Map<String, dynamic> _$ForecastMonthToJson(ForecastMonth instance) =>
<String, dynamic>{
'amount_rub': instance.amountRub,
'by_basis': instance.byBasis,
'month': instance.month.toIso8601String(),
};
@@ -0,0 +1,109 @@
//
// AUTO-GENERATED FILE, DO NOT MODIFY!
//
// ignore_for_file: unused_element
import 'package:fintracker_api/src/model/forecast_month.dart';
import 'package:copy_with_extension/copy_with_extension.dart';
import 'package:json_annotation/json_annotation.dart';
part 'forecast_out.g.dart';
@CopyWith()
@JsonSerializable(
checked: true,
createToJson: true,
disallowUnrecognizedKeys: false,
explicitToJson: true,
)
class ForecastOut {
/// Returns a new [ForecastOut] instance.
ForecastOut({
required this.annualYieldOnValue,
required this.months,
required this.totalRub,
required this.warnings,
});
/// decimal as string
@JsonKey(
name: r'annual_yield_on_value',
required: true,
includeIfNull: true,
)
final String? annualYieldOnValue;
@JsonKey(
name: r'months',
required: true,
includeIfNull: false,
)
final List<ForecastMonth> months;
/// decimal as string
@JsonKey(
name: r'total_rub',
required: true,
includeIfNull: false,
)
final String totalRub;
@JsonKey(
name: r'warnings',
required: true,
includeIfNull: false,
)
final List<String> warnings;
@override
bool operator ==(Object other) => identical(this, other) || other is ForecastOut &&
other.annualYieldOnValue == annualYieldOnValue &&
other.months == months &&
other.totalRub == totalRub &&
other.warnings == warnings;
@override
int get hashCode =>
(annualYieldOnValue == null ? 0 : annualYieldOnValue.hashCode) +
months.hashCode +
totalRub.hashCode +
warnings.hashCode;
factory ForecastOut.fromJson(Map<String, dynamic> json) => _$ForecastOutFromJson(json);
Map<String, dynamic> toJson() => _$ForecastOutToJson(this);
@override
String toString() {
return toJson().toString();
}
}
@@ -0,0 +1,139 @@
// GENERATED CODE - DO NOT MODIFY BY HAND
part of 'forecast_out.dart';
// **************************************************************************
// CopyWithGenerator
// **************************************************************************
abstract class _$ForecastOutCWProxy {
ForecastOut annualYieldOnValue(String? annualYieldOnValue);
ForecastOut months(List<ForecastMonth> months);
ForecastOut totalRub(String totalRub);
ForecastOut warnings(List<String> warnings);
/// This function **does support** nullification of nullable fields. All `null` values passed to `non-nullable` fields will be ignored. You can also use `ForecastOut(...).copyWith.fieldName(...)` to override fields one at a time with nullification support.
///
/// Usage
/// ```dart
/// ForecastOut(...).copyWith(id: 12, name: "My name")
/// ````
ForecastOut call({
String? annualYieldOnValue,
List<ForecastMonth> months,
String totalRub,
List<String> warnings,
});
}
/// Proxy class for `copyWith` functionality. This is a callable class and can be used as follows: `instanceOfForecastOut.copyWith(...)`. Additionally contains functions for specific fields e.g. `instanceOfForecastOut.copyWith.fieldName(...)`
class _$ForecastOutCWProxyImpl implements _$ForecastOutCWProxy {
const _$ForecastOutCWProxyImpl(this._value);
final ForecastOut _value;
@override
ForecastOut annualYieldOnValue(String? annualYieldOnValue) =>
this(annualYieldOnValue: annualYieldOnValue);
@override
ForecastOut months(List<ForecastMonth> months) => this(months: months);
@override
ForecastOut totalRub(String totalRub) => this(totalRub: totalRub);
@override
ForecastOut warnings(List<String> warnings) => this(warnings: warnings);
@override
/// This function **does support** nullification of nullable fields. All `null` values passed to `non-nullable` fields will be ignored. You can also use `ForecastOut(...).copyWith.fieldName(...)` to override fields one at a time with nullification support.
///
/// Usage
/// ```dart
/// ForecastOut(...).copyWith(id: 12, name: "My name")
/// ````
ForecastOut call({
Object? annualYieldOnValue = const $CopyWithPlaceholder(),
Object? months = const $CopyWithPlaceholder(),
Object? totalRub = const $CopyWithPlaceholder(),
Object? warnings = const $CopyWithPlaceholder(),
}) {
return ForecastOut(
annualYieldOnValue: annualYieldOnValue == const $CopyWithPlaceholder()
? _value.annualYieldOnValue
// ignore: cast_nullable_to_non_nullable
: annualYieldOnValue as String?,
months: months == const $CopyWithPlaceholder()
? _value.months
// ignore: cast_nullable_to_non_nullable
: months as List<ForecastMonth>,
totalRub: totalRub == const $CopyWithPlaceholder()
? _value.totalRub
// ignore: cast_nullable_to_non_nullable
: totalRub as String,
warnings: warnings == const $CopyWithPlaceholder()
? _value.warnings
// ignore: cast_nullable_to_non_nullable
: warnings as List<String>,
);
}
}
extension $ForecastOutCopyWith on ForecastOut {
/// Returns a callable class that can be used as follows: `instanceOfForecastOut.copyWith(...)` or like so:`instanceOfForecastOut.copyWith.fieldName(...)`.
// ignore: library_private_types_in_public_api
_$ForecastOutCWProxy get copyWith => _$ForecastOutCWProxyImpl(this);
}
// **************************************************************************
// JsonSerializableGenerator
// **************************************************************************
ForecastOut _$ForecastOutFromJson(Map<String, dynamic> json) => $checkedCreate(
'ForecastOut',
json,
($checkedConvert) {
$checkKeys(
json,
requiredKeys: const [
'annual_yield_on_value',
'months',
'total_rub',
'warnings',
],
);
final val = ForecastOut(
annualYieldOnValue: $checkedConvert(
'annual_yield_on_value',
(v) => v as String?,
),
months: $checkedConvert(
'months',
(v) => (v as List<dynamic>)
.map((e) => ForecastMonth.fromJson(e as Map<String, dynamic>))
.toList(),
),
totalRub: $checkedConvert('total_rub', (v) => v as String),
warnings: $checkedConvert(
'warnings',
(v) => (v as List<dynamic>).map((e) => e as String).toList(),
),
);
return val;
},
fieldKeyMap: const {
'annualYieldOnValue': 'annual_yield_on_value',
'totalRub': 'total_rub',
},
);
Map<String, dynamic> _$ForecastOutToJson(ForecastOut instance) =>
<String, dynamic>{
'annual_yield_on_value': instance.annualYieldOnValue,
'months': instance.months.map((e) => e.toJson()).toList(),
'total_rub': instance.totalRub,
'warnings': instance.warnings,
};
@@ -0,0 +1,172 @@
//
// AUTO-GENERATED FILE, DO NOT MODIFY!
//
// ignore_for_file: unused_element
import 'package:copy_with_extension/copy_with_extension.dart';
import 'package:json_annotation/json_annotation.dart';
part 'goal_create.g.dart';
@CopyWith()
@JsonSerializable(
checked: true,
createToJson: true,
disallowUnrecognizedKeys: false,
explicitToJson: true,
)
class GoalCreate {
/// Returns a new [GoalCreate] instance.
GoalCreate({
this.archived = false,
this.currency = 'RUB',
this.monthlyContribution,
required this.name,
this.note,
this.scope = 'all',
required this.targetAmount,
this.targetDate,
});
@JsonKey(
defaultValue: false,
name: r'archived',
required: false,
includeIfNull: false,
)
final bool? archived;
@JsonKey(
defaultValue: 'RUB',
name: r'currency',
required: false,
includeIfNull: false,
)
final String? currency;
/// decimal as string
@JsonKey(
name: r'monthly_contribution',
required: false,
includeIfNull: false,
)
final String? monthlyContribution;
@JsonKey(
name: r'name',
required: true,
includeIfNull: false,
)
final String name;
@JsonKey(
name: r'note',
required: false,
includeIfNull: false,
)
final String? note;
@JsonKey(
defaultValue: 'all',
name: r'scope',
required: false,
includeIfNull: false,
)
final String? scope;
/// decimal as string
@JsonKey(
name: r'target_amount',
required: true,
includeIfNull: false,
)
final String targetAmount;
@JsonKey(
name: r'target_date',
required: false,
includeIfNull: false,
)
final DateTime? targetDate;
@override
bool operator ==(Object other) => identical(this, other) || other is GoalCreate &&
other.archived == archived &&
other.currency == currency &&
other.monthlyContribution == monthlyContribution &&
other.name == name &&
other.note == note &&
other.scope == scope &&
other.targetAmount == targetAmount &&
other.targetDate == targetDate;
@override
int get hashCode =>
archived.hashCode +
currency.hashCode +
(monthlyContribution == null ? 0 : monthlyContribution.hashCode) +
name.hashCode +
(note == null ? 0 : note.hashCode) +
scope.hashCode +
targetAmount.hashCode +
(targetDate == null ? 0 : targetDate.hashCode);
factory GoalCreate.fromJson(Map<String, dynamic> json) => _$GoalCreateFromJson(json);
Map<String, dynamic> toJson() => _$GoalCreateToJson(this);
@override
String toString() {
return toJson().toString();
}
}
@@ -0,0 +1,180 @@
// GENERATED CODE - DO NOT MODIFY BY HAND
part of 'goal_create.dart';
// **************************************************************************
// CopyWithGenerator
// **************************************************************************
abstract class _$GoalCreateCWProxy {
GoalCreate archived(bool? archived);
GoalCreate currency(String? currency);
GoalCreate monthlyContribution(String? monthlyContribution);
GoalCreate name(String name);
GoalCreate note(String? note);
GoalCreate scope(String? scope);
GoalCreate targetAmount(String targetAmount);
GoalCreate targetDate(DateTime? targetDate);
/// This function **does support** nullification of nullable fields. All `null` values passed to `non-nullable` fields will be ignored. You can also use `GoalCreate(...).copyWith.fieldName(...)` to override fields one at a time with nullification support.
///
/// Usage
/// ```dart
/// GoalCreate(...).copyWith(id: 12, name: "My name")
/// ````
GoalCreate call({
bool? archived,
String? currency,
String? monthlyContribution,
String name,
String? note,
String? scope,
String targetAmount,
DateTime? targetDate,
});
}
/// Proxy class for `copyWith` functionality. This is a callable class and can be used as follows: `instanceOfGoalCreate.copyWith(...)`. Additionally contains functions for specific fields e.g. `instanceOfGoalCreate.copyWith.fieldName(...)`
class _$GoalCreateCWProxyImpl implements _$GoalCreateCWProxy {
const _$GoalCreateCWProxyImpl(this._value);
final GoalCreate _value;
@override
GoalCreate archived(bool? archived) => this(archived: archived);
@override
GoalCreate currency(String? currency) => this(currency: currency);
@override
GoalCreate monthlyContribution(String? monthlyContribution) =>
this(monthlyContribution: monthlyContribution);
@override
GoalCreate name(String name) => this(name: name);
@override
GoalCreate note(String? note) => this(note: note);
@override
GoalCreate scope(String? scope) => this(scope: scope);
@override
GoalCreate targetAmount(String targetAmount) =>
this(targetAmount: targetAmount);
@override
GoalCreate targetDate(DateTime? targetDate) => this(targetDate: targetDate);
@override
/// This function **does support** nullification of nullable fields. All `null` values passed to `non-nullable` fields will be ignored. You can also use `GoalCreate(...).copyWith.fieldName(...)` to override fields one at a time with nullification support.
///
/// Usage
/// ```dart
/// GoalCreate(...).copyWith(id: 12, name: "My name")
/// ````
GoalCreate call({
Object? archived = const $CopyWithPlaceholder(),
Object? currency = const $CopyWithPlaceholder(),
Object? monthlyContribution = const $CopyWithPlaceholder(),
Object? name = const $CopyWithPlaceholder(),
Object? note = const $CopyWithPlaceholder(),
Object? scope = const $CopyWithPlaceholder(),
Object? targetAmount = const $CopyWithPlaceholder(),
Object? targetDate = const $CopyWithPlaceholder(),
}) {
return GoalCreate(
archived: archived == const $CopyWithPlaceholder()
? _value.archived
// ignore: cast_nullable_to_non_nullable
: archived as bool?,
currency: currency == const $CopyWithPlaceholder()
? _value.currency
// ignore: cast_nullable_to_non_nullable
: currency as String?,
monthlyContribution: monthlyContribution == const $CopyWithPlaceholder()
? _value.monthlyContribution
// ignore: cast_nullable_to_non_nullable
: monthlyContribution as String?,
name: name == const $CopyWithPlaceholder()
? _value.name
// ignore: cast_nullable_to_non_nullable
: name as String,
note: note == const $CopyWithPlaceholder()
? _value.note
// ignore: cast_nullable_to_non_nullable
: note as String?,
scope: scope == const $CopyWithPlaceholder()
? _value.scope
// ignore: cast_nullable_to_non_nullable
: scope as String?,
targetAmount: targetAmount == const $CopyWithPlaceholder()
? _value.targetAmount
// ignore: cast_nullable_to_non_nullable
: targetAmount as String,
targetDate: targetDate == const $CopyWithPlaceholder()
? _value.targetDate
// ignore: cast_nullable_to_non_nullable
: targetDate as DateTime?,
);
}
}
extension $GoalCreateCopyWith on GoalCreate {
/// Returns a callable class that can be used as follows: `instanceOfGoalCreate.copyWith(...)` or like so:`instanceOfGoalCreate.copyWith.fieldName(...)`.
// ignore: library_private_types_in_public_api
_$GoalCreateCWProxy get copyWith => _$GoalCreateCWProxyImpl(this);
}
// **************************************************************************
// JsonSerializableGenerator
// **************************************************************************
GoalCreate _$GoalCreateFromJson(Map<String, dynamic> json) => $checkedCreate(
'GoalCreate',
json,
($checkedConvert) {
$checkKeys(json, requiredKeys: const ['name', 'target_amount']);
final val = GoalCreate(
archived: $checkedConvert('archived', (v) => v as bool? ?? false),
currency: $checkedConvert('currency', (v) => v as String? ?? 'RUB'),
monthlyContribution: $checkedConvert(
'monthly_contribution',
(v) => v as String?,
),
name: $checkedConvert('name', (v) => v as String),
note: $checkedConvert('note', (v) => v as String?),
scope: $checkedConvert('scope', (v) => v as String? ?? 'all'),
targetAmount: $checkedConvert('target_amount', (v) => v as String),
targetDate: $checkedConvert(
'target_date',
(v) => v == null ? null : DateTime.parse(v as String),
),
);
return val;
},
fieldKeyMap: const {
'monthlyContribution': 'monthly_contribution',
'targetAmount': 'target_amount',
'targetDate': 'target_date',
},
);
Map<String, dynamic> _$GoalCreateToJson(GoalCreate instance) =>
<String, dynamic>{
'archived': ?instance.archived,
'currency': ?instance.currency,
'monthly_contribution': ?instance.monthlyContribution,
'name': instance.name,
'note': ?instance.note,
'scope': ?instance.scope,
'target_amount': instance.targetAmount,
'target_date': ?instance.targetDate?.toIso8601String(),
};
@@ -0,0 +1,188 @@
//
// AUTO-GENERATED FILE, DO NOT MODIFY!
//
// ignore_for_file: unused_element
import 'package:copy_with_extension/copy_with_extension.dart';
import 'package:json_annotation/json_annotation.dart';
part 'goal_out.g.dart';
@CopyWith()
@JsonSerializable(
checked: true,
createToJson: true,
disallowUnrecognizedKeys: false,
explicitToJson: true,
)
class GoalOut {
/// Returns a new [GoalOut] instance.
GoalOut({
required this.archived,
required this.currency,
required this.id,
required this.monthlyContribution,
required this.name,
required this.note,
required this.scope,
required this.targetAmount,
required this.targetDate,
});
@JsonKey(
name: r'archived',
required: true,
includeIfNull: false,
)
final bool archived;
@JsonKey(
name: r'currency',
required: true,
includeIfNull: false,
)
final String currency;
@JsonKey(
name: r'id',
required: true,
includeIfNull: false,
)
final int id;
/// decimal as string
@JsonKey(
name: r'monthly_contribution',
required: true,
includeIfNull: true,
)
final String? monthlyContribution;
@JsonKey(
name: r'name',
required: true,
includeIfNull: false,
)
final String name;
@JsonKey(
name: r'note',
required: true,
includeIfNull: true,
)
final String? note;
@JsonKey(
name: r'scope',
required: true,
includeIfNull: false,
)
final String scope;
/// decimal as string
@JsonKey(
name: r'target_amount',
required: true,
includeIfNull: false,
)
final String targetAmount;
@JsonKey(
name: r'target_date',
required: true,
includeIfNull: true,
)
final DateTime? targetDate;
@override
bool operator ==(Object other) => identical(this, other) || other is GoalOut &&
other.archived == archived &&
other.currency == currency &&
other.id == id &&
other.monthlyContribution == monthlyContribution &&
other.name == name &&
other.note == note &&
other.scope == scope &&
other.targetAmount == targetAmount &&
other.targetDate == targetDate;
@override
int get hashCode =>
archived.hashCode +
currency.hashCode +
id.hashCode +
(monthlyContribution == null ? 0 : monthlyContribution.hashCode) +
name.hashCode +
(note == null ? 0 : note.hashCode) +
scope.hashCode +
targetAmount.hashCode +
(targetDate == null ? 0 : targetDate.hashCode);
factory GoalOut.fromJson(Map<String, dynamic> json) => _$GoalOutFromJson(json);
Map<String, dynamic> toJson() => _$GoalOutToJson(this);
@override
String toString() {
return toJson().toString();
}
}
@@ -0,0 +1,204 @@
// GENERATED CODE - DO NOT MODIFY BY HAND
part of 'goal_out.dart';
// **************************************************************************
// CopyWithGenerator
// **************************************************************************
abstract class _$GoalOutCWProxy {
GoalOut archived(bool archived);
GoalOut currency(String currency);
GoalOut id(int id);
GoalOut monthlyContribution(String? monthlyContribution);
GoalOut name(String name);
GoalOut note(String? note);
GoalOut scope(String scope);
GoalOut targetAmount(String targetAmount);
GoalOut targetDate(DateTime? targetDate);
/// This function **does support** nullification of nullable fields. All `null` values passed to `non-nullable` fields will be ignored. You can also use `GoalOut(...).copyWith.fieldName(...)` to override fields one at a time with nullification support.
///
/// Usage
/// ```dart
/// GoalOut(...).copyWith(id: 12, name: "My name")
/// ````
GoalOut call({
bool archived,
String currency,
int id,
String? monthlyContribution,
String name,
String? note,
String scope,
String targetAmount,
DateTime? targetDate,
});
}
/// Proxy class for `copyWith` functionality. This is a callable class and can be used as follows: `instanceOfGoalOut.copyWith(...)`. Additionally contains functions for specific fields e.g. `instanceOfGoalOut.copyWith.fieldName(...)`
class _$GoalOutCWProxyImpl implements _$GoalOutCWProxy {
const _$GoalOutCWProxyImpl(this._value);
final GoalOut _value;
@override
GoalOut archived(bool archived) => this(archived: archived);
@override
GoalOut currency(String currency) => this(currency: currency);
@override
GoalOut id(int id) => this(id: id);
@override
GoalOut monthlyContribution(String? monthlyContribution) =>
this(monthlyContribution: monthlyContribution);
@override
GoalOut name(String name) => this(name: name);
@override
GoalOut note(String? note) => this(note: note);
@override
GoalOut scope(String scope) => this(scope: scope);
@override
GoalOut targetAmount(String targetAmount) => this(targetAmount: targetAmount);
@override
GoalOut targetDate(DateTime? targetDate) => this(targetDate: targetDate);
@override
/// This function **does support** nullification of nullable fields. All `null` values passed to `non-nullable` fields will be ignored. You can also use `GoalOut(...).copyWith.fieldName(...)` to override fields one at a time with nullification support.
///
/// Usage
/// ```dart
/// GoalOut(...).copyWith(id: 12, name: "My name")
/// ````
GoalOut call({
Object? archived = const $CopyWithPlaceholder(),
Object? currency = const $CopyWithPlaceholder(),
Object? id = const $CopyWithPlaceholder(),
Object? monthlyContribution = const $CopyWithPlaceholder(),
Object? name = const $CopyWithPlaceholder(),
Object? note = const $CopyWithPlaceholder(),
Object? scope = const $CopyWithPlaceholder(),
Object? targetAmount = const $CopyWithPlaceholder(),
Object? targetDate = const $CopyWithPlaceholder(),
}) {
return GoalOut(
archived: archived == const $CopyWithPlaceholder()
? _value.archived
// ignore: cast_nullable_to_non_nullable
: archived as bool,
currency: currency == const $CopyWithPlaceholder()
? _value.currency
// ignore: cast_nullable_to_non_nullable
: currency as String,
id: id == const $CopyWithPlaceholder()
? _value.id
// ignore: cast_nullable_to_non_nullable
: id as int,
monthlyContribution: monthlyContribution == const $CopyWithPlaceholder()
? _value.monthlyContribution
// ignore: cast_nullable_to_non_nullable
: monthlyContribution as String?,
name: name == const $CopyWithPlaceholder()
? _value.name
// ignore: cast_nullable_to_non_nullable
: name as String,
note: note == const $CopyWithPlaceholder()
? _value.note
// ignore: cast_nullable_to_non_nullable
: note as String?,
scope: scope == const $CopyWithPlaceholder()
? _value.scope
// ignore: cast_nullable_to_non_nullable
: scope as String,
targetAmount: targetAmount == const $CopyWithPlaceholder()
? _value.targetAmount
// ignore: cast_nullable_to_non_nullable
: targetAmount as String,
targetDate: targetDate == const $CopyWithPlaceholder()
? _value.targetDate
// ignore: cast_nullable_to_non_nullable
: targetDate as DateTime?,
);
}
}
extension $GoalOutCopyWith on GoalOut {
/// Returns a callable class that can be used as follows: `instanceOfGoalOut.copyWith(...)` or like so:`instanceOfGoalOut.copyWith.fieldName(...)`.
// ignore: library_private_types_in_public_api
_$GoalOutCWProxy get copyWith => _$GoalOutCWProxyImpl(this);
}
// **************************************************************************
// JsonSerializableGenerator
// **************************************************************************
GoalOut _$GoalOutFromJson(Map<String, dynamic> json) => $checkedCreate(
'GoalOut',
json,
($checkedConvert) {
$checkKeys(
json,
requiredKeys: const [
'archived',
'currency',
'id',
'monthly_contribution',
'name',
'note',
'scope',
'target_amount',
'target_date',
],
);
final val = GoalOut(
archived: $checkedConvert('archived', (v) => v as bool),
currency: $checkedConvert('currency', (v) => v as String),
id: $checkedConvert('id', (v) => (v as num).toInt()),
monthlyContribution: $checkedConvert(
'monthly_contribution',
(v) => v as String?,
),
name: $checkedConvert('name', (v) => v as String),
note: $checkedConvert('note', (v) => v as String?),
scope: $checkedConvert('scope', (v) => v as String),
targetAmount: $checkedConvert('target_amount', (v) => v as String),
targetDate: $checkedConvert(
'target_date',
(v) => v == null ? null : DateTime.parse(v as String),
),
);
return val;
},
fieldKeyMap: const {
'monthlyContribution': 'monthly_contribution',
'targetAmount': 'target_amount',
'targetDate': 'target_date',
},
);
Map<String, dynamic> _$GoalOutToJson(GoalOut instance) => <String, dynamic>{
'archived': instance.archived,
'currency': instance.currency,
'id': instance.id,
'monthly_contribution': instance.monthlyContribution,
'name': instance.name,
'note': instance.note,
'scope': instance.scope,
'target_amount': instance.targetAmount,
'target_date': instance.targetDate?.toIso8601String(),
};
@@ -0,0 +1,172 @@
//
// AUTO-GENERATED FILE, DO NOT MODIFY!
//
// ignore_for_file: unused_element
import 'package:copy_with_extension/copy_with_extension.dart';
import 'package:json_annotation/json_annotation.dart';
part 'goal_patch.g.dart';
@CopyWith()
@JsonSerializable(
checked: true,
createToJson: true,
disallowUnrecognizedKeys: false,
explicitToJson: true,
)
class GoalPatch {
/// Returns a new [GoalPatch] instance.
GoalPatch({
this.archived,
this.currency,
this.monthlyContribution,
this.name,
this.note,
this.scope,
this.targetAmount,
this.targetDate,
});
@JsonKey(
name: r'archived',
required: false,
includeIfNull: false,
)
final bool? archived;
@JsonKey(
name: r'currency',
required: false,
includeIfNull: false,
)
final String? currency;
/// decimal as string
@JsonKey(
name: r'monthly_contribution',
required: false,
includeIfNull: false,
)
final String? monthlyContribution;
@JsonKey(
name: r'name',
required: false,
includeIfNull: false,
)
final String? name;
@JsonKey(
name: r'note',
required: false,
includeIfNull: false,
)
final String? note;
@JsonKey(
name: r'scope',
required: false,
includeIfNull: false,
)
final String? scope;
/// decimal as string
@JsonKey(
name: r'target_amount',
required: false,
includeIfNull: false,
)
final String? targetAmount;
@JsonKey(
name: r'target_date',
required: false,
includeIfNull: false,
)
final DateTime? targetDate;
@override
bool operator ==(Object other) => identical(this, other) || other is GoalPatch &&
other.archived == archived &&
other.currency == currency &&
other.monthlyContribution == monthlyContribution &&
other.name == name &&
other.note == note &&
other.scope == scope &&
other.targetAmount == targetAmount &&
other.targetDate == targetDate;
@override
int get hashCode =>
(archived == null ? 0 : archived.hashCode) +
(currency == null ? 0 : currency.hashCode) +
(monthlyContribution == null ? 0 : monthlyContribution.hashCode) +
(name == null ? 0 : name.hashCode) +
(note == null ? 0 : note.hashCode) +
(scope == null ? 0 : scope.hashCode) +
(targetAmount == null ? 0 : targetAmount.hashCode) +
(targetDate == null ? 0 : targetDate.hashCode);
factory GoalPatch.fromJson(Map<String, dynamic> json) => _$GoalPatchFromJson(json);
Map<String, dynamic> toJson() => _$GoalPatchToJson(this);
@override
String toString() {
return toJson().toString();
}
}
@@ -0,0 +1,178 @@
// GENERATED CODE - DO NOT MODIFY BY HAND
part of 'goal_patch.dart';
// **************************************************************************
// CopyWithGenerator
// **************************************************************************
abstract class _$GoalPatchCWProxy {
GoalPatch archived(bool? archived);
GoalPatch currency(String? currency);
GoalPatch monthlyContribution(String? monthlyContribution);
GoalPatch name(String? name);
GoalPatch note(String? note);
GoalPatch scope(String? scope);
GoalPatch targetAmount(String? targetAmount);
GoalPatch targetDate(DateTime? targetDate);
/// This function **does support** nullification of nullable fields. All `null` values passed to `non-nullable` fields will be ignored. You can also use `GoalPatch(...).copyWith.fieldName(...)` to override fields one at a time with nullification support.
///
/// Usage
/// ```dart
/// GoalPatch(...).copyWith(id: 12, name: "My name")
/// ````
GoalPatch call({
bool? archived,
String? currency,
String? monthlyContribution,
String? name,
String? note,
String? scope,
String? targetAmount,
DateTime? targetDate,
});
}
/// Proxy class for `copyWith` functionality. This is a callable class and can be used as follows: `instanceOfGoalPatch.copyWith(...)`. Additionally contains functions for specific fields e.g. `instanceOfGoalPatch.copyWith.fieldName(...)`
class _$GoalPatchCWProxyImpl implements _$GoalPatchCWProxy {
const _$GoalPatchCWProxyImpl(this._value);
final GoalPatch _value;
@override
GoalPatch archived(bool? archived) => this(archived: archived);
@override
GoalPatch currency(String? currency) => this(currency: currency);
@override
GoalPatch monthlyContribution(String? monthlyContribution) =>
this(monthlyContribution: monthlyContribution);
@override
GoalPatch name(String? name) => this(name: name);
@override
GoalPatch note(String? note) => this(note: note);
@override
GoalPatch scope(String? scope) => this(scope: scope);
@override
GoalPatch targetAmount(String? targetAmount) =>
this(targetAmount: targetAmount);
@override
GoalPatch targetDate(DateTime? targetDate) => this(targetDate: targetDate);
@override
/// This function **does support** nullification of nullable fields. All `null` values passed to `non-nullable` fields will be ignored. You can also use `GoalPatch(...).copyWith.fieldName(...)` to override fields one at a time with nullification support.
///
/// Usage
/// ```dart
/// GoalPatch(...).copyWith(id: 12, name: "My name")
/// ````
GoalPatch call({
Object? archived = const $CopyWithPlaceholder(),
Object? currency = const $CopyWithPlaceholder(),
Object? monthlyContribution = const $CopyWithPlaceholder(),
Object? name = const $CopyWithPlaceholder(),
Object? note = const $CopyWithPlaceholder(),
Object? scope = const $CopyWithPlaceholder(),
Object? targetAmount = const $CopyWithPlaceholder(),
Object? targetDate = const $CopyWithPlaceholder(),
}) {
return GoalPatch(
archived: archived == const $CopyWithPlaceholder()
? _value.archived
// ignore: cast_nullable_to_non_nullable
: archived as bool?,
currency: currency == const $CopyWithPlaceholder()
? _value.currency
// ignore: cast_nullable_to_non_nullable
: currency as String?,
monthlyContribution: monthlyContribution == const $CopyWithPlaceholder()
? _value.monthlyContribution
// ignore: cast_nullable_to_non_nullable
: monthlyContribution as String?,
name: name == const $CopyWithPlaceholder()
? _value.name
// ignore: cast_nullable_to_non_nullable
: name as String?,
note: note == const $CopyWithPlaceholder()
? _value.note
// ignore: cast_nullable_to_non_nullable
: note as String?,
scope: scope == const $CopyWithPlaceholder()
? _value.scope
// ignore: cast_nullable_to_non_nullable
: scope as String?,
targetAmount: targetAmount == const $CopyWithPlaceholder()
? _value.targetAmount
// ignore: cast_nullable_to_non_nullable
: targetAmount as String?,
targetDate: targetDate == const $CopyWithPlaceholder()
? _value.targetDate
// ignore: cast_nullable_to_non_nullable
: targetDate as DateTime?,
);
}
}
extension $GoalPatchCopyWith on GoalPatch {
/// Returns a callable class that can be used as follows: `instanceOfGoalPatch.copyWith(...)` or like so:`instanceOfGoalPatch.copyWith.fieldName(...)`.
// ignore: library_private_types_in_public_api
_$GoalPatchCWProxy get copyWith => _$GoalPatchCWProxyImpl(this);
}
// **************************************************************************
// JsonSerializableGenerator
// **************************************************************************
GoalPatch _$GoalPatchFromJson(Map<String, dynamic> json) => $checkedCreate(
'GoalPatch',
json,
($checkedConvert) {
final val = GoalPatch(
archived: $checkedConvert('archived', (v) => v as bool?),
currency: $checkedConvert('currency', (v) => v as String?),
monthlyContribution: $checkedConvert(
'monthly_contribution',
(v) => v as String?,
),
name: $checkedConvert('name', (v) => v as String?),
note: $checkedConvert('note', (v) => v as String?),
scope: $checkedConvert('scope', (v) => v as String?),
targetAmount: $checkedConvert('target_amount', (v) => v as String?),
targetDate: $checkedConvert(
'target_date',
(v) => v == null ? null : DateTime.parse(v as String),
),
);
return val;
},
fieldKeyMap: const {
'monthlyContribution': 'monthly_contribution',
'targetAmount': 'target_amount',
'targetDate': 'target_date',
},
);
Map<String, dynamic> _$GoalPatchToJson(GoalPatch instance) => <String, dynamic>{
'archived': ?instance.archived,
'currency': ?instance.currency,
'monthly_contribution': ?instance.monthlyContribution,
'name': ?instance.name,
'note': ?instance.note,
'scope': ?instance.scope,
'target_amount': ?instance.targetAmount,
'target_date': ?instance.targetDate?.toIso8601String(),
};
@@ -0,0 +1,207 @@
//
// AUTO-GENERATED FILE, DO NOT MODIFY!
//
// ignore_for_file: unused_element
import 'package:copy_with_extension/copy_with_extension.dart';
import 'package:json_annotation/json_annotation.dart';
part 'goal_progress_out.g.dart';
@CopyWith()
@JsonSerializable(
checked: true,
createToJson: true,
disallowUnrecognizedKeys: false,
explicitToJson: true,
)
class GoalProgressOut {
/// Returns a new [GoalProgressOut] instance.
GoalProgressOut({
required this.asOf,
required this.assumedRate,
required this.basis,
required this.currentValueRub,
required this.goalId,
required this.monthlyNeededRub,
required this.onTrack,
required this.progress,
required this.projectedDate,
required this.targetAmountRub,
});
@JsonKey(
name: r'as_of',
required: true,
includeIfNull: false,
)
final DateTime asOf;
/// decimal as string
@JsonKey(
name: r'assumed_rate',
required: true,
includeIfNull: true,
)
final String? assumedRate;
@JsonKey(
name: r'basis',
required: true,
includeIfNull: false,
)
final String basis;
/// decimal as string
@JsonKey(
name: r'current_value_rub',
required: true,
includeIfNull: false,
)
final String currentValueRub;
@JsonKey(
name: r'goal_id',
required: true,
includeIfNull: false,
)
final int goalId;
/// decimal as string
@JsonKey(
name: r'monthly_needed_rub',
required: true,
includeIfNull: true,
)
final String? monthlyNeededRub;
@JsonKey(
name: r'on_track',
required: true,
includeIfNull: true,
)
final bool? onTrack;
/// decimal as string
@JsonKey(
name: r'progress',
required: true,
includeIfNull: false,
)
final String progress;
@JsonKey(
name: r'projected_date',
required: true,
includeIfNull: true,
)
final DateTime? projectedDate;
/// decimal as string
@JsonKey(
name: r'target_amount_rub',
required: true,
includeIfNull: false,
)
final String targetAmountRub;
@override
bool operator ==(Object other) => identical(this, other) || other is GoalProgressOut &&
other.asOf == asOf &&
other.assumedRate == assumedRate &&
other.basis == basis &&
other.currentValueRub == currentValueRub &&
other.goalId == goalId &&
other.monthlyNeededRub == monthlyNeededRub &&
other.onTrack == onTrack &&
other.progress == progress &&
other.projectedDate == projectedDate &&
other.targetAmountRub == targetAmountRub;
@override
int get hashCode =>
asOf.hashCode +
(assumedRate == null ? 0 : assumedRate.hashCode) +
basis.hashCode +
currentValueRub.hashCode +
goalId.hashCode +
(monthlyNeededRub == null ? 0 : monthlyNeededRub.hashCode) +
(onTrack == null ? 0 : onTrack.hashCode) +
progress.hashCode +
(projectedDate == null ? 0 : projectedDate.hashCode) +
targetAmountRub.hashCode;
factory GoalProgressOut.fromJson(Map<String, dynamic> json) => _$GoalProgressOutFromJson(json);
Map<String, dynamic> toJson() => _$GoalProgressOutToJson(this);
@override
String toString() {
return toJson().toString();
}
}
@@ -0,0 +1,230 @@
// GENERATED CODE - DO NOT MODIFY BY HAND
part of 'goal_progress_out.dart';
// **************************************************************************
// CopyWithGenerator
// **************************************************************************
abstract class _$GoalProgressOutCWProxy {
GoalProgressOut asOf(DateTime asOf);
GoalProgressOut assumedRate(String? assumedRate);
GoalProgressOut basis(String basis);
GoalProgressOut currentValueRub(String currentValueRub);
GoalProgressOut goalId(int goalId);
GoalProgressOut monthlyNeededRub(String? monthlyNeededRub);
GoalProgressOut onTrack(bool? onTrack);
GoalProgressOut progress(String progress);
GoalProgressOut projectedDate(DateTime? projectedDate);
GoalProgressOut targetAmountRub(String targetAmountRub);
/// This function **does support** nullification of nullable fields. All `null` values passed to `non-nullable` fields will be ignored. You can also use `GoalProgressOut(...).copyWith.fieldName(...)` to override fields one at a time with nullification support.
///
/// Usage
/// ```dart
/// GoalProgressOut(...).copyWith(id: 12, name: "My name")
/// ````
GoalProgressOut call({
DateTime asOf,
String? assumedRate,
String basis,
String currentValueRub,
int goalId,
String? monthlyNeededRub,
bool? onTrack,
String progress,
DateTime? projectedDate,
String targetAmountRub,
});
}
/// Proxy class for `copyWith` functionality. This is a callable class and can be used as follows: `instanceOfGoalProgressOut.copyWith(...)`. Additionally contains functions for specific fields e.g. `instanceOfGoalProgressOut.copyWith.fieldName(...)`
class _$GoalProgressOutCWProxyImpl implements _$GoalProgressOutCWProxy {
const _$GoalProgressOutCWProxyImpl(this._value);
final GoalProgressOut _value;
@override
GoalProgressOut asOf(DateTime asOf) => this(asOf: asOf);
@override
GoalProgressOut assumedRate(String? assumedRate) =>
this(assumedRate: assumedRate);
@override
GoalProgressOut basis(String basis) => this(basis: basis);
@override
GoalProgressOut currentValueRub(String currentValueRub) =>
this(currentValueRub: currentValueRub);
@override
GoalProgressOut goalId(int goalId) => this(goalId: goalId);
@override
GoalProgressOut monthlyNeededRub(String? monthlyNeededRub) =>
this(monthlyNeededRub: monthlyNeededRub);
@override
GoalProgressOut onTrack(bool? onTrack) => this(onTrack: onTrack);
@override
GoalProgressOut progress(String progress) => this(progress: progress);
@override
GoalProgressOut projectedDate(DateTime? projectedDate) =>
this(projectedDate: projectedDate);
@override
GoalProgressOut targetAmountRub(String targetAmountRub) =>
this(targetAmountRub: targetAmountRub);
@override
/// This function **does support** nullification of nullable fields. All `null` values passed to `non-nullable` fields will be ignored. You can also use `GoalProgressOut(...).copyWith.fieldName(...)` to override fields one at a time with nullification support.
///
/// Usage
/// ```dart
/// GoalProgressOut(...).copyWith(id: 12, name: "My name")
/// ````
GoalProgressOut call({
Object? asOf = const $CopyWithPlaceholder(),
Object? assumedRate = const $CopyWithPlaceholder(),
Object? basis = const $CopyWithPlaceholder(),
Object? currentValueRub = const $CopyWithPlaceholder(),
Object? goalId = const $CopyWithPlaceholder(),
Object? monthlyNeededRub = const $CopyWithPlaceholder(),
Object? onTrack = const $CopyWithPlaceholder(),
Object? progress = const $CopyWithPlaceholder(),
Object? projectedDate = const $CopyWithPlaceholder(),
Object? targetAmountRub = const $CopyWithPlaceholder(),
}) {
return GoalProgressOut(
asOf: asOf == const $CopyWithPlaceholder()
? _value.asOf
// ignore: cast_nullable_to_non_nullable
: asOf as DateTime,
assumedRate: assumedRate == const $CopyWithPlaceholder()
? _value.assumedRate
// ignore: cast_nullable_to_non_nullable
: assumedRate as String?,
basis: basis == const $CopyWithPlaceholder()
? _value.basis
// ignore: cast_nullable_to_non_nullable
: basis as String,
currentValueRub: currentValueRub == const $CopyWithPlaceholder()
? _value.currentValueRub
// ignore: cast_nullable_to_non_nullable
: currentValueRub as String,
goalId: goalId == const $CopyWithPlaceholder()
? _value.goalId
// ignore: cast_nullable_to_non_nullable
: goalId as int,
monthlyNeededRub: monthlyNeededRub == const $CopyWithPlaceholder()
? _value.monthlyNeededRub
// ignore: cast_nullable_to_non_nullable
: monthlyNeededRub as String?,
onTrack: onTrack == const $CopyWithPlaceholder()
? _value.onTrack
// ignore: cast_nullable_to_non_nullable
: onTrack as bool?,
progress: progress == const $CopyWithPlaceholder()
? _value.progress
// ignore: cast_nullable_to_non_nullable
: progress as String,
projectedDate: projectedDate == const $CopyWithPlaceholder()
? _value.projectedDate
// ignore: cast_nullable_to_non_nullable
: projectedDate as DateTime?,
targetAmountRub: targetAmountRub == const $CopyWithPlaceholder()
? _value.targetAmountRub
// ignore: cast_nullable_to_non_nullable
: targetAmountRub as String,
);
}
}
extension $GoalProgressOutCopyWith on GoalProgressOut {
/// Returns a callable class that can be used as follows: `instanceOfGoalProgressOut.copyWith(...)` or like so:`instanceOfGoalProgressOut.copyWith.fieldName(...)`.
// ignore: library_private_types_in_public_api
_$GoalProgressOutCWProxy get copyWith => _$GoalProgressOutCWProxyImpl(this);
}
// **************************************************************************
// JsonSerializableGenerator
// **************************************************************************
GoalProgressOut _$GoalProgressOutFromJson(
Map<String, dynamic> json,
) => $checkedCreate(
'GoalProgressOut',
json,
($checkedConvert) {
$checkKeys(
json,
requiredKeys: const [
'as_of',
'assumed_rate',
'basis',
'current_value_rub',
'goal_id',
'monthly_needed_rub',
'on_track',
'progress',
'projected_date',
'target_amount_rub',
],
);
final val = GoalProgressOut(
asOf: $checkedConvert('as_of', (v) => DateTime.parse(v as String)),
assumedRate: $checkedConvert('assumed_rate', (v) => v as String?),
basis: $checkedConvert('basis', (v) => v as String),
currentValueRub: $checkedConvert('current_value_rub', (v) => v as String),
goalId: $checkedConvert('goal_id', (v) => (v as num).toInt()),
monthlyNeededRub: $checkedConvert(
'monthly_needed_rub',
(v) => v as String?,
),
onTrack: $checkedConvert('on_track', (v) => v as bool?),
progress: $checkedConvert('progress', (v) => v as String),
projectedDate: $checkedConvert(
'projected_date',
(v) => v == null ? null : DateTime.parse(v as String),
),
targetAmountRub: $checkedConvert('target_amount_rub', (v) => v as String),
);
return val;
},
fieldKeyMap: const {
'asOf': 'as_of',
'assumedRate': 'assumed_rate',
'currentValueRub': 'current_value_rub',
'goalId': 'goal_id',
'monthlyNeededRub': 'monthly_needed_rub',
'onTrack': 'on_track',
'projectedDate': 'projected_date',
'targetAmountRub': 'target_amount_rub',
},
);
Map<String, dynamic> _$GoalProgressOutToJson(GoalProgressOut instance) =>
<String, dynamic>{
'as_of': instance.asOf.toIso8601String(),
'assumed_rate': instance.assumedRate,
'basis': instance.basis,
'current_value_rub': instance.currentValueRub,
'goal_id': instance.goalId,
'monthly_needed_rub': instance.monthlyNeededRub,
'on_track': instance.onTrack,
'progress': instance.progress,
'projected_date': instance.projectedDate?.toIso8601String(),
'target_amount_rub': instance.targetAmountRub,
};
@@ -0,0 +1,76 @@
//
// AUTO-GENERATED FILE, DO NOT MODIFY!
//
// ignore_for_file: unused_element
import 'package:fintracker_api/src/model/history_row.dart';
import 'package:fintracker_api/src/model/history_totals.dart';
import 'package:copy_with_extension/copy_with_extension.dart';
import 'package:json_annotation/json_annotation.dart';
part 'history_out.g.dart';
@CopyWith()
@JsonSerializable(
checked: true,
createToJson: true,
disallowUnrecognizedKeys: false,
explicitToJson: true,
)
class HistoryOut {
/// Returns a new [HistoryOut] instance.
HistoryOut({
required this.rows,
required this.totals,
});
@JsonKey(
name: r'rows',
required: true,
includeIfNull: false,
)
final List<HistoryRow> rows;
@JsonKey(
name: r'totals',
required: true,
includeIfNull: false,
)
final HistoryTotals totals;
@override
bool operator ==(Object other) => identical(this, other) || other is HistoryOut &&
other.rows == rows &&
other.totals == totals;
@override
int get hashCode =>
rows.hashCode +
totals.hashCode;
factory HistoryOut.fromJson(Map<String, dynamic> json) => _$HistoryOutFromJson(json);
Map<String, dynamic> toJson() => _$HistoryOutToJson(this);
@override
String toString() {
return toJson().toString();
}
}
@@ -0,0 +1,91 @@
// GENERATED CODE - DO NOT MODIFY BY HAND
part of 'history_out.dart';
// **************************************************************************
// CopyWithGenerator
// **************************************************************************
abstract class _$HistoryOutCWProxy {
HistoryOut rows(List<HistoryRow> rows);
HistoryOut totals(HistoryTotals totals);
/// This function **does support** nullification of nullable fields. All `null` values passed to `non-nullable` fields will be ignored. You can also use `HistoryOut(...).copyWith.fieldName(...)` to override fields one at a time with nullification support.
///
/// Usage
/// ```dart
/// HistoryOut(...).copyWith(id: 12, name: "My name")
/// ````
HistoryOut call({List<HistoryRow> rows, HistoryTotals totals});
}
/// Proxy class for `copyWith` functionality. This is a callable class and can be used as follows: `instanceOfHistoryOut.copyWith(...)`. Additionally contains functions for specific fields e.g. `instanceOfHistoryOut.copyWith.fieldName(...)`
class _$HistoryOutCWProxyImpl implements _$HistoryOutCWProxy {
const _$HistoryOutCWProxyImpl(this._value);
final HistoryOut _value;
@override
HistoryOut rows(List<HistoryRow> rows) => this(rows: rows);
@override
HistoryOut totals(HistoryTotals totals) => this(totals: totals);
@override
/// This function **does support** nullification of nullable fields. All `null` values passed to `non-nullable` fields will be ignored. You can also use `HistoryOut(...).copyWith.fieldName(...)` to override fields one at a time with nullification support.
///
/// Usage
/// ```dart
/// HistoryOut(...).copyWith(id: 12, name: "My name")
/// ````
HistoryOut call({
Object? rows = const $CopyWithPlaceholder(),
Object? totals = const $CopyWithPlaceholder(),
}) {
return HistoryOut(
rows: rows == const $CopyWithPlaceholder()
? _value.rows
// ignore: cast_nullable_to_non_nullable
: rows as List<HistoryRow>,
totals: totals == const $CopyWithPlaceholder()
? _value.totals
// ignore: cast_nullable_to_non_nullable
: totals as HistoryTotals,
);
}
}
extension $HistoryOutCopyWith on HistoryOut {
/// Returns a callable class that can be used as follows: `instanceOfHistoryOut.copyWith(...)` or like so:`instanceOfHistoryOut.copyWith.fieldName(...)`.
// ignore: library_private_types_in_public_api
_$HistoryOutCWProxy get copyWith => _$HistoryOutCWProxyImpl(this);
}
// **************************************************************************
// JsonSerializableGenerator
// **************************************************************************
HistoryOut _$HistoryOutFromJson(Map<String, dynamic> json) =>
$checkedCreate('HistoryOut', json, ($checkedConvert) {
$checkKeys(json, requiredKeys: const ['rows', 'totals']);
final val = HistoryOut(
rows: $checkedConvert(
'rows',
(v) => (v as List<dynamic>)
.map((e) => HistoryRow.fromJson(e as Map<String, dynamic>))
.toList(),
),
totals: $checkedConvert(
'totals',
(v) => HistoryTotals.fromJson(v as Map<String, dynamic>),
),
);
return val;
});
Map<String, dynamic> _$HistoryOutToJson(HistoryOut instance) =>
<String, dynamic>{
'rows': instance.rows.map((e) => e.toJson()).toList(),
'totals': instance.totals.toJson(),
};
@@ -0,0 +1,157 @@
//
// AUTO-GENERATED FILE, DO NOT MODIFY!
//
// ignore_for_file: unused_element
import 'package:copy_with_extension/copy_with_extension.dart';
import 'package:json_annotation/json_annotation.dart';
part 'history_row.g.dart';
@CopyWith()
@JsonSerializable(
checked: true,
createToJson: true,
disallowUnrecognizedKeys: false,
explicitToJson: true,
)
class HistoryRow {
/// Returns a new [HistoryRow] instance.
HistoryRow({
required this.amount,
required this.amountRub,
required this.currency,
required this.kind,
required this.month,
required this.paymentCount,
required this.taxWithheld,
});
/// decimal as string
@JsonKey(
name: r'amount',
required: true,
includeIfNull: false,
)
final String amount;
/// decimal as string
@JsonKey(
name: r'amount_rub',
required: true,
includeIfNull: true,
)
final String? amountRub;
@JsonKey(
name: r'currency',
required: true,
includeIfNull: false,
)
final String currency;
@JsonKey(
name: r'kind',
required: true,
includeIfNull: false,
)
final String kind;
@JsonKey(
name: r'month',
required: true,
includeIfNull: false,
)
final DateTime month;
@JsonKey(
name: r'payment_count',
required: true,
includeIfNull: false,
)
final int paymentCount;
/// decimal as string
@JsonKey(
name: r'tax_withheld',
required: true,
includeIfNull: false,
)
final String taxWithheld;
@override
bool operator ==(Object other) => identical(this, other) || other is HistoryRow &&
other.amount == amount &&
other.amountRub == amountRub &&
other.currency == currency &&
other.kind == kind &&
other.month == month &&
other.paymentCount == paymentCount &&
other.taxWithheld == taxWithheld;
@override
int get hashCode =>
amount.hashCode +
(amountRub == null ? 0 : amountRub.hashCode) +
currency.hashCode +
kind.hashCode +
month.hashCode +
paymentCount.hashCode +
taxWithheld.hashCode;
factory HistoryRow.fromJson(Map<String, dynamic> json) => _$HistoryRowFromJson(json);
Map<String, dynamic> toJson() => _$HistoryRowToJson(this);
@override
String toString() {
return toJson().toString();
}
}
@@ -0,0 +1,170 @@
// GENERATED CODE - DO NOT MODIFY BY HAND
part of 'history_row.dart';
// **************************************************************************
// CopyWithGenerator
// **************************************************************************
abstract class _$HistoryRowCWProxy {
HistoryRow amount(String amount);
HistoryRow amountRub(String? amountRub);
HistoryRow currency(String currency);
HistoryRow kind(String kind);
HistoryRow month(DateTime month);
HistoryRow paymentCount(int paymentCount);
HistoryRow taxWithheld(String taxWithheld);
/// This function **does support** nullification of nullable fields. All `null` values passed to `non-nullable` fields will be ignored. You can also use `HistoryRow(...).copyWith.fieldName(...)` to override fields one at a time with nullification support.
///
/// Usage
/// ```dart
/// HistoryRow(...).copyWith(id: 12, name: "My name")
/// ````
HistoryRow call({
String amount,
String? amountRub,
String currency,
String kind,
DateTime month,
int paymentCount,
String taxWithheld,
});
}
/// Proxy class for `copyWith` functionality. This is a callable class and can be used as follows: `instanceOfHistoryRow.copyWith(...)`. Additionally contains functions for specific fields e.g. `instanceOfHistoryRow.copyWith.fieldName(...)`
class _$HistoryRowCWProxyImpl implements _$HistoryRowCWProxy {
const _$HistoryRowCWProxyImpl(this._value);
final HistoryRow _value;
@override
HistoryRow amount(String amount) => this(amount: amount);
@override
HistoryRow amountRub(String? amountRub) => this(amountRub: amountRub);
@override
HistoryRow currency(String currency) => this(currency: currency);
@override
HistoryRow kind(String kind) => this(kind: kind);
@override
HistoryRow month(DateTime month) => this(month: month);
@override
HistoryRow paymentCount(int paymentCount) => this(paymentCount: paymentCount);
@override
HistoryRow taxWithheld(String taxWithheld) => this(taxWithheld: taxWithheld);
@override
/// This function **does support** nullification of nullable fields. All `null` values passed to `non-nullable` fields will be ignored. You can also use `HistoryRow(...).copyWith.fieldName(...)` to override fields one at a time with nullification support.
///
/// Usage
/// ```dart
/// HistoryRow(...).copyWith(id: 12, name: "My name")
/// ````
HistoryRow call({
Object? amount = const $CopyWithPlaceholder(),
Object? amountRub = const $CopyWithPlaceholder(),
Object? currency = const $CopyWithPlaceholder(),
Object? kind = const $CopyWithPlaceholder(),
Object? month = const $CopyWithPlaceholder(),
Object? paymentCount = const $CopyWithPlaceholder(),
Object? taxWithheld = const $CopyWithPlaceholder(),
}) {
return HistoryRow(
amount: amount == const $CopyWithPlaceholder()
? _value.amount
// ignore: cast_nullable_to_non_nullable
: amount as String,
amountRub: amountRub == const $CopyWithPlaceholder()
? _value.amountRub
// ignore: cast_nullable_to_non_nullable
: amountRub as String?,
currency: currency == const $CopyWithPlaceholder()
? _value.currency
// ignore: cast_nullable_to_non_nullable
: currency as String,
kind: kind == const $CopyWithPlaceholder()
? _value.kind
// ignore: cast_nullable_to_non_nullable
: kind as String,
month: month == const $CopyWithPlaceholder()
? _value.month
// ignore: cast_nullable_to_non_nullable
: month as DateTime,
paymentCount: paymentCount == const $CopyWithPlaceholder()
? _value.paymentCount
// ignore: cast_nullable_to_non_nullable
: paymentCount as int,
taxWithheld: taxWithheld == const $CopyWithPlaceholder()
? _value.taxWithheld
// ignore: cast_nullable_to_non_nullable
: taxWithheld as String,
);
}
}
extension $HistoryRowCopyWith on HistoryRow {
/// Returns a callable class that can be used as follows: `instanceOfHistoryRow.copyWith(...)` or like so:`instanceOfHistoryRow.copyWith.fieldName(...)`.
// ignore: library_private_types_in_public_api
_$HistoryRowCWProxy get copyWith => _$HistoryRowCWProxyImpl(this);
}
// **************************************************************************
// JsonSerializableGenerator
// **************************************************************************
HistoryRow _$HistoryRowFromJson(Map<String, dynamic> json) => $checkedCreate(
'HistoryRow',
json,
($checkedConvert) {
$checkKeys(
json,
requiredKeys: const [
'amount',
'amount_rub',
'currency',
'kind',
'month',
'payment_count',
'tax_withheld',
],
);
final val = HistoryRow(
amount: $checkedConvert('amount', (v) => v as String),
amountRub: $checkedConvert('amount_rub', (v) => v as String?),
currency: $checkedConvert('currency', (v) => v as String),
kind: $checkedConvert('kind', (v) => v as String),
month: $checkedConvert('month', (v) => DateTime.parse(v as String)),
paymentCount: $checkedConvert('payment_count', (v) => (v as num).toInt()),
taxWithheld: $checkedConvert('tax_withheld', (v) => v as String),
);
return val;
},
fieldKeyMap: const {
'amountRub': 'amount_rub',
'paymentCount': 'payment_count',
'taxWithheld': 'tax_withheld',
},
);
Map<String, dynamic> _$HistoryRowToJson(HistoryRow instance) =>
<String, dynamic>{
'amount': instance.amount,
'amount_rub': instance.amountRub,
'currency': instance.currency,
'kind': instance.kind,
'month': instance.month.toIso8601String(),
'payment_count': instance.paymentCount,
'tax_withheld': instance.taxWithheld,
};
@@ -0,0 +1,76 @@
//
// AUTO-GENERATED FILE, DO NOT MODIFY!
//
// ignore_for_file: unused_element
import 'package:copy_with_extension/copy_with_extension.dart';
import 'package:json_annotation/json_annotation.dart';
part 'history_totals.g.dart';
@CopyWith()
@JsonSerializable(
checked: true,
createToJson: true,
disallowUnrecognizedKeys: false,
explicitToJson: true,
)
class HistoryTotals {
/// Returns a new [HistoryTotals] instance.
HistoryTotals({
required this.amountRub,
required this.taxWithheldRub,
});
/// decimal as string
@JsonKey(
name: r'amount_rub',
required: true,
includeIfNull: false,
)
final String amountRub;
/// decimal as string
@JsonKey(
name: r'tax_withheld_rub',
required: true,
includeIfNull: false,
)
final String taxWithheldRub;
@override
bool operator ==(Object other) => identical(this, other) || other is HistoryTotals &&
other.amountRub == amountRub &&
other.taxWithheldRub == taxWithheldRub;
@override
int get hashCode =>
amountRub.hashCode +
taxWithheldRub.hashCode;
factory HistoryTotals.fromJson(Map<String, dynamic> json) => _$HistoryTotalsFromJson(json);
Map<String, dynamic> toJson() => _$HistoryTotalsToJson(this);
@override
String toString() {
return toJson().toString();
}
}
@@ -0,0 +1,93 @@
// GENERATED CODE - DO NOT MODIFY BY HAND
part of 'history_totals.dart';
// **************************************************************************
// CopyWithGenerator
// **************************************************************************
abstract class _$HistoryTotalsCWProxy {
HistoryTotals amountRub(String amountRub);
HistoryTotals taxWithheldRub(String taxWithheldRub);
/// This function **does support** nullification of nullable fields. All `null` values passed to `non-nullable` fields will be ignored. You can also use `HistoryTotals(...).copyWith.fieldName(...)` to override fields one at a time with nullification support.
///
/// Usage
/// ```dart
/// HistoryTotals(...).copyWith(id: 12, name: "My name")
/// ````
HistoryTotals call({String amountRub, String taxWithheldRub});
}
/// Proxy class for `copyWith` functionality. This is a callable class and can be used as follows: `instanceOfHistoryTotals.copyWith(...)`. Additionally contains functions for specific fields e.g. `instanceOfHistoryTotals.copyWith.fieldName(...)`
class _$HistoryTotalsCWProxyImpl implements _$HistoryTotalsCWProxy {
const _$HistoryTotalsCWProxyImpl(this._value);
final HistoryTotals _value;
@override
HistoryTotals amountRub(String amountRub) => this(amountRub: amountRub);
@override
HistoryTotals taxWithheldRub(String taxWithheldRub) =>
this(taxWithheldRub: taxWithheldRub);
@override
/// This function **does support** nullification of nullable fields. All `null` values passed to `non-nullable` fields will be ignored. You can also use `HistoryTotals(...).copyWith.fieldName(...)` to override fields one at a time with nullification support.
///
/// Usage
/// ```dart
/// HistoryTotals(...).copyWith(id: 12, name: "My name")
/// ````
HistoryTotals call({
Object? amountRub = const $CopyWithPlaceholder(),
Object? taxWithheldRub = const $CopyWithPlaceholder(),
}) {
return HistoryTotals(
amountRub: amountRub == const $CopyWithPlaceholder()
? _value.amountRub
// ignore: cast_nullable_to_non_nullable
: amountRub as String,
taxWithheldRub: taxWithheldRub == const $CopyWithPlaceholder()
? _value.taxWithheldRub
// ignore: cast_nullable_to_non_nullable
: taxWithheldRub as String,
);
}
}
extension $HistoryTotalsCopyWith on HistoryTotals {
/// Returns a callable class that can be used as follows: `instanceOfHistoryTotals.copyWith(...)` or like so:`instanceOfHistoryTotals.copyWith.fieldName(...)`.
// ignore: library_private_types_in_public_api
_$HistoryTotalsCWProxy get copyWith => _$HistoryTotalsCWProxyImpl(this);
}
// **************************************************************************
// JsonSerializableGenerator
// **************************************************************************
HistoryTotals _$HistoryTotalsFromJson(
Map<String, dynamic> json,
) => $checkedCreate(
'HistoryTotals',
json,
($checkedConvert) {
$checkKeys(json, requiredKeys: const ['amount_rub', 'tax_withheld_rub']);
final val = HistoryTotals(
amountRub: $checkedConvert('amount_rub', (v) => v as String),
taxWithheldRub: $checkedConvert('tax_withheld_rub', (v) => v as String),
);
return val;
},
fieldKeyMap: const {
'amountRub': 'amount_rub',
'taxWithheldRub': 'tax_withheld_rub',
},
);
Map<String, dynamic> _$HistoryTotalsToJson(HistoryTotals instance) =>
<String, dynamic>{
'amount_rub': instance.amountRub,
'tax_withheld_rub': instance.taxWithheldRub,
};
@@ -0,0 +1,154 @@
//
// AUTO-GENERATED FILE, DO NOT MODIFY!
//
// ignore_for_file: unused_element
import 'package:copy_with_extension/copy_with_extension.dart';
import 'package:json_annotation/json_annotation.dart';
part 'import_counts.g.dart';
@CopyWith()
@JsonSerializable(
checked: true,
createToJson: true,
disallowUnrecognizedKeys: false,
explicitToJson: true,
)
class ImportCounts {
/// Returns a new [ImportCounts] instance.
ImportCounts({
required this.byKind,
required this.eventsDuplicate,
required this.eventsNew,
required this.eventsPending,
required this.eventsShadow,
required this.eventsTotal,
required this.lines,
});
@JsonKey(
name: r'by_kind',
required: true,
includeIfNull: false,
)
final Map<String, int> byKind;
@JsonKey(
name: r'events_duplicate',
required: true,
includeIfNull: false,
)
final int eventsDuplicate;
@JsonKey(
name: r'events_new',
required: true,
includeIfNull: false,
)
final int eventsNew;
@JsonKey(
name: r'events_pending',
required: true,
includeIfNull: false,
)
final int eventsPending;
@JsonKey(
name: r'events_shadow',
required: true,
includeIfNull: false,
)
final int eventsShadow;
@JsonKey(
name: r'events_total',
required: true,
includeIfNull: false,
)
final int eventsTotal;
@JsonKey(
name: r'lines',
required: true,
includeIfNull: false,
)
final int lines;
@override
bool operator ==(Object other) => identical(this, other) || other is ImportCounts &&
other.byKind == byKind &&
other.eventsDuplicate == eventsDuplicate &&
other.eventsNew == eventsNew &&
other.eventsPending == eventsPending &&
other.eventsShadow == eventsShadow &&
other.eventsTotal == eventsTotal &&
other.lines == lines;
@override
int get hashCode =>
byKind.hashCode +
eventsDuplicate.hashCode +
eventsNew.hashCode +
eventsPending.hashCode +
eventsShadow.hashCode +
eventsTotal.hashCode +
lines.hashCode;
factory ImportCounts.fromJson(Map<String, dynamic> json) => _$ImportCountsFromJson(json);
Map<String, dynamic> toJson() => _$ImportCountsToJson(this);
@override
String toString() {
return toJson().toString();
}
}
@@ -0,0 +1,187 @@
// GENERATED CODE - DO NOT MODIFY BY HAND
part of 'import_counts.dart';
// **************************************************************************
// CopyWithGenerator
// **************************************************************************
abstract class _$ImportCountsCWProxy {
ImportCounts byKind(Map<String, int> byKind);
ImportCounts eventsDuplicate(int eventsDuplicate);
ImportCounts eventsNew(int eventsNew);
ImportCounts eventsPending(int eventsPending);
ImportCounts eventsShadow(int eventsShadow);
ImportCounts eventsTotal(int eventsTotal);
ImportCounts lines(int lines);
/// This function **does support** nullification of nullable fields. All `null` values passed to `non-nullable` fields will be ignored. You can also use `ImportCounts(...).copyWith.fieldName(...)` to override fields one at a time with nullification support.
///
/// Usage
/// ```dart
/// ImportCounts(...).copyWith(id: 12, name: "My name")
/// ````
ImportCounts call({
Map<String, int> byKind,
int eventsDuplicate,
int eventsNew,
int eventsPending,
int eventsShadow,
int eventsTotal,
int lines,
});
}
/// Proxy class for `copyWith` functionality. This is a callable class and can be used as follows: `instanceOfImportCounts.copyWith(...)`. Additionally contains functions for specific fields e.g. `instanceOfImportCounts.copyWith.fieldName(...)`
class _$ImportCountsCWProxyImpl implements _$ImportCountsCWProxy {
const _$ImportCountsCWProxyImpl(this._value);
final ImportCounts _value;
@override
ImportCounts byKind(Map<String, int> byKind) => this(byKind: byKind);
@override
ImportCounts eventsDuplicate(int eventsDuplicate) =>
this(eventsDuplicate: eventsDuplicate);
@override
ImportCounts eventsNew(int eventsNew) => this(eventsNew: eventsNew);
@override
ImportCounts eventsPending(int eventsPending) =>
this(eventsPending: eventsPending);
@override
ImportCounts eventsShadow(int eventsShadow) =>
this(eventsShadow: eventsShadow);
@override
ImportCounts eventsTotal(int eventsTotal) => this(eventsTotal: eventsTotal);
@override
ImportCounts lines(int lines) => this(lines: lines);
@override
/// This function **does support** nullification of nullable fields. All `null` values passed to `non-nullable` fields will be ignored. You can also use `ImportCounts(...).copyWith.fieldName(...)` to override fields one at a time with nullification support.
///
/// Usage
/// ```dart
/// ImportCounts(...).copyWith(id: 12, name: "My name")
/// ````
ImportCounts call({
Object? byKind = const $CopyWithPlaceholder(),
Object? eventsDuplicate = const $CopyWithPlaceholder(),
Object? eventsNew = const $CopyWithPlaceholder(),
Object? eventsPending = const $CopyWithPlaceholder(),
Object? eventsShadow = const $CopyWithPlaceholder(),
Object? eventsTotal = const $CopyWithPlaceholder(),
Object? lines = const $CopyWithPlaceholder(),
}) {
return ImportCounts(
byKind: byKind == const $CopyWithPlaceholder()
? _value.byKind
// ignore: cast_nullable_to_non_nullable
: byKind as Map<String, int>,
eventsDuplicate: eventsDuplicate == const $CopyWithPlaceholder()
? _value.eventsDuplicate
// ignore: cast_nullable_to_non_nullable
: eventsDuplicate as int,
eventsNew: eventsNew == const $CopyWithPlaceholder()
? _value.eventsNew
// ignore: cast_nullable_to_non_nullable
: eventsNew as int,
eventsPending: eventsPending == const $CopyWithPlaceholder()
? _value.eventsPending
// ignore: cast_nullable_to_non_nullable
: eventsPending as int,
eventsShadow: eventsShadow == const $CopyWithPlaceholder()
? _value.eventsShadow
// ignore: cast_nullable_to_non_nullable
: eventsShadow as int,
eventsTotal: eventsTotal == const $CopyWithPlaceholder()
? _value.eventsTotal
// ignore: cast_nullable_to_non_nullable
: eventsTotal as int,
lines: lines == const $CopyWithPlaceholder()
? _value.lines
// ignore: cast_nullable_to_non_nullable
: lines as int,
);
}
}
extension $ImportCountsCopyWith on ImportCounts {
/// Returns a callable class that can be used as follows: `instanceOfImportCounts.copyWith(...)` or like so:`instanceOfImportCounts.copyWith.fieldName(...)`.
// ignore: library_private_types_in_public_api
_$ImportCountsCWProxy get copyWith => _$ImportCountsCWProxyImpl(this);
}
// **************************************************************************
// JsonSerializableGenerator
// **************************************************************************
ImportCounts _$ImportCountsFromJson(
Map<String, dynamic> json,
) => $checkedCreate(
'ImportCounts',
json,
($checkedConvert) {
$checkKeys(
json,
requiredKeys: const [
'by_kind',
'events_duplicate',
'events_new',
'events_pending',
'events_shadow',
'events_total',
'lines',
],
);
final val = ImportCounts(
byKind: $checkedConvert(
'by_kind',
(v) => Map<String, int>.from(v as Map),
),
eventsDuplicate: $checkedConvert(
'events_duplicate',
(v) => (v as num).toInt(),
),
eventsNew: $checkedConvert('events_new', (v) => (v as num).toInt()),
eventsPending: $checkedConvert(
'events_pending',
(v) => (v as num).toInt(),
),
eventsShadow: $checkedConvert('events_shadow', (v) => (v as num).toInt()),
eventsTotal: $checkedConvert('events_total', (v) => (v as num).toInt()),
lines: $checkedConvert('lines', (v) => (v as num).toInt()),
);
return val;
},
fieldKeyMap: const {
'byKind': 'by_kind',
'eventsDuplicate': 'events_duplicate',
'eventsNew': 'events_new',
'eventsPending': 'events_pending',
'eventsShadow': 'events_shadow',
'eventsTotal': 'events_total',
},
);
Map<String, dynamic> _$ImportCountsToJson(ImportCounts instance) =>
<String, dynamic>{
'by_kind': instance.byKind,
'events_duplicate': instance.eventsDuplicate,
'events_new': instance.eventsNew,
'events_pending': instance.eventsPending,
'events_shadow': instance.eventsShadow,
'events_total': instance.eventsTotal,
'lines': instance.lines,
};
@@ -0,0 +1,415 @@
//
// AUTO-GENERATED FILE, DO NOT MODIFY!
//
// ignore_for_file: unused_element
import 'package:fintracker_api/src/model/pending_instrument_out.dart';
import 'package:fintracker_api/src/model/import_counts.dart';
import 'package:fintracker_api/src/model/sample_event_out.dart';
import 'package:fintracker_api/src/model/reconciliation_out.dart';
import 'package:fintracker_api/src/model/account_suggestion.dart';
import 'package:copy_with_extension/copy_with_extension.dart';
import 'package:json_annotation/json_annotation.dart';
part 'import_preview.g.dart';
@CopyWith()
@JsonSerializable(
checked: true,
createToJson: true,
disallowUnrecognizedKeys: false,
explicitToJson: true,
)
class ImportPreview {
/// Returns a new [ImportPreview] instance.
ImportPreview({
this.accountExternalId,
this.accountId,
this.accountName,
this.accountSuggestions,
required this.broker,
this.committedAt,
required this.counts,
this.duplicateOfId,
this.error,
required this.filename,
required this.id,
required this.parseStatus,
this.parserName,
this.parserVersion,
this.pendingInstruments,
this.periodFrom,
this.periodTo,
required this.reconciliation,
this.sampleEvents,
required this.sha256,
required this.sizeBytes,
this.uploadedAt,
this.warnings,
});
@JsonKey(
name: r'account_external_id',
required: false,
includeIfNull: false,
)
final String? accountExternalId;
@JsonKey(
name: r'account_id',
required: false,
includeIfNull: false,
)
final int? accountId;
@JsonKey(
name: r'account_name',
required: false,
includeIfNull: false,
)
final String? accountName;
@JsonKey(
name: r'account_suggestions',
required: false,
includeIfNull: false,
)
final List<AccountSuggestion>? accountSuggestions;
@JsonKey(
name: r'broker',
required: true,
includeIfNull: false,
)
final String broker;
@JsonKey(
name: r'committed_at',
required: false,
includeIfNull: false,
)
final DateTime? committedAt;
@JsonKey(
name: r'counts',
required: true,
includeIfNull: false,
)
final ImportCounts counts;
@JsonKey(
name: r'duplicate_of_id',
required: false,
includeIfNull: false,
)
final int? duplicateOfId;
@JsonKey(
name: r'error',
required: false,
includeIfNull: false,
)
final String? error;
@JsonKey(
name: r'filename',
required: true,
includeIfNull: false,
)
final String filename;
@JsonKey(
name: r'id',
required: true,
includeIfNull: false,
)
final int id;
@JsonKey(
name: r'parse_status',
required: true,
includeIfNull: false,
)
final String parseStatus;
@JsonKey(
name: r'parser_name',
required: false,
includeIfNull: false,
)
final String? parserName;
@JsonKey(
name: r'parser_version',
required: false,
includeIfNull: false,
)
final String? parserVersion;
@JsonKey(
name: r'pending_instruments',
required: false,
includeIfNull: false,
)
final List<PendingInstrumentOut>? pendingInstruments;
@JsonKey(
name: r'period_from',
required: false,
includeIfNull: false,
)
final DateTime? periodFrom;
@JsonKey(
name: r'period_to',
required: false,
includeIfNull: false,
)
final DateTime? periodTo;
@JsonKey(
name: r'reconciliation',
required: true,
includeIfNull: false,
)
final ReconciliationOut reconciliation;
@JsonKey(
name: r'sample_events',
required: false,
includeIfNull: false,
)
final List<SampleEventOut>? sampleEvents;
@JsonKey(
name: r'sha256',
required: true,
includeIfNull: false,
)
final String sha256;
@JsonKey(
name: r'size_bytes',
required: true,
includeIfNull: false,
)
final int sizeBytes;
@JsonKey(
name: r'uploaded_at',
required: false,
includeIfNull: false,
)
final DateTime? uploadedAt;
@JsonKey(
name: r'warnings',
required: false,
includeIfNull: false,
)
final List<String>? warnings;
@override
bool operator ==(Object other) => identical(this, other) || other is ImportPreview &&
other.accountExternalId == accountExternalId &&
other.accountId == accountId &&
other.accountName == accountName &&
other.accountSuggestions == accountSuggestions &&
other.broker == broker &&
other.committedAt == committedAt &&
other.counts == counts &&
other.duplicateOfId == duplicateOfId &&
other.error == error &&
other.filename == filename &&
other.id == id &&
other.parseStatus == parseStatus &&
other.parserName == parserName &&
other.parserVersion == parserVersion &&
other.pendingInstruments == pendingInstruments &&
other.periodFrom == periodFrom &&
other.periodTo == periodTo &&
other.reconciliation == reconciliation &&
other.sampleEvents == sampleEvents &&
other.sha256 == sha256 &&
other.sizeBytes == sizeBytes &&
other.uploadedAt == uploadedAt &&
other.warnings == warnings;
@override
int get hashCode =>
(accountExternalId == null ? 0 : accountExternalId.hashCode) +
(accountId == null ? 0 : accountId.hashCode) +
(accountName == null ? 0 : accountName.hashCode) +
accountSuggestions.hashCode +
broker.hashCode +
(committedAt == null ? 0 : committedAt.hashCode) +
counts.hashCode +
(duplicateOfId == null ? 0 : duplicateOfId.hashCode) +
(error == null ? 0 : error.hashCode) +
filename.hashCode +
id.hashCode +
parseStatus.hashCode +
(parserName == null ? 0 : parserName.hashCode) +
(parserVersion == null ? 0 : parserVersion.hashCode) +
pendingInstruments.hashCode +
(periodFrom == null ? 0 : periodFrom.hashCode) +
(periodTo == null ? 0 : periodTo.hashCode) +
reconciliation.hashCode +
sampleEvents.hashCode +
sha256.hashCode +
sizeBytes.hashCode +
(uploadedAt == null ? 0 : uploadedAt.hashCode) +
warnings.hashCode;
factory ImportPreview.fromJson(Map<String, dynamic> json) => _$ImportPreviewFromJson(json);
Map<String, dynamic> toJson() => _$ImportPreviewToJson(this);
@override
String toString() {
return toJson().toString();
}
}
@@ -0,0 +1,459 @@
// GENERATED CODE - DO NOT MODIFY BY HAND
part of 'import_preview.dart';
// **************************************************************************
// CopyWithGenerator
// **************************************************************************
abstract class _$ImportPreviewCWProxy {
ImportPreview accountExternalId(String? accountExternalId);
ImportPreview accountId(int? accountId);
ImportPreview accountName(String? accountName);
ImportPreview accountSuggestions(List<AccountSuggestion>? accountSuggestions);
ImportPreview broker(String broker);
ImportPreview committedAt(DateTime? committedAt);
ImportPreview counts(ImportCounts counts);
ImportPreview duplicateOfId(int? duplicateOfId);
ImportPreview error(String? error);
ImportPreview filename(String filename);
ImportPreview id(int id);
ImportPreview parseStatus(String parseStatus);
ImportPreview parserName(String? parserName);
ImportPreview parserVersion(String? parserVersion);
ImportPreview pendingInstruments(
List<PendingInstrumentOut>? pendingInstruments,
);
ImportPreview periodFrom(DateTime? periodFrom);
ImportPreview periodTo(DateTime? periodTo);
ImportPreview reconciliation(ReconciliationOut reconciliation);
ImportPreview sampleEvents(List<SampleEventOut>? sampleEvents);
ImportPreview sha256(String sha256);
ImportPreview sizeBytes(int sizeBytes);
ImportPreview uploadedAt(DateTime? uploadedAt);
ImportPreview warnings(List<String>? warnings);
/// This function **does support** nullification of nullable fields. All `null` values passed to `non-nullable` fields will be ignored. You can also use `ImportPreview(...).copyWith.fieldName(...)` to override fields one at a time with nullification support.
///
/// Usage
/// ```dart
/// ImportPreview(...).copyWith(id: 12, name: "My name")
/// ````
ImportPreview call({
String? accountExternalId,
int? accountId,
String? accountName,
List<AccountSuggestion>? accountSuggestions,
String broker,
DateTime? committedAt,
ImportCounts counts,
int? duplicateOfId,
String? error,
String filename,
int id,
String parseStatus,
String? parserName,
String? parserVersion,
List<PendingInstrumentOut>? pendingInstruments,
DateTime? periodFrom,
DateTime? periodTo,
ReconciliationOut reconciliation,
List<SampleEventOut>? sampleEvents,
String sha256,
int sizeBytes,
DateTime? uploadedAt,
List<String>? warnings,
});
}
/// Proxy class for `copyWith` functionality. This is a callable class and can be used as follows: `instanceOfImportPreview.copyWith(...)`. Additionally contains functions for specific fields e.g. `instanceOfImportPreview.copyWith.fieldName(...)`
class _$ImportPreviewCWProxyImpl implements _$ImportPreviewCWProxy {
const _$ImportPreviewCWProxyImpl(this._value);
final ImportPreview _value;
@override
ImportPreview accountExternalId(String? accountExternalId) =>
this(accountExternalId: accountExternalId);
@override
ImportPreview accountId(int? accountId) => this(accountId: accountId);
@override
ImportPreview accountName(String? accountName) =>
this(accountName: accountName);
@override
ImportPreview accountSuggestions(
List<AccountSuggestion>? accountSuggestions,
) => this(accountSuggestions: accountSuggestions);
@override
ImportPreview broker(String broker) => this(broker: broker);
@override
ImportPreview committedAt(DateTime? committedAt) =>
this(committedAt: committedAt);
@override
ImportPreview counts(ImportCounts counts) => this(counts: counts);
@override
ImportPreview duplicateOfId(int? duplicateOfId) =>
this(duplicateOfId: duplicateOfId);
@override
ImportPreview error(String? error) => this(error: error);
@override
ImportPreview filename(String filename) => this(filename: filename);
@override
ImportPreview id(int id) => this(id: id);
@override
ImportPreview parseStatus(String parseStatus) =>
this(parseStatus: parseStatus);
@override
ImportPreview parserName(String? parserName) => this(parserName: parserName);
@override
ImportPreview parserVersion(String? parserVersion) =>
this(parserVersion: parserVersion);
@override
ImportPreview pendingInstruments(
List<PendingInstrumentOut>? pendingInstruments,
) => this(pendingInstruments: pendingInstruments);
@override
ImportPreview periodFrom(DateTime? periodFrom) =>
this(periodFrom: periodFrom);
@override
ImportPreview periodTo(DateTime? periodTo) => this(periodTo: periodTo);
@override
ImportPreview reconciliation(ReconciliationOut reconciliation) =>
this(reconciliation: reconciliation);
@override
ImportPreview sampleEvents(List<SampleEventOut>? sampleEvents) =>
this(sampleEvents: sampleEvents);
@override
ImportPreview sha256(String sha256) => this(sha256: sha256);
@override
ImportPreview sizeBytes(int sizeBytes) => this(sizeBytes: sizeBytes);
@override
ImportPreview uploadedAt(DateTime? uploadedAt) =>
this(uploadedAt: uploadedAt);
@override
ImportPreview warnings(List<String>? warnings) => this(warnings: warnings);
@override
/// This function **does support** nullification of nullable fields. All `null` values passed to `non-nullable` fields will be ignored. You can also use `ImportPreview(...).copyWith.fieldName(...)` to override fields one at a time with nullification support.
///
/// Usage
/// ```dart
/// ImportPreview(...).copyWith(id: 12, name: "My name")
/// ````
ImportPreview call({
Object? accountExternalId = const $CopyWithPlaceholder(),
Object? accountId = const $CopyWithPlaceholder(),
Object? accountName = const $CopyWithPlaceholder(),
Object? accountSuggestions = const $CopyWithPlaceholder(),
Object? broker = const $CopyWithPlaceholder(),
Object? committedAt = const $CopyWithPlaceholder(),
Object? counts = const $CopyWithPlaceholder(),
Object? duplicateOfId = const $CopyWithPlaceholder(),
Object? error = const $CopyWithPlaceholder(),
Object? filename = const $CopyWithPlaceholder(),
Object? id = const $CopyWithPlaceholder(),
Object? parseStatus = const $CopyWithPlaceholder(),
Object? parserName = const $CopyWithPlaceholder(),
Object? parserVersion = const $CopyWithPlaceholder(),
Object? pendingInstruments = const $CopyWithPlaceholder(),
Object? periodFrom = const $CopyWithPlaceholder(),
Object? periodTo = const $CopyWithPlaceholder(),
Object? reconciliation = const $CopyWithPlaceholder(),
Object? sampleEvents = const $CopyWithPlaceholder(),
Object? sha256 = const $CopyWithPlaceholder(),
Object? sizeBytes = const $CopyWithPlaceholder(),
Object? uploadedAt = const $CopyWithPlaceholder(),
Object? warnings = const $CopyWithPlaceholder(),
}) {
return ImportPreview(
accountExternalId: accountExternalId == const $CopyWithPlaceholder()
? _value.accountExternalId
// ignore: cast_nullable_to_non_nullable
: accountExternalId as String?,
accountId: accountId == const $CopyWithPlaceholder()
? _value.accountId
// ignore: cast_nullable_to_non_nullable
: accountId as int?,
accountName: accountName == const $CopyWithPlaceholder()
? _value.accountName
// ignore: cast_nullable_to_non_nullable
: accountName as String?,
accountSuggestions: accountSuggestions == const $CopyWithPlaceholder()
? _value.accountSuggestions
// ignore: cast_nullable_to_non_nullable
: accountSuggestions as List<AccountSuggestion>?,
broker: broker == const $CopyWithPlaceholder()
? _value.broker
// ignore: cast_nullable_to_non_nullable
: broker as String,
committedAt: committedAt == const $CopyWithPlaceholder()
? _value.committedAt
// ignore: cast_nullable_to_non_nullable
: committedAt as DateTime?,
counts: counts == const $CopyWithPlaceholder()
? _value.counts
// ignore: cast_nullable_to_non_nullable
: counts as ImportCounts,
duplicateOfId: duplicateOfId == const $CopyWithPlaceholder()
? _value.duplicateOfId
// ignore: cast_nullable_to_non_nullable
: duplicateOfId as int?,
error: error == const $CopyWithPlaceholder()
? _value.error
// ignore: cast_nullable_to_non_nullable
: error as String?,
filename: filename == const $CopyWithPlaceholder()
? _value.filename
// ignore: cast_nullable_to_non_nullable
: filename as String,
id: id == const $CopyWithPlaceholder()
? _value.id
// ignore: cast_nullable_to_non_nullable
: id as int,
parseStatus: parseStatus == const $CopyWithPlaceholder()
? _value.parseStatus
// ignore: cast_nullable_to_non_nullable
: parseStatus as String,
parserName: parserName == const $CopyWithPlaceholder()
? _value.parserName
// ignore: cast_nullable_to_non_nullable
: parserName as String?,
parserVersion: parserVersion == const $CopyWithPlaceholder()
? _value.parserVersion
// ignore: cast_nullable_to_non_nullable
: parserVersion as String?,
pendingInstruments: pendingInstruments == const $CopyWithPlaceholder()
? _value.pendingInstruments
// ignore: cast_nullable_to_non_nullable
: pendingInstruments as List<PendingInstrumentOut>?,
periodFrom: periodFrom == const $CopyWithPlaceholder()
? _value.periodFrom
// ignore: cast_nullable_to_non_nullable
: periodFrom as DateTime?,
periodTo: periodTo == const $CopyWithPlaceholder()
? _value.periodTo
// ignore: cast_nullable_to_non_nullable
: periodTo as DateTime?,
reconciliation: reconciliation == const $CopyWithPlaceholder()
? _value.reconciliation
// ignore: cast_nullable_to_non_nullable
: reconciliation as ReconciliationOut,
sampleEvents: sampleEvents == const $CopyWithPlaceholder()
? _value.sampleEvents
// ignore: cast_nullable_to_non_nullable
: sampleEvents as List<SampleEventOut>?,
sha256: sha256 == const $CopyWithPlaceholder()
? _value.sha256
// ignore: cast_nullable_to_non_nullable
: sha256 as String,
sizeBytes: sizeBytes == const $CopyWithPlaceholder()
? _value.sizeBytes
// ignore: cast_nullable_to_non_nullable
: sizeBytes as int,
uploadedAt: uploadedAt == const $CopyWithPlaceholder()
? _value.uploadedAt
// ignore: cast_nullable_to_non_nullable
: uploadedAt as DateTime?,
warnings: warnings == const $CopyWithPlaceholder()
? _value.warnings
// ignore: cast_nullable_to_non_nullable
: warnings as List<String>?,
);
}
}
extension $ImportPreviewCopyWith on ImportPreview {
/// Returns a callable class that can be used as follows: `instanceOfImportPreview.copyWith(...)` or like so:`instanceOfImportPreview.copyWith.fieldName(...)`.
// ignore: library_private_types_in_public_api
_$ImportPreviewCWProxy get copyWith => _$ImportPreviewCWProxyImpl(this);
}
// **************************************************************************
// JsonSerializableGenerator
// **************************************************************************
ImportPreview _$ImportPreviewFromJson(Map<String, dynamic> json) =>
$checkedCreate(
'ImportPreview',
json,
($checkedConvert) {
$checkKeys(
json,
requiredKeys: const [
'broker',
'counts',
'filename',
'id',
'parse_status',
'reconciliation',
'sha256',
'size_bytes',
],
);
final val = ImportPreview(
accountExternalId: $checkedConvert(
'account_external_id',
(v) => v as String?,
),
accountId: $checkedConvert('account_id', (v) => (v as num?)?.toInt()),
accountName: $checkedConvert('account_name', (v) => v as String?),
accountSuggestions: $checkedConvert(
'account_suggestions',
(v) => (v as List<dynamic>?)
?.map(
(e) => AccountSuggestion.fromJson(e as Map<String, dynamic>),
)
.toList(),
),
broker: $checkedConvert('broker', (v) => v as String),
committedAt: $checkedConvert(
'committed_at',
(v) => v == null ? null : DateTime.parse(v as String),
),
counts: $checkedConvert(
'counts',
(v) => ImportCounts.fromJson(v as Map<String, dynamic>),
),
duplicateOfId: $checkedConvert(
'duplicate_of_id',
(v) => (v as num?)?.toInt(),
),
error: $checkedConvert('error', (v) => v as String?),
filename: $checkedConvert('filename', (v) => v as String),
id: $checkedConvert('id', (v) => (v as num).toInt()),
parseStatus: $checkedConvert('parse_status', (v) => v as String),
parserName: $checkedConvert('parser_name', (v) => v as String?),
parserVersion: $checkedConvert('parser_version', (v) => v as String?),
pendingInstruments: $checkedConvert(
'pending_instruments',
(v) => (v as List<dynamic>?)
?.map(
(e) =>
PendingInstrumentOut.fromJson(e as Map<String, dynamic>),
)
.toList(),
),
periodFrom: $checkedConvert(
'period_from',
(v) => v == null ? null : DateTime.parse(v as String),
),
periodTo: $checkedConvert(
'period_to',
(v) => v == null ? null : DateTime.parse(v as String),
),
reconciliation: $checkedConvert(
'reconciliation',
(v) => ReconciliationOut.fromJson(v as Map<String, dynamic>),
),
sampleEvents: $checkedConvert(
'sample_events',
(v) => (v as List<dynamic>?)
?.map((e) => SampleEventOut.fromJson(e as Map<String, dynamic>))
.toList(),
),
sha256: $checkedConvert('sha256', (v) => v as String),
sizeBytes: $checkedConvert('size_bytes', (v) => (v as num).toInt()),
uploadedAt: $checkedConvert(
'uploaded_at',
(v) => v == null ? null : DateTime.parse(v as String),
),
warnings: $checkedConvert(
'warnings',
(v) => (v as List<dynamic>?)?.map((e) => e as String).toList(),
),
);
return val;
},
fieldKeyMap: const {
'accountExternalId': 'account_external_id',
'accountId': 'account_id',
'accountName': 'account_name',
'accountSuggestions': 'account_suggestions',
'committedAt': 'committed_at',
'duplicateOfId': 'duplicate_of_id',
'parseStatus': 'parse_status',
'parserName': 'parser_name',
'parserVersion': 'parser_version',
'pendingInstruments': 'pending_instruments',
'periodFrom': 'period_from',
'periodTo': 'period_to',
'sampleEvents': 'sample_events',
'sizeBytes': 'size_bytes',
'uploadedAt': 'uploaded_at',
},
);
Map<String, dynamic> _$ImportPreviewToJson(ImportPreview instance) =>
<String, dynamic>{
'account_external_id': ?instance.accountExternalId,
'account_id': ?instance.accountId,
'account_name': ?instance.accountName,
'account_suggestions': ?instance.accountSuggestions
?.map((e) => e.toJson())
.toList(),
'broker': instance.broker,
'committed_at': ?instance.committedAt?.toIso8601String(),
'counts': instance.counts.toJson(),
'duplicate_of_id': ?instance.duplicateOfId,
'error': ?instance.error,
'filename': instance.filename,
'id': instance.id,
'parse_status': instance.parseStatus,
'parser_name': ?instance.parserName,
'parser_version': ?instance.parserVersion,
'pending_instruments': ?instance.pendingInstruments
?.map((e) => e.toJson())
.toList(),
'period_from': ?instance.periodFrom?.toIso8601String(),
'period_to': ?instance.periodTo?.toIso8601String(),
'reconciliation': instance.reconciliation.toJson(),
'sample_events': ?instance.sampleEvents?.map((e) => e.toJson()).toList(),
'sha256': instance.sha256,
'size_bytes': instance.sizeBytes,
'uploaded_at': ?instance.uploadedAt?.toIso8601String(),
'warnings': ?instance.warnings,
};
@@ -0,0 +1,187 @@
//
// AUTO-GENERATED FILE, DO NOT MODIFY!
//
// ignore_for_file: unused_element
import 'package:fintracker_api/src/model/reconciliation_out.dart';
import 'package:copy_with_extension/copy_with_extension.dart';
import 'package:json_annotation/json_annotation.dart';
part 'import_result.g.dart';
@CopyWith()
@JsonSerializable(
checked: true,
createToJson: true,
disallowUnrecognizedKeys: false,
explicitToJson: true,
)
class ImportResult {
/// Returns a new [ImportResult] instance.
ImportResult({
required this.committed,
required this.eventsCreated,
required this.eventsShadow,
required this.eventsSkipped,
required this.eventsUpdated,
required this.importId,
required this.metricsRefreshed,
required this.pendingInstruments,
required this.reconciliation,
});
@JsonKey(
name: r'committed',
required: true,
includeIfNull: false,
)
final bool committed;
@JsonKey(
name: r'events_created',
required: true,
includeIfNull: false,
)
final int eventsCreated;
@JsonKey(
name: r'events_shadow',
required: true,
includeIfNull: false,
)
final int eventsShadow;
@JsonKey(
name: r'events_skipped',
required: true,
includeIfNull: false,
)
final int eventsSkipped;
@JsonKey(
name: r'events_updated',
required: true,
includeIfNull: false,
)
final int eventsUpdated;
@JsonKey(
name: r'import_id',
required: true,
includeIfNull: false,
)
final int importId;
@JsonKey(
name: r'metrics_refreshed',
required: true,
includeIfNull: false,
)
final bool metricsRefreshed;
@JsonKey(
name: r'pending_instruments',
required: true,
includeIfNull: false,
)
final int pendingInstruments;
@JsonKey(
name: r'reconciliation',
required: true,
includeIfNull: false,
)
final ReconciliationOut reconciliation;
@override
bool operator ==(Object other) => identical(this, other) || other is ImportResult &&
other.committed == committed &&
other.eventsCreated == eventsCreated &&
other.eventsShadow == eventsShadow &&
other.eventsSkipped == eventsSkipped &&
other.eventsUpdated == eventsUpdated &&
other.importId == importId &&
other.metricsRefreshed == metricsRefreshed &&
other.pendingInstruments == pendingInstruments &&
other.reconciliation == reconciliation;
@override
int get hashCode =>
committed.hashCode +
eventsCreated.hashCode +
eventsShadow.hashCode +
eventsSkipped.hashCode +
eventsUpdated.hashCode +
importId.hashCode +
metricsRefreshed.hashCode +
pendingInstruments.hashCode +
reconciliation.hashCode;
factory ImportResult.fromJson(Map<String, dynamic> json) => _$ImportResultFromJson(json);
Map<String, dynamic> toJson() => _$ImportResultToJson(this);
@override
String toString() {
return toJson().toString();
}
}
@@ -0,0 +1,226 @@
// GENERATED CODE - DO NOT MODIFY BY HAND
part of 'import_result.dart';
// **************************************************************************
// CopyWithGenerator
// **************************************************************************
abstract class _$ImportResultCWProxy {
ImportResult committed(bool committed);
ImportResult eventsCreated(int eventsCreated);
ImportResult eventsShadow(int eventsShadow);
ImportResult eventsSkipped(int eventsSkipped);
ImportResult eventsUpdated(int eventsUpdated);
ImportResult importId(int importId);
ImportResult metricsRefreshed(bool metricsRefreshed);
ImportResult pendingInstruments(int pendingInstruments);
ImportResult reconciliation(ReconciliationOut reconciliation);
/// This function **does support** nullification of nullable fields. All `null` values passed to `non-nullable` fields will be ignored. You can also use `ImportResult(...).copyWith.fieldName(...)` to override fields one at a time with nullification support.
///
/// Usage
/// ```dart
/// ImportResult(...).copyWith(id: 12, name: "My name")
/// ````
ImportResult call({
bool committed,
int eventsCreated,
int eventsShadow,
int eventsSkipped,
int eventsUpdated,
int importId,
bool metricsRefreshed,
int pendingInstruments,
ReconciliationOut reconciliation,
});
}
/// Proxy class for `copyWith` functionality. This is a callable class and can be used as follows: `instanceOfImportResult.copyWith(...)`. Additionally contains functions for specific fields e.g. `instanceOfImportResult.copyWith.fieldName(...)`
class _$ImportResultCWProxyImpl implements _$ImportResultCWProxy {
const _$ImportResultCWProxyImpl(this._value);
final ImportResult _value;
@override
ImportResult committed(bool committed) => this(committed: committed);
@override
ImportResult eventsCreated(int eventsCreated) =>
this(eventsCreated: eventsCreated);
@override
ImportResult eventsShadow(int eventsShadow) =>
this(eventsShadow: eventsShadow);
@override
ImportResult eventsSkipped(int eventsSkipped) =>
this(eventsSkipped: eventsSkipped);
@override
ImportResult eventsUpdated(int eventsUpdated) =>
this(eventsUpdated: eventsUpdated);
@override
ImportResult importId(int importId) => this(importId: importId);
@override
ImportResult metricsRefreshed(bool metricsRefreshed) =>
this(metricsRefreshed: metricsRefreshed);
@override
ImportResult pendingInstruments(int pendingInstruments) =>
this(pendingInstruments: pendingInstruments);
@override
ImportResult reconciliation(ReconciliationOut reconciliation) =>
this(reconciliation: reconciliation);
@override
/// This function **does support** nullification of nullable fields. All `null` values passed to `non-nullable` fields will be ignored. You can also use `ImportResult(...).copyWith.fieldName(...)` to override fields one at a time with nullification support.
///
/// Usage
/// ```dart
/// ImportResult(...).copyWith(id: 12, name: "My name")
/// ````
ImportResult call({
Object? committed = const $CopyWithPlaceholder(),
Object? eventsCreated = const $CopyWithPlaceholder(),
Object? eventsShadow = const $CopyWithPlaceholder(),
Object? eventsSkipped = const $CopyWithPlaceholder(),
Object? eventsUpdated = const $CopyWithPlaceholder(),
Object? importId = const $CopyWithPlaceholder(),
Object? metricsRefreshed = const $CopyWithPlaceholder(),
Object? pendingInstruments = const $CopyWithPlaceholder(),
Object? reconciliation = const $CopyWithPlaceholder(),
}) {
return ImportResult(
committed: committed == const $CopyWithPlaceholder()
? _value.committed
// ignore: cast_nullable_to_non_nullable
: committed as bool,
eventsCreated: eventsCreated == const $CopyWithPlaceholder()
? _value.eventsCreated
// ignore: cast_nullable_to_non_nullable
: eventsCreated as int,
eventsShadow: eventsShadow == const $CopyWithPlaceholder()
? _value.eventsShadow
// ignore: cast_nullable_to_non_nullable
: eventsShadow as int,
eventsSkipped: eventsSkipped == const $CopyWithPlaceholder()
? _value.eventsSkipped
// ignore: cast_nullable_to_non_nullable
: eventsSkipped as int,
eventsUpdated: eventsUpdated == const $CopyWithPlaceholder()
? _value.eventsUpdated
// ignore: cast_nullable_to_non_nullable
: eventsUpdated as int,
importId: importId == const $CopyWithPlaceholder()
? _value.importId
// ignore: cast_nullable_to_non_nullable
: importId as int,
metricsRefreshed: metricsRefreshed == const $CopyWithPlaceholder()
? _value.metricsRefreshed
// ignore: cast_nullable_to_non_nullable
: metricsRefreshed as bool,
pendingInstruments: pendingInstruments == const $CopyWithPlaceholder()
? _value.pendingInstruments
// ignore: cast_nullable_to_non_nullable
: pendingInstruments as int,
reconciliation: reconciliation == const $CopyWithPlaceholder()
? _value.reconciliation
// ignore: cast_nullable_to_non_nullable
: reconciliation as ReconciliationOut,
);
}
}
extension $ImportResultCopyWith on ImportResult {
/// Returns a callable class that can be used as follows: `instanceOfImportResult.copyWith(...)` or like so:`instanceOfImportResult.copyWith.fieldName(...)`.
// ignore: library_private_types_in_public_api
_$ImportResultCWProxy get copyWith => _$ImportResultCWProxyImpl(this);
}
// **************************************************************************
// JsonSerializableGenerator
// **************************************************************************
ImportResult _$ImportResultFromJson(
Map<String, dynamic> json,
) => $checkedCreate(
'ImportResult',
json,
($checkedConvert) {
$checkKeys(
json,
requiredKeys: const [
'committed',
'events_created',
'events_shadow',
'events_skipped',
'events_updated',
'import_id',
'metrics_refreshed',
'pending_instruments',
'reconciliation',
],
);
final val = ImportResult(
committed: $checkedConvert('committed', (v) => v as bool),
eventsCreated: $checkedConvert(
'events_created',
(v) => (v as num).toInt(),
),
eventsShadow: $checkedConvert('events_shadow', (v) => (v as num).toInt()),
eventsSkipped: $checkedConvert(
'events_skipped',
(v) => (v as num).toInt(),
),
eventsUpdated: $checkedConvert(
'events_updated',
(v) => (v as num).toInt(),
),
importId: $checkedConvert('import_id', (v) => (v as num).toInt()),
metricsRefreshed: $checkedConvert('metrics_refreshed', (v) => v as bool),
pendingInstruments: $checkedConvert(
'pending_instruments',
(v) => (v as num).toInt(),
),
reconciliation: $checkedConvert(
'reconciliation',
(v) => ReconciliationOut.fromJson(v as Map<String, dynamic>),
),
);
return val;
},
fieldKeyMap: const {
'eventsCreated': 'events_created',
'eventsShadow': 'events_shadow',
'eventsSkipped': 'events_skipped',
'eventsUpdated': 'events_updated',
'importId': 'import_id',
'metricsRefreshed': 'metrics_refreshed',
'pendingInstruments': 'pending_instruments',
},
);
Map<String, dynamic> _$ImportResultToJson(ImportResult instance) =>
<String, dynamic>{
'committed': instance.committed,
'events_created': instance.eventsCreated,
'events_shadow': instance.eventsShadow,
'events_skipped': instance.eventsSkipped,
'events_updated': instance.eventsUpdated,
'import_id': instance.importId,
'metrics_refreshed': instance.metricsRefreshed,
'pending_instruments': instance.pendingInstruments,
'reconciliation': instance.reconciliation.toJson(),
};
@@ -0,0 +1,331 @@
//
// AUTO-GENERATED FILE, DO NOT MODIFY!
//
// ignore_for_file: unused_element
import 'package:fintracker_api/src/model/import_counts.dart';
import 'package:copy_with_extension/copy_with_extension.dart';
import 'package:json_annotation/json_annotation.dart';
part 'import_summary.g.dart';
@CopyWith()
@JsonSerializable(
checked: true,
createToJson: true,
disallowUnrecognizedKeys: false,
explicitToJson: true,
)
class ImportSummary {
/// Returns a new [ImportSummary] instance.
ImportSummary({
this.accountExternalId,
this.accountId,
this.accountName,
required this.broker,
this.committedAt,
required this.counts,
this.duplicateOfId,
this.error,
required this.filename,
required this.id,
required this.parseStatus,
this.parserName,
this.parserVersion,
this.periodFrom,
this.periodTo,
required this.sha256,
required this.sizeBytes,
this.uploadedAt,
});
@JsonKey(
name: r'account_external_id',
required: false,
includeIfNull: false,
)
final String? accountExternalId;
@JsonKey(
name: r'account_id',
required: false,
includeIfNull: false,
)
final int? accountId;
@JsonKey(
name: r'account_name',
required: false,
includeIfNull: false,
)
final String? accountName;
@JsonKey(
name: r'broker',
required: true,
includeIfNull: false,
)
final String broker;
@JsonKey(
name: r'committed_at',
required: false,
includeIfNull: false,
)
final DateTime? committedAt;
@JsonKey(
name: r'counts',
required: true,
includeIfNull: false,
)
final ImportCounts counts;
@JsonKey(
name: r'duplicate_of_id',
required: false,
includeIfNull: false,
)
final int? duplicateOfId;
@JsonKey(
name: r'error',
required: false,
includeIfNull: false,
)
final String? error;
@JsonKey(
name: r'filename',
required: true,
includeIfNull: false,
)
final String filename;
@JsonKey(
name: r'id',
required: true,
includeIfNull: false,
)
final int id;
@JsonKey(
name: r'parse_status',
required: true,
includeIfNull: false,
)
final String parseStatus;
@JsonKey(
name: r'parser_name',
required: false,
includeIfNull: false,
)
final String? parserName;
@JsonKey(
name: r'parser_version',
required: false,
includeIfNull: false,
)
final String? parserVersion;
@JsonKey(
name: r'period_from',
required: false,
includeIfNull: false,
)
final DateTime? periodFrom;
@JsonKey(
name: r'period_to',
required: false,
includeIfNull: false,
)
final DateTime? periodTo;
@JsonKey(
name: r'sha256',
required: true,
includeIfNull: false,
)
final String sha256;
@JsonKey(
name: r'size_bytes',
required: true,
includeIfNull: false,
)
final int sizeBytes;
@JsonKey(
name: r'uploaded_at',
required: false,
includeIfNull: false,
)
final DateTime? uploadedAt;
@override
bool operator ==(Object other) => identical(this, other) || other is ImportSummary &&
other.accountExternalId == accountExternalId &&
other.accountId == accountId &&
other.accountName == accountName &&
other.broker == broker &&
other.committedAt == committedAt &&
other.counts == counts &&
other.duplicateOfId == duplicateOfId &&
other.error == error &&
other.filename == filename &&
other.id == id &&
other.parseStatus == parseStatus &&
other.parserName == parserName &&
other.parserVersion == parserVersion &&
other.periodFrom == periodFrom &&
other.periodTo == periodTo &&
other.sha256 == sha256 &&
other.sizeBytes == sizeBytes &&
other.uploadedAt == uploadedAt;
@override
int get hashCode =>
(accountExternalId == null ? 0 : accountExternalId.hashCode) +
(accountId == null ? 0 : accountId.hashCode) +
(accountName == null ? 0 : accountName.hashCode) +
broker.hashCode +
(committedAt == null ? 0 : committedAt.hashCode) +
counts.hashCode +
(duplicateOfId == null ? 0 : duplicateOfId.hashCode) +
(error == null ? 0 : error.hashCode) +
filename.hashCode +
id.hashCode +
parseStatus.hashCode +
(parserName == null ? 0 : parserName.hashCode) +
(parserVersion == null ? 0 : parserVersion.hashCode) +
(periodFrom == null ? 0 : periodFrom.hashCode) +
(periodTo == null ? 0 : periodTo.hashCode) +
sha256.hashCode +
sizeBytes.hashCode +
(uploadedAt == null ? 0 : uploadedAt.hashCode);
factory ImportSummary.fromJson(Map<String, dynamic> json) => _$ImportSummaryFromJson(json);
Map<String, dynamic> toJson() => _$ImportSummaryToJson(this);
@override
String toString() {
return toJson().toString();
}
}
@@ -0,0 +1,352 @@
// GENERATED CODE - DO NOT MODIFY BY HAND
part of 'import_summary.dart';
// **************************************************************************
// CopyWithGenerator
// **************************************************************************
abstract class _$ImportSummaryCWProxy {
ImportSummary accountExternalId(String? accountExternalId);
ImportSummary accountId(int? accountId);
ImportSummary accountName(String? accountName);
ImportSummary broker(String broker);
ImportSummary committedAt(DateTime? committedAt);
ImportSummary counts(ImportCounts counts);
ImportSummary duplicateOfId(int? duplicateOfId);
ImportSummary error(String? error);
ImportSummary filename(String filename);
ImportSummary id(int id);
ImportSummary parseStatus(String parseStatus);
ImportSummary parserName(String? parserName);
ImportSummary parserVersion(String? parserVersion);
ImportSummary periodFrom(DateTime? periodFrom);
ImportSummary periodTo(DateTime? periodTo);
ImportSummary sha256(String sha256);
ImportSummary sizeBytes(int sizeBytes);
ImportSummary uploadedAt(DateTime? uploadedAt);
/// This function **does support** nullification of nullable fields. All `null` values passed to `non-nullable` fields will be ignored. You can also use `ImportSummary(...).copyWith.fieldName(...)` to override fields one at a time with nullification support.
///
/// Usage
/// ```dart
/// ImportSummary(...).copyWith(id: 12, name: "My name")
/// ````
ImportSummary call({
String? accountExternalId,
int? accountId,
String? accountName,
String broker,
DateTime? committedAt,
ImportCounts counts,
int? duplicateOfId,
String? error,
String filename,
int id,
String parseStatus,
String? parserName,
String? parserVersion,
DateTime? periodFrom,
DateTime? periodTo,
String sha256,
int sizeBytes,
DateTime? uploadedAt,
});
}
/// Proxy class for `copyWith` functionality. This is a callable class and can be used as follows: `instanceOfImportSummary.copyWith(...)`. Additionally contains functions for specific fields e.g. `instanceOfImportSummary.copyWith.fieldName(...)`
class _$ImportSummaryCWProxyImpl implements _$ImportSummaryCWProxy {
const _$ImportSummaryCWProxyImpl(this._value);
final ImportSummary _value;
@override
ImportSummary accountExternalId(String? accountExternalId) =>
this(accountExternalId: accountExternalId);
@override
ImportSummary accountId(int? accountId) => this(accountId: accountId);
@override
ImportSummary accountName(String? accountName) =>
this(accountName: accountName);
@override
ImportSummary broker(String broker) => this(broker: broker);
@override
ImportSummary committedAt(DateTime? committedAt) =>
this(committedAt: committedAt);
@override
ImportSummary counts(ImportCounts counts) => this(counts: counts);
@override
ImportSummary duplicateOfId(int? duplicateOfId) =>
this(duplicateOfId: duplicateOfId);
@override
ImportSummary error(String? error) => this(error: error);
@override
ImportSummary filename(String filename) => this(filename: filename);
@override
ImportSummary id(int id) => this(id: id);
@override
ImportSummary parseStatus(String parseStatus) =>
this(parseStatus: parseStatus);
@override
ImportSummary parserName(String? parserName) => this(parserName: parserName);
@override
ImportSummary parserVersion(String? parserVersion) =>
this(parserVersion: parserVersion);
@override
ImportSummary periodFrom(DateTime? periodFrom) =>
this(periodFrom: periodFrom);
@override
ImportSummary periodTo(DateTime? periodTo) => this(periodTo: periodTo);
@override
ImportSummary sha256(String sha256) => this(sha256: sha256);
@override
ImportSummary sizeBytes(int sizeBytes) => this(sizeBytes: sizeBytes);
@override
ImportSummary uploadedAt(DateTime? uploadedAt) =>
this(uploadedAt: uploadedAt);
@override
/// This function **does support** nullification of nullable fields. All `null` values passed to `non-nullable` fields will be ignored. You can also use `ImportSummary(...).copyWith.fieldName(...)` to override fields one at a time with nullification support.
///
/// Usage
/// ```dart
/// ImportSummary(...).copyWith(id: 12, name: "My name")
/// ````
ImportSummary call({
Object? accountExternalId = const $CopyWithPlaceholder(),
Object? accountId = const $CopyWithPlaceholder(),
Object? accountName = const $CopyWithPlaceholder(),
Object? broker = const $CopyWithPlaceholder(),
Object? committedAt = const $CopyWithPlaceholder(),
Object? counts = const $CopyWithPlaceholder(),
Object? duplicateOfId = const $CopyWithPlaceholder(),
Object? error = const $CopyWithPlaceholder(),
Object? filename = const $CopyWithPlaceholder(),
Object? id = const $CopyWithPlaceholder(),
Object? parseStatus = const $CopyWithPlaceholder(),
Object? parserName = const $CopyWithPlaceholder(),
Object? parserVersion = const $CopyWithPlaceholder(),
Object? periodFrom = const $CopyWithPlaceholder(),
Object? periodTo = const $CopyWithPlaceholder(),
Object? sha256 = const $CopyWithPlaceholder(),
Object? sizeBytes = const $CopyWithPlaceholder(),
Object? uploadedAt = const $CopyWithPlaceholder(),
}) {
return ImportSummary(
accountExternalId: accountExternalId == const $CopyWithPlaceholder()
? _value.accountExternalId
// ignore: cast_nullable_to_non_nullable
: accountExternalId as String?,
accountId: accountId == const $CopyWithPlaceholder()
? _value.accountId
// ignore: cast_nullable_to_non_nullable
: accountId as int?,
accountName: accountName == const $CopyWithPlaceholder()
? _value.accountName
// ignore: cast_nullable_to_non_nullable
: accountName as String?,
broker: broker == const $CopyWithPlaceholder()
? _value.broker
// ignore: cast_nullable_to_non_nullable
: broker as String,
committedAt: committedAt == const $CopyWithPlaceholder()
? _value.committedAt
// ignore: cast_nullable_to_non_nullable
: committedAt as DateTime?,
counts: counts == const $CopyWithPlaceholder()
? _value.counts
// ignore: cast_nullable_to_non_nullable
: counts as ImportCounts,
duplicateOfId: duplicateOfId == const $CopyWithPlaceholder()
? _value.duplicateOfId
// ignore: cast_nullable_to_non_nullable
: duplicateOfId as int?,
error: error == const $CopyWithPlaceholder()
? _value.error
// ignore: cast_nullable_to_non_nullable
: error as String?,
filename: filename == const $CopyWithPlaceholder()
? _value.filename
// ignore: cast_nullable_to_non_nullable
: filename as String,
id: id == const $CopyWithPlaceholder()
? _value.id
// ignore: cast_nullable_to_non_nullable
: id as int,
parseStatus: parseStatus == const $CopyWithPlaceholder()
? _value.parseStatus
// ignore: cast_nullable_to_non_nullable
: parseStatus as String,
parserName: parserName == const $CopyWithPlaceholder()
? _value.parserName
// ignore: cast_nullable_to_non_nullable
: parserName as String?,
parserVersion: parserVersion == const $CopyWithPlaceholder()
? _value.parserVersion
// ignore: cast_nullable_to_non_nullable
: parserVersion as String?,
periodFrom: periodFrom == const $CopyWithPlaceholder()
? _value.periodFrom
// ignore: cast_nullable_to_non_nullable
: periodFrom as DateTime?,
periodTo: periodTo == const $CopyWithPlaceholder()
? _value.periodTo
// ignore: cast_nullable_to_non_nullable
: periodTo as DateTime?,
sha256: sha256 == const $CopyWithPlaceholder()
? _value.sha256
// ignore: cast_nullable_to_non_nullable
: sha256 as String,
sizeBytes: sizeBytes == const $CopyWithPlaceholder()
? _value.sizeBytes
// ignore: cast_nullable_to_non_nullable
: sizeBytes as int,
uploadedAt: uploadedAt == const $CopyWithPlaceholder()
? _value.uploadedAt
// ignore: cast_nullable_to_non_nullable
: uploadedAt as DateTime?,
);
}
}
extension $ImportSummaryCopyWith on ImportSummary {
/// Returns a callable class that can be used as follows: `instanceOfImportSummary.copyWith(...)` or like so:`instanceOfImportSummary.copyWith.fieldName(...)`.
// ignore: library_private_types_in_public_api
_$ImportSummaryCWProxy get copyWith => _$ImportSummaryCWProxyImpl(this);
}
// **************************************************************************
// JsonSerializableGenerator
// **************************************************************************
ImportSummary _$ImportSummaryFromJson(Map<String, dynamic> json) =>
$checkedCreate(
'ImportSummary',
json,
($checkedConvert) {
$checkKeys(
json,
requiredKeys: const [
'broker',
'counts',
'filename',
'id',
'parse_status',
'sha256',
'size_bytes',
],
);
final val = ImportSummary(
accountExternalId: $checkedConvert(
'account_external_id',
(v) => v as String?,
),
accountId: $checkedConvert('account_id', (v) => (v as num?)?.toInt()),
accountName: $checkedConvert('account_name', (v) => v as String?),
broker: $checkedConvert('broker', (v) => v as String),
committedAt: $checkedConvert(
'committed_at',
(v) => v == null ? null : DateTime.parse(v as String),
),
counts: $checkedConvert(
'counts',
(v) => ImportCounts.fromJson(v as Map<String, dynamic>),
),
duplicateOfId: $checkedConvert(
'duplicate_of_id',
(v) => (v as num?)?.toInt(),
),
error: $checkedConvert('error', (v) => v as String?),
filename: $checkedConvert('filename', (v) => v as String),
id: $checkedConvert('id', (v) => (v as num).toInt()),
parseStatus: $checkedConvert('parse_status', (v) => v as String),
parserName: $checkedConvert('parser_name', (v) => v as String?),
parserVersion: $checkedConvert('parser_version', (v) => v as String?),
periodFrom: $checkedConvert(
'period_from',
(v) => v == null ? null : DateTime.parse(v as String),
),
periodTo: $checkedConvert(
'period_to',
(v) => v == null ? null : DateTime.parse(v as String),
),
sha256: $checkedConvert('sha256', (v) => v as String),
sizeBytes: $checkedConvert('size_bytes', (v) => (v as num).toInt()),
uploadedAt: $checkedConvert(
'uploaded_at',
(v) => v == null ? null : DateTime.parse(v as String),
),
);
return val;
},
fieldKeyMap: const {
'accountExternalId': 'account_external_id',
'accountId': 'account_id',
'accountName': 'account_name',
'committedAt': 'committed_at',
'duplicateOfId': 'duplicate_of_id',
'parseStatus': 'parse_status',
'parserName': 'parser_name',
'parserVersion': 'parser_version',
'periodFrom': 'period_from',
'periodTo': 'period_to',
'sizeBytes': 'size_bytes',
'uploadedAt': 'uploaded_at',
},
);
Map<String, dynamic> _$ImportSummaryToJson(ImportSummary instance) =>
<String, dynamic>{
'account_external_id': ?instance.accountExternalId,
'account_id': ?instance.accountId,
'account_name': ?instance.accountName,
'broker': instance.broker,
'committed_at': ?instance.committedAt?.toIso8601String(),
'counts': instance.counts.toJson(),
'duplicate_of_id': ?instance.duplicateOfId,
'error': ?instance.error,
'filename': instance.filename,
'id': instance.id,
'parse_status': instance.parseStatus,
'parser_name': ?instance.parserName,
'parser_version': ?instance.parserVersion,
'period_from': ?instance.periodFrom?.toIso8601String(),
'period_to': ?instance.periodTo?.toIso8601String(),
'sha256': instance.sha256,
'size_bytes': instance.sizeBytes,
'uploaded_at': ?instance.uploadedAt?.toIso8601String(),
};
@@ -0,0 +1,74 @@
//
// AUTO-GENERATED FILE, DO NOT MODIFY!
//
// ignore_for_file: unused_element
import 'package:copy_with_extension/copy_with_extension.dart';
import 'package:json_annotation/json_annotation.dart';
part 'link_create.g.dart';
@CopyWith()
@JsonSerializable(
checked: true,
createToJson: true,
disallowUnrecognizedKeys: false,
explicitToJson: true,
)
class LinkCreate {
/// Returns a new [LinkCreate] instance.
LinkCreate({
required this.cashTxnId,
required this.eventId,
});
@JsonKey(
name: r'cash_txn_id',
required: true,
includeIfNull: false,
)
final int cashTxnId;
@JsonKey(
name: r'event_id',
required: true,
includeIfNull: false,
)
final int eventId;
@override
bool operator ==(Object other) => identical(this, other) || other is LinkCreate &&
other.cashTxnId == cashTxnId &&
other.eventId == eventId;
@override
int get hashCode =>
cashTxnId.hashCode +
eventId.hashCode;
factory LinkCreate.fromJson(Map<String, dynamic> json) => _$LinkCreateFromJson(json);
Map<String, dynamic> toJson() => _$LinkCreateToJson(this);
@override
String toString() {
return toJson().toString();
}
}
@@ -0,0 +1,87 @@
// GENERATED CODE - DO NOT MODIFY BY HAND
part of 'link_create.dart';
// **************************************************************************
// CopyWithGenerator
// **************************************************************************
abstract class _$LinkCreateCWProxy {
LinkCreate cashTxnId(int cashTxnId);
LinkCreate eventId(int eventId);
/// This function **does support** nullification of nullable fields. All `null` values passed to `non-nullable` fields will be ignored. You can also use `LinkCreate(...).copyWith.fieldName(...)` to override fields one at a time with nullification support.
///
/// Usage
/// ```dart
/// LinkCreate(...).copyWith(id: 12, name: "My name")
/// ````
LinkCreate call({int cashTxnId, int eventId});
}
/// Proxy class for `copyWith` functionality. This is a callable class and can be used as follows: `instanceOfLinkCreate.copyWith(...)`. Additionally contains functions for specific fields e.g. `instanceOfLinkCreate.copyWith.fieldName(...)`
class _$LinkCreateCWProxyImpl implements _$LinkCreateCWProxy {
const _$LinkCreateCWProxyImpl(this._value);
final LinkCreate _value;
@override
LinkCreate cashTxnId(int cashTxnId) => this(cashTxnId: cashTxnId);
@override
LinkCreate eventId(int eventId) => this(eventId: eventId);
@override
/// This function **does support** nullification of nullable fields. All `null` values passed to `non-nullable` fields will be ignored. You can also use `LinkCreate(...).copyWith.fieldName(...)` to override fields one at a time with nullification support.
///
/// Usage
/// ```dart
/// LinkCreate(...).copyWith(id: 12, name: "My name")
/// ````
LinkCreate call({
Object? cashTxnId = const $CopyWithPlaceholder(),
Object? eventId = const $CopyWithPlaceholder(),
}) {
return LinkCreate(
cashTxnId: cashTxnId == const $CopyWithPlaceholder()
? _value.cashTxnId
// ignore: cast_nullable_to_non_nullable
: cashTxnId as int,
eventId: eventId == const $CopyWithPlaceholder()
? _value.eventId
// ignore: cast_nullable_to_non_nullable
: eventId as int,
);
}
}
extension $LinkCreateCopyWith on LinkCreate {
/// Returns a callable class that can be used as follows: `instanceOfLinkCreate.copyWith(...)` or like so:`instanceOfLinkCreate.copyWith.fieldName(...)`.
// ignore: library_private_types_in_public_api
_$LinkCreateCWProxy get copyWith => _$LinkCreateCWProxyImpl(this);
}
// **************************************************************************
// JsonSerializableGenerator
// **************************************************************************
LinkCreate _$LinkCreateFromJson(Map<String, dynamic> json) => $checkedCreate(
'LinkCreate',
json,
($checkedConvert) {
$checkKeys(json, requiredKeys: const ['cash_txn_id', 'event_id']);
final val = LinkCreate(
cashTxnId: $checkedConvert('cash_txn_id', (v) => (v as num).toInt()),
eventId: $checkedConvert('event_id', (v) => (v as num).toInt()),
);
return val;
},
fieldKeyMap: const {'cashTxnId': 'cash_txn_id', 'eventId': 'event_id'},
);
Map<String, dynamic> _$LinkCreateToJson(LinkCreate instance) =>
<String, dynamic>{
'cash_txn_id': instance.cashTxnId,
'event_id': instance.eventId,
};
@@ -0,0 +1,188 @@
//
// AUTO-GENERATED FILE, DO NOT MODIFY!
//
// ignore_for_file: unused_element
import 'package:copy_with_extension/copy_with_extension.dart';
import 'package:json_annotation/json_annotation.dart';
part 'link_out.g.dart';
@CopyWith()
@JsonSerializable(
checked: true,
createToJson: true,
disallowUnrecognizedKeys: false,
explicitToJson: true,
)
class LinkOut {
/// Returns a new [LinkOut] instance.
LinkOut({
required this.amountDelta,
required this.cashTxnId,
required this.confidence,
required this.currency,
required this.dayGap,
required this.eventId,
required this.id,
required this.kind,
required this.note,
});
/// decimal as string
@JsonKey(
name: r'amount_delta',
required: true,
includeIfNull: false,
)
final String amountDelta;
@JsonKey(
name: r'cash_txn_id',
required: true,
includeIfNull: false,
)
final int cashTxnId;
/// decimal as string
@JsonKey(
name: r'confidence',
required: true,
includeIfNull: false,
)
final String confidence;
@JsonKey(
name: r'currency',
required: true,
includeIfNull: false,
)
final String currency;
@JsonKey(
name: r'day_gap',
required: true,
includeIfNull: false,
)
final int dayGap;
@JsonKey(
name: r'event_id',
required: true,
includeIfNull: false,
)
final int eventId;
@JsonKey(
name: r'id',
required: true,
includeIfNull: false,
)
final int id;
@JsonKey(
name: r'kind',
required: true,
includeIfNull: false,
)
final String kind;
@JsonKey(
name: r'note',
required: true,
includeIfNull: true,
)
final String? note;
@override
bool operator ==(Object other) => identical(this, other) || other is LinkOut &&
other.amountDelta == amountDelta &&
other.cashTxnId == cashTxnId &&
other.confidence == confidence &&
other.currency == currency &&
other.dayGap == dayGap &&
other.eventId == eventId &&
other.id == id &&
other.kind == kind &&
other.note == note;
@override
int get hashCode =>
amountDelta.hashCode +
cashTxnId.hashCode +
confidence.hashCode +
currency.hashCode +
dayGap.hashCode +
eventId.hashCode +
id.hashCode +
kind.hashCode +
(note == null ? 0 : note.hashCode);
factory LinkOut.fromJson(Map<String, dynamic> json) => _$LinkOutFromJson(json);
Map<String, dynamic> toJson() => _$LinkOutToJson(this);
@override
String toString() {
return toJson().toString();
}
}
@@ -0,0 +1,198 @@
// GENERATED CODE - DO NOT MODIFY BY HAND
part of 'link_out.dart';
// **************************************************************************
// CopyWithGenerator
// **************************************************************************
abstract class _$LinkOutCWProxy {
LinkOut amountDelta(String amountDelta);
LinkOut cashTxnId(int cashTxnId);
LinkOut confidence(String confidence);
LinkOut currency(String currency);
LinkOut dayGap(int dayGap);
LinkOut eventId(int eventId);
LinkOut id(int id);
LinkOut kind(String kind);
LinkOut note(String? note);
/// This function **does support** nullification of nullable fields. All `null` values passed to `non-nullable` fields will be ignored. You can also use `LinkOut(...).copyWith.fieldName(...)` to override fields one at a time with nullification support.
///
/// Usage
/// ```dart
/// LinkOut(...).copyWith(id: 12, name: "My name")
/// ````
LinkOut call({
String amountDelta,
int cashTxnId,
String confidence,
String currency,
int dayGap,
int eventId,
int id,
String kind,
String? note,
});
}
/// Proxy class for `copyWith` functionality. This is a callable class and can be used as follows: `instanceOfLinkOut.copyWith(...)`. Additionally contains functions for specific fields e.g. `instanceOfLinkOut.copyWith.fieldName(...)`
class _$LinkOutCWProxyImpl implements _$LinkOutCWProxy {
const _$LinkOutCWProxyImpl(this._value);
final LinkOut _value;
@override
LinkOut amountDelta(String amountDelta) => this(amountDelta: amountDelta);
@override
LinkOut cashTxnId(int cashTxnId) => this(cashTxnId: cashTxnId);
@override
LinkOut confidence(String confidence) => this(confidence: confidence);
@override
LinkOut currency(String currency) => this(currency: currency);
@override
LinkOut dayGap(int dayGap) => this(dayGap: dayGap);
@override
LinkOut eventId(int eventId) => this(eventId: eventId);
@override
LinkOut id(int id) => this(id: id);
@override
LinkOut kind(String kind) => this(kind: kind);
@override
LinkOut note(String? note) => this(note: note);
@override
/// This function **does support** nullification of nullable fields. All `null` values passed to `non-nullable` fields will be ignored. You can also use `LinkOut(...).copyWith.fieldName(...)` to override fields one at a time with nullification support.
///
/// Usage
/// ```dart
/// LinkOut(...).copyWith(id: 12, name: "My name")
/// ````
LinkOut call({
Object? amountDelta = const $CopyWithPlaceholder(),
Object? cashTxnId = const $CopyWithPlaceholder(),
Object? confidence = const $CopyWithPlaceholder(),
Object? currency = const $CopyWithPlaceholder(),
Object? dayGap = const $CopyWithPlaceholder(),
Object? eventId = const $CopyWithPlaceholder(),
Object? id = const $CopyWithPlaceholder(),
Object? kind = const $CopyWithPlaceholder(),
Object? note = const $CopyWithPlaceholder(),
}) {
return LinkOut(
amountDelta: amountDelta == const $CopyWithPlaceholder()
? _value.amountDelta
// ignore: cast_nullable_to_non_nullable
: amountDelta as String,
cashTxnId: cashTxnId == const $CopyWithPlaceholder()
? _value.cashTxnId
// ignore: cast_nullable_to_non_nullable
: cashTxnId as int,
confidence: confidence == const $CopyWithPlaceholder()
? _value.confidence
// ignore: cast_nullable_to_non_nullable
: confidence as String,
currency: currency == const $CopyWithPlaceholder()
? _value.currency
// ignore: cast_nullable_to_non_nullable
: currency as String,
dayGap: dayGap == const $CopyWithPlaceholder()
? _value.dayGap
// ignore: cast_nullable_to_non_nullable
: dayGap as int,
eventId: eventId == const $CopyWithPlaceholder()
? _value.eventId
// ignore: cast_nullable_to_non_nullable
: eventId as int,
id: id == const $CopyWithPlaceholder()
? _value.id
// ignore: cast_nullable_to_non_nullable
: id as int,
kind: kind == const $CopyWithPlaceholder()
? _value.kind
// ignore: cast_nullable_to_non_nullable
: kind as String,
note: note == const $CopyWithPlaceholder()
? _value.note
// ignore: cast_nullable_to_non_nullable
: note as String?,
);
}
}
extension $LinkOutCopyWith on LinkOut {
/// Returns a callable class that can be used as follows: `instanceOfLinkOut.copyWith(...)` or like so:`instanceOfLinkOut.copyWith.fieldName(...)`.
// ignore: library_private_types_in_public_api
_$LinkOutCWProxy get copyWith => _$LinkOutCWProxyImpl(this);
}
// **************************************************************************
// JsonSerializableGenerator
// **************************************************************************
LinkOut _$LinkOutFromJson(Map<String, dynamic> json) => $checkedCreate(
'LinkOut',
json,
($checkedConvert) {
$checkKeys(
json,
requiredKeys: const [
'amount_delta',
'cash_txn_id',
'confidence',
'currency',
'day_gap',
'event_id',
'id',
'kind',
'note',
],
);
final val = LinkOut(
amountDelta: $checkedConvert('amount_delta', (v) => v as String),
cashTxnId: $checkedConvert('cash_txn_id', (v) => (v as num).toInt()),
confidence: $checkedConvert('confidence', (v) => v as String),
currency: $checkedConvert('currency', (v) => v as String),
dayGap: $checkedConvert('day_gap', (v) => (v as num).toInt()),
eventId: $checkedConvert('event_id', (v) => (v as num).toInt()),
id: $checkedConvert('id', (v) => (v as num).toInt()),
kind: $checkedConvert('kind', (v) => v as String),
note: $checkedConvert('note', (v) => v as String?),
);
return val;
},
fieldKeyMap: const {
'amountDelta': 'amount_delta',
'cashTxnId': 'cash_txn_id',
'dayGap': 'day_gap',
'eventId': 'event_id',
},
);
Map<String, dynamic> _$LinkOutToJson(LinkOut instance) => <String, dynamic>{
'amount_delta': instance.amountDelta,
'cash_txn_id': instance.cashTxnId,
'confidence': instance.confidence,
'currency': instance.currency,
'day_gap': instance.dayGap,
'event_id': instance.eventId,
'id': instance.id,
'kind': instance.kind,
'note': instance.note,
};
@@ -0,0 +1,154 @@
//
// AUTO-GENERATED FILE, DO NOT MODIFY!
//
// ignore_for_file: unused_element
import 'package:copy_with_extension/copy_with_extension.dart';
import 'package:json_annotation/json_annotation.dart';
part 'new_instrument.g.dart';
@CopyWith()
@JsonSerializable(
checked: true,
createToJson: true,
disallowUnrecognizedKeys: false,
explicitToJson: true,
)
class NewInstrument {
/// Returns a new [NewInstrument] instance.
NewInstrument({
required this.assetClass,
this.board,
this.currency = 'RUB',
this.isin,
this.lot = 1,
required this.name,
this.ticker,
});
@JsonKey(
name: r'asset_class',
required: true,
includeIfNull: false,
)
final String assetClass;
@JsonKey(
name: r'board',
required: false,
includeIfNull: false,
)
final String? board;
@JsonKey(
defaultValue: 'RUB',
name: r'currency',
required: false,
includeIfNull: false,
)
final String? currency;
@JsonKey(
name: r'isin',
required: false,
includeIfNull: false,
)
final String? isin;
@JsonKey(
defaultValue: 1,
name: r'lot',
required: false,
includeIfNull: false,
)
final int? lot;
@JsonKey(
name: r'name',
required: true,
includeIfNull: false,
)
final String name;
@JsonKey(
name: r'ticker',
required: false,
includeIfNull: false,
)
final String? ticker;
@override
bool operator ==(Object other) => identical(this, other) || other is NewInstrument &&
other.assetClass == assetClass &&
other.board == board &&
other.currency == currency &&
other.isin == isin &&
other.lot == lot &&
other.name == name &&
other.ticker == ticker;
@override
int get hashCode =>
assetClass.hashCode +
(board == null ? 0 : board.hashCode) +
currency.hashCode +
(isin == null ? 0 : isin.hashCode) +
lot.hashCode +
name.hashCode +
(ticker == null ? 0 : ticker.hashCode);
factory NewInstrument.fromJson(Map<String, dynamic> json) => _$NewInstrumentFromJson(json);
Map<String, dynamic> toJson() => _$NewInstrumentToJson(this);
@override
String toString() {
return toJson().toString();
}
}
@@ -0,0 +1,151 @@
// GENERATED CODE - DO NOT MODIFY BY HAND
part of 'new_instrument.dart';
// **************************************************************************
// CopyWithGenerator
// **************************************************************************
abstract class _$NewInstrumentCWProxy {
NewInstrument assetClass(String assetClass);
NewInstrument board(String? board);
NewInstrument currency(String? currency);
NewInstrument isin(String? isin);
NewInstrument lot(int? lot);
NewInstrument name(String name);
NewInstrument ticker(String? ticker);
/// This function **does support** nullification of nullable fields. All `null` values passed to `non-nullable` fields will be ignored. You can also use `NewInstrument(...).copyWith.fieldName(...)` to override fields one at a time with nullification support.
///
/// Usage
/// ```dart
/// NewInstrument(...).copyWith(id: 12, name: "My name")
/// ````
NewInstrument call({
String assetClass,
String? board,
String? currency,
String? isin,
int? lot,
String name,
String? ticker,
});
}
/// Proxy class for `copyWith` functionality. This is a callable class and can be used as follows: `instanceOfNewInstrument.copyWith(...)`. Additionally contains functions for specific fields e.g. `instanceOfNewInstrument.copyWith.fieldName(...)`
class _$NewInstrumentCWProxyImpl implements _$NewInstrumentCWProxy {
const _$NewInstrumentCWProxyImpl(this._value);
final NewInstrument _value;
@override
NewInstrument assetClass(String assetClass) => this(assetClass: assetClass);
@override
NewInstrument board(String? board) => this(board: board);
@override
NewInstrument currency(String? currency) => this(currency: currency);
@override
NewInstrument isin(String? isin) => this(isin: isin);
@override
NewInstrument lot(int? lot) => this(lot: lot);
@override
NewInstrument name(String name) => this(name: name);
@override
NewInstrument ticker(String? ticker) => this(ticker: ticker);
@override
/// This function **does support** nullification of nullable fields. All `null` values passed to `non-nullable` fields will be ignored. You can also use `NewInstrument(...).copyWith.fieldName(...)` to override fields one at a time with nullification support.
///
/// Usage
/// ```dart
/// NewInstrument(...).copyWith(id: 12, name: "My name")
/// ````
NewInstrument call({
Object? assetClass = const $CopyWithPlaceholder(),
Object? board = const $CopyWithPlaceholder(),
Object? currency = const $CopyWithPlaceholder(),
Object? isin = const $CopyWithPlaceholder(),
Object? lot = const $CopyWithPlaceholder(),
Object? name = const $CopyWithPlaceholder(),
Object? ticker = const $CopyWithPlaceholder(),
}) {
return NewInstrument(
assetClass: assetClass == const $CopyWithPlaceholder()
? _value.assetClass
// ignore: cast_nullable_to_non_nullable
: assetClass as String,
board: board == const $CopyWithPlaceholder()
? _value.board
// ignore: cast_nullable_to_non_nullable
: board as String?,
currency: currency == const $CopyWithPlaceholder()
? _value.currency
// ignore: cast_nullable_to_non_nullable
: currency as String?,
isin: isin == const $CopyWithPlaceholder()
? _value.isin
// ignore: cast_nullable_to_non_nullable
: isin as String?,
lot: lot == const $CopyWithPlaceholder()
? _value.lot
// ignore: cast_nullable_to_non_nullable
: lot as int?,
name: name == const $CopyWithPlaceholder()
? _value.name
// ignore: cast_nullable_to_non_nullable
: name as String,
ticker: ticker == const $CopyWithPlaceholder()
? _value.ticker
// ignore: cast_nullable_to_non_nullable
: ticker as String?,
);
}
}
extension $NewInstrumentCopyWith on NewInstrument {
/// Returns a callable class that can be used as follows: `instanceOfNewInstrument.copyWith(...)` or like so:`instanceOfNewInstrument.copyWith.fieldName(...)`.
// ignore: library_private_types_in_public_api
_$NewInstrumentCWProxy get copyWith => _$NewInstrumentCWProxyImpl(this);
}
// **************************************************************************
// JsonSerializableGenerator
// **************************************************************************
NewInstrument _$NewInstrumentFromJson(Map<String, dynamic> json) =>
$checkedCreate('NewInstrument', json, ($checkedConvert) {
$checkKeys(json, requiredKeys: const ['asset_class', 'name']);
final val = NewInstrument(
assetClass: $checkedConvert('asset_class', (v) => v as String),
board: $checkedConvert('board', (v) => v as String?),
currency: $checkedConvert('currency', (v) => v as String? ?? 'RUB'),
isin: $checkedConvert('isin', (v) => v as String?),
lot: $checkedConvert('lot', (v) => (v as num?)?.toInt() ?? 1),
name: $checkedConvert('name', (v) => v as String),
ticker: $checkedConvert('ticker', (v) => v as String?),
);
return val;
}, fieldKeyMap: const {'assetClass': 'asset_class'});
Map<String, dynamic> _$NewInstrumentToJson(NewInstrument instance) =>
<String, dynamic>{
'asset_class': instance.assetClass,
'board': ?instance.board,
'currency': ?instance.currency,
'isin': ?instance.isin,
'lot': ?instance.lot,
'name': instance.name,
'ticker': ?instance.ticker,
};
@@ -0,0 +1,300 @@
//
// AUTO-GENERATED FILE, DO NOT MODIFY!
//
// ignore_for_file: unused_element
import 'package:copy_with_extension/copy_with_extension.dart';
import 'package:json_annotation/json_annotation.dart';
part 'pending_instrument_out.g.dart';
@CopyWith()
@JsonSerializable(
checked: true,
createToJson: true,
disallowUnrecognizedKeys: false,
explicitToJson: true,
)
class PendingInstrumentOut {
/// Returns a new [PendingInstrumentOut] instance.
PendingInstrumentOut({
this.assetClassHint,
this.board,
this.createdAt,
this.currency,
this.firstSeenFileId,
required this.id,
this.instrumentId,
this.isin,
this.name,
required this.occurrences,
this.samplePrice,
this.sampleQuantity,
required this.source_,
required this.sourceKey,
required this.status,
this.ticker,
});
@JsonKey(
name: r'asset_class_hint',
required: false,
includeIfNull: false,
)
final String? assetClassHint;
@JsonKey(
name: r'board',
required: false,
includeIfNull: false,
)
final String? board;
@JsonKey(
name: r'created_at',
required: false,
includeIfNull: false,
)
final DateTime? createdAt;
@JsonKey(
name: r'currency',
required: false,
includeIfNull: false,
)
final String? currency;
@JsonKey(
name: r'first_seen_file_id',
required: false,
includeIfNull: false,
)
final int? firstSeenFileId;
@JsonKey(
name: r'id',
required: true,
includeIfNull: false,
)
final int id;
@JsonKey(
name: r'instrument_id',
required: false,
includeIfNull: false,
)
final int? instrumentId;
@JsonKey(
name: r'isin',
required: false,
includeIfNull: false,
)
final String? isin;
@JsonKey(
name: r'name',
required: false,
includeIfNull: false,
)
final String? name;
@JsonKey(
name: r'occurrences',
required: true,
includeIfNull: false,
)
final int occurrences;
/// decimal as string
@JsonKey(
name: r'sample_price',
required: false,
includeIfNull: false,
)
final String? samplePrice;
/// decimal as string
@JsonKey(
name: r'sample_quantity',
required: false,
includeIfNull: false,
)
final String? sampleQuantity;
@JsonKey(
name: r'source',
required: true,
includeIfNull: false,
)
final String source_;
@JsonKey(
name: r'source_key',
required: true,
includeIfNull: false,
)
final String sourceKey;
@JsonKey(
name: r'status',
required: true,
includeIfNull: false,
)
final String status;
@JsonKey(
name: r'ticker',
required: false,
includeIfNull: false,
)
final String? ticker;
@override
bool operator ==(Object other) => identical(this, other) || other is PendingInstrumentOut &&
other.assetClassHint == assetClassHint &&
other.board == board &&
other.createdAt == createdAt &&
other.currency == currency &&
other.firstSeenFileId == firstSeenFileId &&
other.id == id &&
other.instrumentId == instrumentId &&
other.isin == isin &&
other.name == name &&
other.occurrences == occurrences &&
other.samplePrice == samplePrice &&
other.sampleQuantity == sampleQuantity &&
other.source_ == source_ &&
other.sourceKey == sourceKey &&
other.status == status &&
other.ticker == ticker;
@override
int get hashCode =>
(assetClassHint == null ? 0 : assetClassHint.hashCode) +
(board == null ? 0 : board.hashCode) +
(createdAt == null ? 0 : createdAt.hashCode) +
(currency == null ? 0 : currency.hashCode) +
(firstSeenFileId == null ? 0 : firstSeenFileId.hashCode) +
id.hashCode +
(instrumentId == null ? 0 : instrumentId.hashCode) +
(isin == null ? 0 : isin.hashCode) +
(name == null ? 0 : name.hashCode) +
occurrences.hashCode +
(samplePrice == null ? 0 : samplePrice.hashCode) +
(sampleQuantity == null ? 0 : sampleQuantity.hashCode) +
source_.hashCode +
sourceKey.hashCode +
status.hashCode +
(ticker == null ? 0 : ticker.hashCode);
factory PendingInstrumentOut.fromJson(Map<String, dynamic> json) => _$PendingInstrumentOutFromJson(json);
Map<String, dynamic> toJson() => _$PendingInstrumentOutToJson(this);
@override
String toString() {
return toJson().toString();
}
}
@@ -0,0 +1,312 @@
// GENERATED CODE - DO NOT MODIFY BY HAND
part of 'pending_instrument_out.dart';
// **************************************************************************
// CopyWithGenerator
// **************************************************************************
abstract class _$PendingInstrumentOutCWProxy {
PendingInstrumentOut assetClassHint(String? assetClassHint);
PendingInstrumentOut board(String? board);
PendingInstrumentOut createdAt(DateTime? createdAt);
PendingInstrumentOut currency(String? currency);
PendingInstrumentOut firstSeenFileId(int? firstSeenFileId);
PendingInstrumentOut id(int id);
PendingInstrumentOut instrumentId(int? instrumentId);
PendingInstrumentOut isin(String? isin);
PendingInstrumentOut name(String? name);
PendingInstrumentOut occurrences(int occurrences);
PendingInstrumentOut samplePrice(String? samplePrice);
PendingInstrumentOut sampleQuantity(String? sampleQuantity);
PendingInstrumentOut source_(String source_);
PendingInstrumentOut sourceKey(String sourceKey);
PendingInstrumentOut status(String status);
PendingInstrumentOut ticker(String? ticker);
/// This function **does support** nullification of nullable fields. All `null` values passed to `non-nullable` fields will be ignored. You can also use `PendingInstrumentOut(...).copyWith.fieldName(...)` to override fields one at a time with nullification support.
///
/// Usage
/// ```dart
/// PendingInstrumentOut(...).copyWith(id: 12, name: "My name")
/// ````
PendingInstrumentOut call({
String? assetClassHint,
String? board,
DateTime? createdAt,
String? currency,
int? firstSeenFileId,
int id,
int? instrumentId,
String? isin,
String? name,
int occurrences,
String? samplePrice,
String? sampleQuantity,
String source_,
String sourceKey,
String status,
String? ticker,
});
}
/// Proxy class for `copyWith` functionality. This is a callable class and can be used as follows: `instanceOfPendingInstrumentOut.copyWith(...)`. Additionally contains functions for specific fields e.g. `instanceOfPendingInstrumentOut.copyWith.fieldName(...)`
class _$PendingInstrumentOutCWProxyImpl
implements _$PendingInstrumentOutCWProxy {
const _$PendingInstrumentOutCWProxyImpl(this._value);
final PendingInstrumentOut _value;
@override
PendingInstrumentOut assetClassHint(String? assetClassHint) =>
this(assetClassHint: assetClassHint);
@override
PendingInstrumentOut board(String? board) => this(board: board);
@override
PendingInstrumentOut createdAt(DateTime? createdAt) =>
this(createdAt: createdAt);
@override
PendingInstrumentOut currency(String? currency) => this(currency: currency);
@override
PendingInstrumentOut firstSeenFileId(int? firstSeenFileId) =>
this(firstSeenFileId: firstSeenFileId);
@override
PendingInstrumentOut id(int id) => this(id: id);
@override
PendingInstrumentOut instrumentId(int? instrumentId) =>
this(instrumentId: instrumentId);
@override
PendingInstrumentOut isin(String? isin) => this(isin: isin);
@override
PendingInstrumentOut name(String? name) => this(name: name);
@override
PendingInstrumentOut occurrences(int occurrences) =>
this(occurrences: occurrences);
@override
PendingInstrumentOut samplePrice(String? samplePrice) =>
this(samplePrice: samplePrice);
@override
PendingInstrumentOut sampleQuantity(String? sampleQuantity) =>
this(sampleQuantity: sampleQuantity);
@override
PendingInstrumentOut source_(String source_) => this(source_: source_);
@override
PendingInstrumentOut sourceKey(String sourceKey) =>
this(sourceKey: sourceKey);
@override
PendingInstrumentOut status(String status) => this(status: status);
@override
PendingInstrumentOut ticker(String? ticker) => this(ticker: ticker);
@override
/// This function **does support** nullification of nullable fields. All `null` values passed to `non-nullable` fields will be ignored. You can also use `PendingInstrumentOut(...).copyWith.fieldName(...)` to override fields one at a time with nullification support.
///
/// Usage
/// ```dart
/// PendingInstrumentOut(...).copyWith(id: 12, name: "My name")
/// ````
PendingInstrumentOut call({
Object? assetClassHint = const $CopyWithPlaceholder(),
Object? board = const $CopyWithPlaceholder(),
Object? createdAt = const $CopyWithPlaceholder(),
Object? currency = const $CopyWithPlaceholder(),
Object? firstSeenFileId = const $CopyWithPlaceholder(),
Object? id = const $CopyWithPlaceholder(),
Object? instrumentId = const $CopyWithPlaceholder(),
Object? isin = const $CopyWithPlaceholder(),
Object? name = const $CopyWithPlaceholder(),
Object? occurrences = const $CopyWithPlaceholder(),
Object? samplePrice = const $CopyWithPlaceholder(),
Object? sampleQuantity = const $CopyWithPlaceholder(),
Object? source_ = const $CopyWithPlaceholder(),
Object? sourceKey = const $CopyWithPlaceholder(),
Object? status = const $CopyWithPlaceholder(),
Object? ticker = const $CopyWithPlaceholder(),
}) {
return PendingInstrumentOut(
assetClassHint: assetClassHint == const $CopyWithPlaceholder()
? _value.assetClassHint
// ignore: cast_nullable_to_non_nullable
: assetClassHint as String?,
board: board == const $CopyWithPlaceholder()
? _value.board
// ignore: cast_nullable_to_non_nullable
: board as String?,
createdAt: createdAt == const $CopyWithPlaceholder()
? _value.createdAt
// ignore: cast_nullable_to_non_nullable
: createdAt as DateTime?,
currency: currency == const $CopyWithPlaceholder()
? _value.currency
// ignore: cast_nullable_to_non_nullable
: currency as String?,
firstSeenFileId: firstSeenFileId == const $CopyWithPlaceholder()
? _value.firstSeenFileId
// ignore: cast_nullable_to_non_nullable
: firstSeenFileId as int?,
id: id == const $CopyWithPlaceholder()
? _value.id
// ignore: cast_nullable_to_non_nullable
: id as int,
instrumentId: instrumentId == const $CopyWithPlaceholder()
? _value.instrumentId
// ignore: cast_nullable_to_non_nullable
: instrumentId as int?,
isin: isin == const $CopyWithPlaceholder()
? _value.isin
// ignore: cast_nullable_to_non_nullable
: isin as String?,
name: name == const $CopyWithPlaceholder()
? _value.name
// ignore: cast_nullable_to_non_nullable
: name as String?,
occurrences: occurrences == const $CopyWithPlaceholder()
? _value.occurrences
// ignore: cast_nullable_to_non_nullable
: occurrences as int,
samplePrice: samplePrice == const $CopyWithPlaceholder()
? _value.samplePrice
// ignore: cast_nullable_to_non_nullable
: samplePrice as String?,
sampleQuantity: sampleQuantity == const $CopyWithPlaceholder()
? _value.sampleQuantity
// ignore: cast_nullable_to_non_nullable
: sampleQuantity as String?,
source_: source_ == const $CopyWithPlaceholder()
? _value.source_
// ignore: cast_nullable_to_non_nullable
: source_ as String,
sourceKey: sourceKey == const $CopyWithPlaceholder()
? _value.sourceKey
// ignore: cast_nullable_to_non_nullable
: sourceKey as String,
status: status == const $CopyWithPlaceholder()
? _value.status
// ignore: cast_nullable_to_non_nullable
: status as String,
ticker: ticker == const $CopyWithPlaceholder()
? _value.ticker
// ignore: cast_nullable_to_non_nullable
: ticker as String?,
);
}
}
extension $PendingInstrumentOutCopyWith on PendingInstrumentOut {
/// Returns a callable class that can be used as follows: `instanceOfPendingInstrumentOut.copyWith(...)` or like so:`instanceOfPendingInstrumentOut.copyWith.fieldName(...)`.
// ignore: library_private_types_in_public_api
_$PendingInstrumentOutCWProxy get copyWith =>
_$PendingInstrumentOutCWProxyImpl(this);
}
// **************************************************************************
// JsonSerializableGenerator
// **************************************************************************
PendingInstrumentOut _$PendingInstrumentOutFromJson(
Map<String, dynamic> json,
) => $checkedCreate(
'PendingInstrumentOut',
json,
($checkedConvert) {
$checkKeys(
json,
requiredKeys: const [
'id',
'occurrences',
'source',
'source_key',
'status',
],
);
final val = PendingInstrumentOut(
assetClassHint: $checkedConvert('asset_class_hint', (v) => v as String?),
board: $checkedConvert('board', (v) => v as String?),
createdAt: $checkedConvert(
'created_at',
(v) => v == null ? null : DateTime.parse(v as String),
),
currency: $checkedConvert('currency', (v) => v as String?),
firstSeenFileId: $checkedConvert(
'first_seen_file_id',
(v) => (v as num?)?.toInt(),
),
id: $checkedConvert('id', (v) => (v as num).toInt()),
instrumentId: $checkedConvert(
'instrument_id',
(v) => (v as num?)?.toInt(),
),
isin: $checkedConvert('isin', (v) => v as String?),
name: $checkedConvert('name', (v) => v as String?),
occurrences: $checkedConvert('occurrences', (v) => (v as num).toInt()),
samplePrice: $checkedConvert('sample_price', (v) => v as String?),
sampleQuantity: $checkedConvert('sample_quantity', (v) => v as String?),
source_: $checkedConvert('source', (v) => v as String),
sourceKey: $checkedConvert('source_key', (v) => v as String),
status: $checkedConvert('status', (v) => v as String),
ticker: $checkedConvert('ticker', (v) => v as String?),
);
return val;
},
fieldKeyMap: const {
'assetClassHint': 'asset_class_hint',
'createdAt': 'created_at',
'firstSeenFileId': 'first_seen_file_id',
'instrumentId': 'instrument_id',
'samplePrice': 'sample_price',
'sampleQuantity': 'sample_quantity',
'source_': 'source',
'sourceKey': 'source_key',
},
);
Map<String, dynamic> _$PendingInstrumentOutToJson(
PendingInstrumentOut instance,
) => <String, dynamic>{
'asset_class_hint': ?instance.assetClassHint,
'board': ?instance.board,
'created_at': ?instance.createdAt?.toIso8601String(),
'currency': ?instance.currency,
'first_seen_file_id': ?instance.firstSeenFileId,
'id': instance.id,
'instrument_id': ?instance.instrumentId,
'isin': ?instance.isin,
'name': ?instance.name,
'occurrences': instance.occurrences,
'sample_price': ?instance.samplePrice,
'sample_quantity': ?instance.sampleQuantity,
'source': instance.source_,
'source_key': instance.sourceKey,
'status': instance.status,
'ticker': ?instance.ticker,
};
@@ -0,0 +1,111 @@
//
// AUTO-GENERATED FILE, DO NOT MODIFY!
//
// ignore_for_file: unused_element
import 'package:fintracker_api/src/model/new_instrument.dart';
import 'package:copy_with_extension/copy_with_extension.dart';
import 'package:json_annotation/json_annotation.dart';
part 'pending_resolve_request.g.dart';
@CopyWith()
@JsonSerializable(
checked: true,
createToJson: true,
disallowUnrecognizedKeys: false,
explicitToJson: true,
)
class PendingResolveRequest {
/// Returns a new [PendingResolveRequest] instance.
PendingResolveRequest({
required this.action,
this.instrument,
this.instrumentId,
});
@JsonKey(
name: r'action',
required: true,
includeIfNull: false,
unknownEnumValue: PendingResolveRequestActionEnum.unknownDefaultOpenApi,
)
final PendingResolveRequestActionEnum action;
@JsonKey(
name: r'instrument',
required: false,
includeIfNull: false,
)
final NewInstrument? instrument;
@JsonKey(
name: r'instrument_id',
required: false,
includeIfNull: false,
)
final int? instrumentId;
@override
bool operator ==(Object other) => identical(this, other) || other is PendingResolveRequest &&
other.action == action &&
other.instrument == instrument &&
other.instrumentId == instrumentId;
@override
int get hashCode =>
action.hashCode +
(instrument == null ? 0 : instrument.hashCode) +
(instrumentId == null ? 0 : instrumentId.hashCode);
factory PendingResolveRequest.fromJson(Map<String, dynamic> json) => _$PendingResolveRequestFromJson(json);
Map<String, dynamic> toJson() => _$PendingResolveRequestToJson(this);
@override
String toString() {
return toJson().toString();
}
}
enum PendingResolveRequestActionEnum {
@JsonValue(r'link')
link(r'link'),
@JsonValue(r'create')
create(r'create'),
@JsonValue(r'ignore')
ignore(r'ignore'),
@JsonValue(r'unknown_default_open_api')
unknownDefaultOpenApi(r'unknown_default_open_api');
const PendingResolveRequestActionEnum(this.value);
final String value;
@override
String toString() => value;
}
@@ -0,0 +1,125 @@
// GENERATED CODE - DO NOT MODIFY BY HAND
part of 'pending_resolve_request.dart';
// **************************************************************************
// CopyWithGenerator
// **************************************************************************
abstract class _$PendingResolveRequestCWProxy {
PendingResolveRequest action(PendingResolveRequestActionEnum action);
PendingResolveRequest instrument(NewInstrument? instrument);
PendingResolveRequest instrumentId(int? instrumentId);
/// This function **does support** nullification of nullable fields. All `null` values passed to `non-nullable` fields will be ignored. You can also use `PendingResolveRequest(...).copyWith.fieldName(...)` to override fields one at a time with nullification support.
///
/// Usage
/// ```dart
/// PendingResolveRequest(...).copyWith(id: 12, name: "My name")
/// ````
PendingResolveRequest call({
PendingResolveRequestActionEnum action,
NewInstrument? instrument,
int? instrumentId,
});
}
/// Proxy class for `copyWith` functionality. This is a callable class and can be used as follows: `instanceOfPendingResolveRequest.copyWith(...)`. Additionally contains functions for specific fields e.g. `instanceOfPendingResolveRequest.copyWith.fieldName(...)`
class _$PendingResolveRequestCWProxyImpl
implements _$PendingResolveRequestCWProxy {
const _$PendingResolveRequestCWProxyImpl(this._value);
final PendingResolveRequest _value;
@override
PendingResolveRequest action(PendingResolveRequestActionEnum action) =>
this(action: action);
@override
PendingResolveRequest instrument(NewInstrument? instrument) =>
this(instrument: instrument);
@override
PendingResolveRequest instrumentId(int? instrumentId) =>
this(instrumentId: instrumentId);
@override
/// This function **does support** nullification of nullable fields. All `null` values passed to `non-nullable` fields will be ignored. You can also use `PendingResolveRequest(...).copyWith.fieldName(...)` to override fields one at a time with nullification support.
///
/// Usage
/// ```dart
/// PendingResolveRequest(...).copyWith(id: 12, name: "My name")
/// ````
PendingResolveRequest call({
Object? action = const $CopyWithPlaceholder(),
Object? instrument = const $CopyWithPlaceholder(),
Object? instrumentId = const $CopyWithPlaceholder(),
}) {
return PendingResolveRequest(
action: action == const $CopyWithPlaceholder()
? _value.action
// ignore: cast_nullable_to_non_nullable
: action as PendingResolveRequestActionEnum,
instrument: instrument == const $CopyWithPlaceholder()
? _value.instrument
// ignore: cast_nullable_to_non_nullable
: instrument as NewInstrument?,
instrumentId: instrumentId == const $CopyWithPlaceholder()
? _value.instrumentId
// ignore: cast_nullable_to_non_nullable
: instrumentId as int?,
);
}
}
extension $PendingResolveRequestCopyWith on PendingResolveRequest {
/// Returns a callable class that can be used as follows: `instanceOfPendingResolveRequest.copyWith(...)` or like so:`instanceOfPendingResolveRequest.copyWith.fieldName(...)`.
// ignore: library_private_types_in_public_api
_$PendingResolveRequestCWProxy get copyWith =>
_$PendingResolveRequestCWProxyImpl(this);
}
// **************************************************************************
// JsonSerializableGenerator
// **************************************************************************
PendingResolveRequest _$PendingResolveRequestFromJson(
Map<String, dynamic> json,
) => $checkedCreate('PendingResolveRequest', json, ($checkedConvert) {
$checkKeys(json, requiredKeys: const ['action']);
final val = PendingResolveRequest(
action: $checkedConvert(
'action',
(v) => $enumDecode(
_$PendingResolveRequestActionEnumEnumMap,
v,
unknownValue: PendingResolveRequestActionEnum.unknownDefaultOpenApi,
),
),
instrument: $checkedConvert(
'instrument',
(v) =>
v == null ? null : NewInstrument.fromJson(v as Map<String, dynamic>),
),
instrumentId: $checkedConvert('instrument_id', (v) => (v as num?)?.toInt()),
);
return val;
}, fieldKeyMap: const {'instrumentId': 'instrument_id'});
Map<String, dynamic> _$PendingResolveRequestToJson(
PendingResolveRequest instance,
) => <String, dynamic>{
'action': _$PendingResolveRequestActionEnumEnumMap[instance.action]!,
'instrument': ?instance.instrument?.toJson(),
'instrument_id': ?instance.instrumentId,
};
const _$PendingResolveRequestActionEnumEnumMap = {
PendingResolveRequestActionEnum.link: 'link',
PendingResolveRequestActionEnum.create: 'create',
PendingResolveRequestActionEnum.ignore: 'ignore',
PendingResolveRequestActionEnum.unknownDefaultOpenApi:
'unknown_default_open_api',
};
@@ -0,0 +1,138 @@
//
// AUTO-GENERATED FILE, DO NOT MODIFY!
//
// ignore_for_file: unused_element
import 'package:copy_with_extension/copy_with_extension.dart';
import 'package:json_annotation/json_annotation.dart';
part 'pending_resolve_result.g.dart';
@CopyWith()
@JsonSerializable(
checked: true,
createToJson: true,
disallowUnrecognizedKeys: false,
explicitToJson: true,
)
class PendingResolveResult {
/// Returns a new [PendingResolveResult] instance.
PendingResolveResult({
required this.aliasCreated,
required this.eventsBound,
required this.id,
this.instrumentId,
required this.metricsRefreshed,
required this.status,
});
@JsonKey(
name: r'alias_created',
required: true,
includeIfNull: false,
)
final bool aliasCreated;
@JsonKey(
name: r'events_bound',
required: true,
includeIfNull: false,
)
final int eventsBound;
@JsonKey(
name: r'id',
required: true,
includeIfNull: false,
)
final int id;
@JsonKey(
name: r'instrument_id',
required: false,
includeIfNull: false,
)
final int? instrumentId;
@JsonKey(
name: r'metrics_refreshed',
required: true,
includeIfNull: false,
)
final bool metricsRefreshed;
@JsonKey(
name: r'status',
required: true,
includeIfNull: false,
)
final String status;
@override
bool operator ==(Object other) => identical(this, other) || other is PendingResolveResult &&
other.aliasCreated == aliasCreated &&
other.eventsBound == eventsBound &&
other.id == id &&
other.instrumentId == instrumentId &&
other.metricsRefreshed == metricsRefreshed &&
other.status == status;
@override
int get hashCode =>
aliasCreated.hashCode +
eventsBound.hashCode +
id.hashCode +
(instrumentId == null ? 0 : instrumentId.hashCode) +
metricsRefreshed.hashCode +
status.hashCode;
factory PendingResolveResult.fromJson(Map<String, dynamic> json) => _$PendingResolveResultFromJson(json);
Map<String, dynamic> toJson() => _$PendingResolveResultToJson(this);
@override
String toString() {
return toJson().toString();
}
}
@@ -0,0 +1,168 @@
// GENERATED CODE - DO NOT MODIFY BY HAND
part of 'pending_resolve_result.dart';
// **************************************************************************
// CopyWithGenerator
// **************************************************************************
abstract class _$PendingResolveResultCWProxy {
PendingResolveResult aliasCreated(bool aliasCreated);
PendingResolveResult eventsBound(int eventsBound);
PendingResolveResult id(int id);
PendingResolveResult instrumentId(int? instrumentId);
PendingResolveResult metricsRefreshed(bool metricsRefreshed);
PendingResolveResult status(String status);
/// This function **does support** nullification of nullable fields. All `null` values passed to `non-nullable` fields will be ignored. You can also use `PendingResolveResult(...).copyWith.fieldName(...)` to override fields one at a time with nullification support.
///
/// Usage
/// ```dart
/// PendingResolveResult(...).copyWith(id: 12, name: "My name")
/// ````
PendingResolveResult call({
bool aliasCreated,
int eventsBound,
int id,
int? instrumentId,
bool metricsRefreshed,
String status,
});
}
/// Proxy class for `copyWith` functionality. This is a callable class and can be used as follows: `instanceOfPendingResolveResult.copyWith(...)`. Additionally contains functions for specific fields e.g. `instanceOfPendingResolveResult.copyWith.fieldName(...)`
class _$PendingResolveResultCWProxyImpl
implements _$PendingResolveResultCWProxy {
const _$PendingResolveResultCWProxyImpl(this._value);
final PendingResolveResult _value;
@override
PendingResolveResult aliasCreated(bool aliasCreated) =>
this(aliasCreated: aliasCreated);
@override
PendingResolveResult eventsBound(int eventsBound) =>
this(eventsBound: eventsBound);
@override
PendingResolveResult id(int id) => this(id: id);
@override
PendingResolveResult instrumentId(int? instrumentId) =>
this(instrumentId: instrumentId);
@override
PendingResolveResult metricsRefreshed(bool metricsRefreshed) =>
this(metricsRefreshed: metricsRefreshed);
@override
PendingResolveResult status(String status) => this(status: status);
@override
/// This function **does support** nullification of nullable fields. All `null` values passed to `non-nullable` fields will be ignored. You can also use `PendingResolveResult(...).copyWith.fieldName(...)` to override fields one at a time with nullification support.
///
/// Usage
/// ```dart
/// PendingResolveResult(...).copyWith(id: 12, name: "My name")
/// ````
PendingResolveResult call({
Object? aliasCreated = const $CopyWithPlaceholder(),
Object? eventsBound = const $CopyWithPlaceholder(),
Object? id = const $CopyWithPlaceholder(),
Object? instrumentId = const $CopyWithPlaceholder(),
Object? metricsRefreshed = const $CopyWithPlaceholder(),
Object? status = const $CopyWithPlaceholder(),
}) {
return PendingResolveResult(
aliasCreated: aliasCreated == const $CopyWithPlaceholder()
? _value.aliasCreated
// ignore: cast_nullable_to_non_nullable
: aliasCreated as bool,
eventsBound: eventsBound == const $CopyWithPlaceholder()
? _value.eventsBound
// ignore: cast_nullable_to_non_nullable
: eventsBound as int,
id: id == const $CopyWithPlaceholder()
? _value.id
// ignore: cast_nullable_to_non_nullable
: id as int,
instrumentId: instrumentId == const $CopyWithPlaceholder()
? _value.instrumentId
// ignore: cast_nullable_to_non_nullable
: instrumentId as int?,
metricsRefreshed: metricsRefreshed == const $CopyWithPlaceholder()
? _value.metricsRefreshed
// ignore: cast_nullable_to_non_nullable
: metricsRefreshed as bool,
status: status == const $CopyWithPlaceholder()
? _value.status
// ignore: cast_nullable_to_non_nullable
: status as String,
);
}
}
extension $PendingResolveResultCopyWith on PendingResolveResult {
/// Returns a callable class that can be used as follows: `instanceOfPendingResolveResult.copyWith(...)` or like so:`instanceOfPendingResolveResult.copyWith.fieldName(...)`.
// ignore: library_private_types_in_public_api
_$PendingResolveResultCWProxy get copyWith =>
_$PendingResolveResultCWProxyImpl(this);
}
// **************************************************************************
// JsonSerializableGenerator
// **************************************************************************
PendingResolveResult _$PendingResolveResultFromJson(
Map<String, dynamic> json,
) => $checkedCreate(
'PendingResolveResult',
json,
($checkedConvert) {
$checkKeys(
json,
requiredKeys: const [
'alias_created',
'events_bound',
'id',
'metrics_refreshed',
'status',
],
);
final val = PendingResolveResult(
aliasCreated: $checkedConvert('alias_created', (v) => v as bool),
eventsBound: $checkedConvert('events_bound', (v) => (v as num).toInt()),
id: $checkedConvert('id', (v) => (v as num).toInt()),
instrumentId: $checkedConvert(
'instrument_id',
(v) => (v as num?)?.toInt(),
),
metricsRefreshed: $checkedConvert('metrics_refreshed', (v) => v as bool),
status: $checkedConvert('status', (v) => v as String),
);
return val;
},
fieldKeyMap: const {
'aliasCreated': 'alias_created',
'eventsBound': 'events_bound',
'instrumentId': 'instrument_id',
'metricsRefreshed': 'metrics_refreshed',
},
);
Map<String, dynamic> _$PendingResolveResultToJson(
PendingResolveResult instance,
) => <String, dynamic>{
'alias_created': instance.aliasCreated,
'events_bound': instance.eventsBound,
'id': instance.id,
'instrument_id': ?instance.instrumentId,
'metrics_refreshed': instance.metricsRefreshed,
'status': instance.status,
};
@@ -0,0 +1,107 @@
//
// AUTO-GENERATED FILE, DO NOT MODIFY!
//
// ignore_for_file: unused_element
import 'package:copy_with_extension/copy_with_extension.dart';
import 'package:json_annotation/json_annotation.dart';
part 'price_manual_in.g.dart';
@CopyWith()
@JsonSerializable(
checked: true,
createToJson: true,
disallowUnrecognizedKeys: false,
explicitToJson: true,
)
class PriceManualIn {
/// Returns a new [PriceManualIn] instance.
PriceManualIn({
required this.currency,
required this.d,
this.note,
required this.price,
});
@JsonKey(
name: r'currency',
required: true,
includeIfNull: false,
)
final String currency;
@JsonKey(
name: r'd',
required: true,
includeIfNull: false,
)
final DateTime d;
@JsonKey(
name: r'note',
required: false,
includeIfNull: false,
)
final String? note;
/// decimal as string
@JsonKey(
name: r'price',
required: true,
includeIfNull: false,
)
final String price;
@override
bool operator ==(Object other) => identical(this, other) || other is PriceManualIn &&
other.currency == currency &&
other.d == d &&
other.note == note &&
other.price == price;
@override
int get hashCode =>
currency.hashCode +
d.hashCode +
(note == null ? 0 : note.hashCode) +
price.hashCode;
factory PriceManualIn.fromJson(Map<String, dynamic> json) => _$PriceManualInFromJson(json);
Map<String, dynamic> toJson() => _$PriceManualInToJson(this);
@override
String toString() {
return toJson().toString();
}
}
@@ -0,0 +1,107 @@
// GENERATED CODE - DO NOT MODIFY BY HAND
part of 'price_manual_in.dart';
// **************************************************************************
// CopyWithGenerator
// **************************************************************************
abstract class _$PriceManualInCWProxy {
PriceManualIn currency(String currency);
PriceManualIn d(DateTime d);
PriceManualIn note(String? note);
PriceManualIn price(String price);
/// This function **does support** nullification of nullable fields. All `null` values passed to `non-nullable` fields will be ignored. You can also use `PriceManualIn(...).copyWith.fieldName(...)` to override fields one at a time with nullification support.
///
/// Usage
/// ```dart
/// PriceManualIn(...).copyWith(id: 12, name: "My name")
/// ````
PriceManualIn call({String currency, DateTime d, String? note, String price});
}
/// Proxy class for `copyWith` functionality. This is a callable class and can be used as follows: `instanceOfPriceManualIn.copyWith(...)`. Additionally contains functions for specific fields e.g. `instanceOfPriceManualIn.copyWith.fieldName(...)`
class _$PriceManualInCWProxyImpl implements _$PriceManualInCWProxy {
const _$PriceManualInCWProxyImpl(this._value);
final PriceManualIn _value;
@override
PriceManualIn currency(String currency) => this(currency: currency);
@override
PriceManualIn d(DateTime d) => this(d: d);
@override
PriceManualIn note(String? note) => this(note: note);
@override
PriceManualIn price(String price) => this(price: price);
@override
/// This function **does support** nullification of nullable fields. All `null` values passed to `non-nullable` fields will be ignored. You can also use `PriceManualIn(...).copyWith.fieldName(...)` to override fields one at a time with nullification support.
///
/// Usage
/// ```dart
/// PriceManualIn(...).copyWith(id: 12, name: "My name")
/// ````
PriceManualIn call({
Object? currency = const $CopyWithPlaceholder(),
Object? d = const $CopyWithPlaceholder(),
Object? note = const $CopyWithPlaceholder(),
Object? price = const $CopyWithPlaceholder(),
}) {
return PriceManualIn(
currency: currency == const $CopyWithPlaceholder()
? _value.currency
// ignore: cast_nullable_to_non_nullable
: currency as String,
d: d == const $CopyWithPlaceholder()
? _value.d
// ignore: cast_nullable_to_non_nullable
: d as DateTime,
note: note == const $CopyWithPlaceholder()
? _value.note
// ignore: cast_nullable_to_non_nullable
: note as String?,
price: price == const $CopyWithPlaceholder()
? _value.price
// ignore: cast_nullable_to_non_nullable
: price as String,
);
}
}
extension $PriceManualInCopyWith on PriceManualIn {
/// Returns a callable class that can be used as follows: `instanceOfPriceManualIn.copyWith(...)` or like so:`instanceOfPriceManualIn.copyWith.fieldName(...)`.
// ignore: library_private_types_in_public_api
_$PriceManualInCWProxy get copyWith => _$PriceManualInCWProxyImpl(this);
}
// **************************************************************************
// JsonSerializableGenerator
// **************************************************************************
PriceManualIn _$PriceManualInFromJson(Map<String, dynamic> json) =>
$checkedCreate('PriceManualIn', json, ($checkedConvert) {
$checkKeys(json, requiredKeys: const ['currency', 'd', 'price']);
final val = PriceManualIn(
currency: $checkedConvert('currency', (v) => v as String),
d: $checkedConvert('d', (v) => DateTime.parse(v as String)),
note: $checkedConvert('note', (v) => v as String?),
price: $checkedConvert('price', (v) => v as String),
);
return val;
});
Map<String, dynamic> _$PriceManualInToJson(PriceManualIn instance) =>
<String, dynamic>{
'currency': instance.currency,
'd': instance.d.toIso8601String(),
'note': ?instance.note,
'price': instance.price,
};
@@ -0,0 +1,139 @@
//
// AUTO-GENERATED FILE, DO NOT MODIFY!
//
// ignore_for_file: unused_element
import 'package:copy_with_extension/copy_with_extension.dart';
import 'package:json_annotation/json_annotation.dart';
part 'price_manual_out.g.dart';
@CopyWith()
@JsonSerializable(
checked: true,
createToJson: true,
disallowUnrecognizedKeys: false,
explicitToJson: true,
)
class PriceManualOut {
/// Returns a new [PriceManualOut] instance.
PriceManualOut({
required this.currency,
required this.d,
required this.id,
required this.instrumentId,
required this.note,
required this.price,
});
@JsonKey(
name: r'currency',
required: true,
includeIfNull: false,
)
final String currency;
@JsonKey(
name: r'd',
required: true,
includeIfNull: false,
)
final DateTime d;
@JsonKey(
name: r'id',
required: true,
includeIfNull: false,
)
final int id;
@JsonKey(
name: r'instrument_id',
required: true,
includeIfNull: false,
)
final int instrumentId;
@JsonKey(
name: r'note',
required: true,
includeIfNull: true,
)
final String? note;
/// decimal as string
@JsonKey(
name: r'price',
required: true,
includeIfNull: false,
)
final String price;
@override
bool operator ==(Object other) => identical(this, other) || other is PriceManualOut &&
other.currency == currency &&
other.d == d &&
other.id == id &&
other.instrumentId == instrumentId &&
other.note == note &&
other.price == price;
@override
int get hashCode =>
currency.hashCode +
d.hashCode +
id.hashCode +
instrumentId.hashCode +
(note == null ? 0 : note.hashCode) +
price.hashCode;
factory PriceManualOut.fromJson(Map<String, dynamic> json) => _$PriceManualOutFromJson(json);
Map<String, dynamic> toJson() => _$PriceManualOutToJson(this);
@override
String toString() {
return toJson().toString();
}
}
@@ -0,0 +1,152 @@
// GENERATED CODE - DO NOT MODIFY BY HAND
part of 'price_manual_out.dart';
// **************************************************************************
// CopyWithGenerator
// **************************************************************************
abstract class _$PriceManualOutCWProxy {
PriceManualOut currency(String currency);
PriceManualOut d(DateTime d);
PriceManualOut id(int id);
PriceManualOut instrumentId(int instrumentId);
PriceManualOut note(String? note);
PriceManualOut price(String price);
/// This function **does support** nullification of nullable fields. All `null` values passed to `non-nullable` fields will be ignored. You can also use `PriceManualOut(...).copyWith.fieldName(...)` to override fields one at a time with nullification support.
///
/// Usage
/// ```dart
/// PriceManualOut(...).copyWith(id: 12, name: "My name")
/// ````
PriceManualOut call({
String currency,
DateTime d,
int id,
int instrumentId,
String? note,
String price,
});
}
/// Proxy class for `copyWith` functionality. This is a callable class and can be used as follows: `instanceOfPriceManualOut.copyWith(...)`. Additionally contains functions for specific fields e.g. `instanceOfPriceManualOut.copyWith.fieldName(...)`
class _$PriceManualOutCWProxyImpl implements _$PriceManualOutCWProxy {
const _$PriceManualOutCWProxyImpl(this._value);
final PriceManualOut _value;
@override
PriceManualOut currency(String currency) => this(currency: currency);
@override
PriceManualOut d(DateTime d) => this(d: d);
@override
PriceManualOut id(int id) => this(id: id);
@override
PriceManualOut instrumentId(int instrumentId) =>
this(instrumentId: instrumentId);
@override
PriceManualOut note(String? note) => this(note: note);
@override
PriceManualOut price(String price) => this(price: price);
@override
/// This function **does support** nullification of nullable fields. All `null` values passed to `non-nullable` fields will be ignored. You can also use `PriceManualOut(...).copyWith.fieldName(...)` to override fields one at a time with nullification support.
///
/// Usage
/// ```dart
/// PriceManualOut(...).copyWith(id: 12, name: "My name")
/// ````
PriceManualOut call({
Object? currency = const $CopyWithPlaceholder(),
Object? d = const $CopyWithPlaceholder(),
Object? id = const $CopyWithPlaceholder(),
Object? instrumentId = const $CopyWithPlaceholder(),
Object? note = const $CopyWithPlaceholder(),
Object? price = const $CopyWithPlaceholder(),
}) {
return PriceManualOut(
currency: currency == const $CopyWithPlaceholder()
? _value.currency
// ignore: cast_nullable_to_non_nullable
: currency as String,
d: d == const $CopyWithPlaceholder()
? _value.d
// ignore: cast_nullable_to_non_nullable
: d as DateTime,
id: id == const $CopyWithPlaceholder()
? _value.id
// ignore: cast_nullable_to_non_nullable
: id as int,
instrumentId: instrumentId == const $CopyWithPlaceholder()
? _value.instrumentId
// ignore: cast_nullable_to_non_nullable
: instrumentId as int,
note: note == const $CopyWithPlaceholder()
? _value.note
// ignore: cast_nullable_to_non_nullable
: note as String?,
price: price == const $CopyWithPlaceholder()
? _value.price
// ignore: cast_nullable_to_non_nullable
: price as String,
);
}
}
extension $PriceManualOutCopyWith on PriceManualOut {
/// Returns a callable class that can be used as follows: `instanceOfPriceManualOut.copyWith(...)` or like so:`instanceOfPriceManualOut.copyWith.fieldName(...)`.
// ignore: library_private_types_in_public_api
_$PriceManualOutCWProxy get copyWith => _$PriceManualOutCWProxyImpl(this);
}
// **************************************************************************
// JsonSerializableGenerator
// **************************************************************************
PriceManualOut _$PriceManualOutFromJson(Map<String, dynamic> json) =>
$checkedCreate('PriceManualOut', json, ($checkedConvert) {
$checkKeys(
json,
requiredKeys: const [
'currency',
'd',
'id',
'instrument_id',
'note',
'price',
],
);
final val = PriceManualOut(
currency: $checkedConvert('currency', (v) => v as String),
d: $checkedConvert('d', (v) => DateTime.parse(v as String)),
id: $checkedConvert('id', (v) => (v as num).toInt()),
instrumentId: $checkedConvert(
'instrument_id',
(v) => (v as num).toInt(),
),
note: $checkedConvert('note', (v) => v as String?),
price: $checkedConvert('price', (v) => v as String),
);
return val;
}, fieldKeyMap: const {'instrumentId': 'instrument_id'});
Map<String, dynamic> _$PriceManualOutToJson(PriceManualOut instance) =>
<String, dynamic>{
'currency': instance.currency,
'd': instance.d.toIso8601String(),
'id': instance.id,
'instrument_id': instance.instrumentId,
'note': instance.note,
'price': instance.price,
};
@@ -27,6 +27,8 @@ class PricePoint {
required this.currency,
required this.d,
this.source_ = 'daily',
});
/// decimal as string
@@ -79,6 +81,18 @@ class PricePoint {
@JsonKey(
defaultValue: 'daily',
name: r'source',
required: false,
includeIfNull: false,
)
final String? source_;
@override
@@ -86,14 +100,16 @@ class PricePoint {
other.accruedInterest == accruedInterest &&
other.close == close &&
other.currency == currency &&
other.d == d;
other.d == d &&
other.source_ == source_;
@override
int get hashCode =>
(accruedInterest == null ? 0 : accruedInterest.hashCode) +
close.hashCode +
currency.hashCode +
d.hashCode;
d.hashCode +
source_.hashCode;
factory PricePoint.fromJson(Map<String, dynamic> json) => _$PricePointFromJson(json);
@@ -15,6 +15,8 @@ abstract class _$PricePointCWProxy {
PricePoint d(DateTime d);
PricePoint source_(String? source_);
/// This function **does support** nullification of nullable fields. All `null` values passed to `non-nullable` fields will be ignored. You can also use `PricePoint(...).copyWith.fieldName(...)` to override fields one at a time with nullification support.
///
/// Usage
@@ -26,6 +28,7 @@ abstract class _$PricePointCWProxy {
String close,
String currency,
DateTime d,
String? source_,
});
}
@@ -48,6 +51,9 @@ class _$PricePointCWProxyImpl implements _$PricePointCWProxy {
@override
PricePoint d(DateTime d) => this(d: d);
@override
PricePoint source_(String? source_) => this(source_: source_);
@override
/// This function **does support** nullification of nullable fields. All `null` values passed to `non-nullable` fields will be ignored. You can also use `PricePoint(...).copyWith.fieldName(...)` to override fields one at a time with nullification support.
///
@@ -60,6 +66,7 @@ class _$PricePointCWProxyImpl implements _$PricePointCWProxy {
Object? close = const $CopyWithPlaceholder(),
Object? currency = const $CopyWithPlaceholder(),
Object? d = const $CopyWithPlaceholder(),
Object? source_ = const $CopyWithPlaceholder(),
}) {
return PricePoint(
accruedInterest: accruedInterest == const $CopyWithPlaceholder()
@@ -78,6 +85,10 @@ class _$PricePointCWProxyImpl implements _$PricePointCWProxy {
? _value.d
// ignore: cast_nullable_to_non_nullable
: d as DateTime,
source_: source_ == const $CopyWithPlaceholder()
? _value.source_
// ignore: cast_nullable_to_non_nullable
: source_ as String?,
);
}
}
@@ -105,10 +116,14 @@ PricePoint _$PricePointFromJson(Map<String, dynamic> json) => $checkedCreate(
close: $checkedConvert('close', (v) => v as String),
currency: $checkedConvert('currency', (v) => v as String),
d: $checkedConvert('d', (v) => DateTime.parse(v as String)),
source_: $checkedConvert('source', (v) => v as String? ?? 'daily'),
);
return val;
},
fieldKeyMap: const {'accruedInterest': 'accrued_interest'},
fieldKeyMap: const {
'accruedInterest': 'accrued_interest',
'source_': 'source',
},
);
Map<String, dynamic> _$PricePointToJson(PricePoint instance) =>
@@ -117,4 +132,5 @@ Map<String, dynamic> _$PricePointToJson(PricePoint instance) =>
'close': instance.close,
'currency': instance.currency,
'd': instance.d.toIso8601String(),
'source': ?instance.source_,
};
@@ -0,0 +1,176 @@
//
// AUTO-GENERATED FILE, DO NOT MODIFY!
//
// ignore_for_file: unused_element
import 'package:fintracker_api/src/model/trade_out.dart';
import 'package:copy_with_extension/copy_with_extension.dart';
import 'package:json_annotation/json_annotation.dart';
part 'rebalance_bucket_out.g.dart';
@CopyWith()
@JsonSerializable(
checked: true,
createToJson: true,
disallowUnrecognizedKeys: false,
explicitToJson: true,
)
class RebalanceBucketOut {
/// Returns a new [RebalanceBucketOut] instance.
RebalanceBucketOut({
required this.bucket,
required this.currentValueRub,
required this.currentWeight,
required this.deltaValueRub,
required this.drift,
required this.targetWeight,
required this.trades,
required this.withinBand,
});
@JsonKey(
name: r'bucket',
required: true,
includeIfNull: false,
)
final String bucket;
/// decimal as string
@JsonKey(
name: r'current_value_rub',
required: true,
includeIfNull: false,
)
final String currentValueRub;
/// decimal as string
@JsonKey(
name: r'current_weight',
required: true,
includeIfNull: false,
)
final String currentWeight;
/// decimal as string
@JsonKey(
name: r'delta_value_rub',
required: true,
includeIfNull: false,
)
final String deltaValueRub;
/// decimal as string
@JsonKey(
name: r'drift',
required: true,
includeIfNull: true,
)
final String? drift;
/// decimal as string
@JsonKey(
name: r'target_weight',
required: true,
includeIfNull: true,
)
final String? targetWeight;
@JsonKey(
name: r'trades',
required: true,
includeIfNull: false,
)
final List<TradeOut> trades;
@JsonKey(
name: r'within_band',
required: true,
includeIfNull: false,
)
final bool withinBand;
@override
bool operator ==(Object other) => identical(this, other) || other is RebalanceBucketOut &&
other.bucket == bucket &&
other.currentValueRub == currentValueRub &&
other.currentWeight == currentWeight &&
other.deltaValueRub == deltaValueRub &&
other.drift == drift &&
other.targetWeight == targetWeight &&
other.trades == trades &&
other.withinBand == withinBand;
@override
int get hashCode =>
bucket.hashCode +
currentValueRub.hashCode +
currentWeight.hashCode +
deltaValueRub.hashCode +
(drift == null ? 0 : drift.hashCode) +
(targetWeight == null ? 0 : targetWeight.hashCode) +
trades.hashCode +
withinBand.hashCode;
factory RebalanceBucketOut.fromJson(Map<String, dynamic> json) => _$RebalanceBucketOutFromJson(json);
Map<String, dynamic> toJson() => _$RebalanceBucketOutToJson(this);
@override
String toString() {
return toJson().toString();
}
}
@@ -0,0 +1,201 @@
// GENERATED CODE - DO NOT MODIFY BY HAND
part of 'rebalance_bucket_out.dart';
// **************************************************************************
// CopyWithGenerator
// **************************************************************************
abstract class _$RebalanceBucketOutCWProxy {
RebalanceBucketOut bucket(String bucket);
RebalanceBucketOut currentValueRub(String currentValueRub);
RebalanceBucketOut currentWeight(String currentWeight);
RebalanceBucketOut deltaValueRub(String deltaValueRub);
RebalanceBucketOut drift(String? drift);
RebalanceBucketOut targetWeight(String? targetWeight);
RebalanceBucketOut trades(List<TradeOut> trades);
RebalanceBucketOut withinBand(bool withinBand);
/// This function **does support** nullification of nullable fields. All `null` values passed to `non-nullable` fields will be ignored. You can also use `RebalanceBucketOut(...).copyWith.fieldName(...)` to override fields one at a time with nullification support.
///
/// Usage
/// ```dart
/// RebalanceBucketOut(...).copyWith(id: 12, name: "My name")
/// ````
RebalanceBucketOut call({
String bucket,
String currentValueRub,
String currentWeight,
String deltaValueRub,
String? drift,
String? targetWeight,
List<TradeOut> trades,
bool withinBand,
});
}
/// Proxy class for `copyWith` functionality. This is a callable class and can be used as follows: `instanceOfRebalanceBucketOut.copyWith(...)`. Additionally contains functions for specific fields e.g. `instanceOfRebalanceBucketOut.copyWith.fieldName(...)`
class _$RebalanceBucketOutCWProxyImpl implements _$RebalanceBucketOutCWProxy {
const _$RebalanceBucketOutCWProxyImpl(this._value);
final RebalanceBucketOut _value;
@override
RebalanceBucketOut bucket(String bucket) => this(bucket: bucket);
@override
RebalanceBucketOut currentValueRub(String currentValueRub) =>
this(currentValueRub: currentValueRub);
@override
RebalanceBucketOut currentWeight(String currentWeight) =>
this(currentWeight: currentWeight);
@override
RebalanceBucketOut deltaValueRub(String deltaValueRub) =>
this(deltaValueRub: deltaValueRub);
@override
RebalanceBucketOut drift(String? drift) => this(drift: drift);
@override
RebalanceBucketOut targetWeight(String? targetWeight) =>
this(targetWeight: targetWeight);
@override
RebalanceBucketOut trades(List<TradeOut> trades) => this(trades: trades);
@override
RebalanceBucketOut withinBand(bool withinBand) =>
this(withinBand: withinBand);
@override
/// This function **does support** nullification of nullable fields. All `null` values passed to `non-nullable` fields will be ignored. You can also use `RebalanceBucketOut(...).copyWith.fieldName(...)` to override fields one at a time with nullification support.
///
/// Usage
/// ```dart
/// RebalanceBucketOut(...).copyWith(id: 12, name: "My name")
/// ````
RebalanceBucketOut call({
Object? bucket = const $CopyWithPlaceholder(),
Object? currentValueRub = const $CopyWithPlaceholder(),
Object? currentWeight = const $CopyWithPlaceholder(),
Object? deltaValueRub = const $CopyWithPlaceholder(),
Object? drift = const $CopyWithPlaceholder(),
Object? targetWeight = const $CopyWithPlaceholder(),
Object? trades = const $CopyWithPlaceholder(),
Object? withinBand = const $CopyWithPlaceholder(),
}) {
return RebalanceBucketOut(
bucket: bucket == const $CopyWithPlaceholder()
? _value.bucket
// ignore: cast_nullable_to_non_nullable
: bucket as String,
currentValueRub: currentValueRub == const $CopyWithPlaceholder()
? _value.currentValueRub
// ignore: cast_nullable_to_non_nullable
: currentValueRub as String,
currentWeight: currentWeight == const $CopyWithPlaceholder()
? _value.currentWeight
// ignore: cast_nullable_to_non_nullable
: currentWeight as String,
deltaValueRub: deltaValueRub == const $CopyWithPlaceholder()
? _value.deltaValueRub
// ignore: cast_nullable_to_non_nullable
: deltaValueRub as String,
drift: drift == const $CopyWithPlaceholder()
? _value.drift
// ignore: cast_nullable_to_non_nullable
: drift as String?,
targetWeight: targetWeight == const $CopyWithPlaceholder()
? _value.targetWeight
// ignore: cast_nullable_to_non_nullable
: targetWeight as String?,
trades: trades == const $CopyWithPlaceholder()
? _value.trades
// ignore: cast_nullable_to_non_nullable
: trades as List<TradeOut>,
withinBand: withinBand == const $CopyWithPlaceholder()
? _value.withinBand
// ignore: cast_nullable_to_non_nullable
: withinBand as bool,
);
}
}
extension $RebalanceBucketOutCopyWith on RebalanceBucketOut {
/// Returns a callable class that can be used as follows: `instanceOfRebalanceBucketOut.copyWith(...)` or like so:`instanceOfRebalanceBucketOut.copyWith.fieldName(...)`.
// ignore: library_private_types_in_public_api
_$RebalanceBucketOutCWProxy get copyWith =>
_$RebalanceBucketOutCWProxyImpl(this);
}
// **************************************************************************
// JsonSerializableGenerator
// **************************************************************************
RebalanceBucketOut _$RebalanceBucketOutFromJson(Map<String, dynamic> json) =>
$checkedCreate(
'RebalanceBucketOut',
json,
($checkedConvert) {
$checkKeys(
json,
requiredKeys: const [
'bucket',
'current_value_rub',
'current_weight',
'delta_value_rub',
'drift',
'target_weight',
'trades',
'within_band',
],
);
final val = RebalanceBucketOut(
bucket: $checkedConvert('bucket', (v) => v as String),
currentValueRub: $checkedConvert(
'current_value_rub',
(v) => v as String,
),
currentWeight: $checkedConvert('current_weight', (v) => v as String),
deltaValueRub: $checkedConvert('delta_value_rub', (v) => v as String),
drift: $checkedConvert('drift', (v) => v as String?),
targetWeight: $checkedConvert('target_weight', (v) => v as String?),
trades: $checkedConvert(
'trades',
(v) => (v as List<dynamic>)
.map((e) => TradeOut.fromJson(e as Map<String, dynamic>))
.toList(),
),
withinBand: $checkedConvert('within_band', (v) => v as bool),
);
return val;
},
fieldKeyMap: const {
'currentValueRub': 'current_value_rub',
'currentWeight': 'current_weight',
'deltaValueRub': 'delta_value_rub',
'targetWeight': 'target_weight',
'withinBand': 'within_band',
},
);
Map<String, dynamic> _$RebalanceBucketOutToJson(RebalanceBucketOut instance) =>
<String, dynamic>{
'bucket': instance.bucket,
'current_value_rub': instance.currentValueRub,
'current_weight': instance.currentWeight,
'delta_value_rub': instance.deltaValueRub,
'drift': instance.drift,
'target_weight': instance.targetWeight,
'trades': instance.trades.map((e) => e.toJson()).toList(),
'within_band': instance.withinBand,
};
@@ -0,0 +1,157 @@
//
// AUTO-GENERATED FILE, DO NOT MODIFY!
//
// ignore_for_file: unused_element
import 'package:fintracker_api/src/model/rebalance_bucket_out.dart';
import 'package:copy_with_extension/copy_with_extension.dart';
import 'package:json_annotation/json_annotation.dart';
part 'rebalance_out.g.dart';
@CopyWith()
@JsonSerializable(
checked: true,
createToJson: true,
disallowUnrecognizedKeys: false,
explicitToJson: true,
)
class RebalanceOut {
/// Returns a new [RebalanceOut] instance.
RebalanceOut({
required this.asOf,
required this.buckets,
required this.cashAvailableRub,
required this.dimension,
required this.portfolioId,
required this.totalValueRub,
required this.warnings,
});
@JsonKey(
name: r'as_of',
required: true,
includeIfNull: false,
)
final DateTime asOf;
@JsonKey(
name: r'buckets',
required: true,
includeIfNull: false,
)
final List<RebalanceBucketOut> buckets;
/// decimal as string
@JsonKey(
name: r'cash_available_rub',
required: true,
includeIfNull: false,
)
final String cashAvailableRub;
@JsonKey(
name: r'dimension',
required: true,
includeIfNull: false,
)
final String dimension;
@JsonKey(
name: r'portfolio_id',
required: true,
includeIfNull: false,
)
final int portfolioId;
/// decimal as string
@JsonKey(
name: r'total_value_rub',
required: true,
includeIfNull: false,
)
final String totalValueRub;
@JsonKey(
name: r'warnings',
required: true,
includeIfNull: false,
)
final List<String> warnings;
@override
bool operator ==(Object other) => identical(this, other) || other is RebalanceOut &&
other.asOf == asOf &&
other.buckets == buckets &&
other.cashAvailableRub == cashAvailableRub &&
other.dimension == dimension &&
other.portfolioId == portfolioId &&
other.totalValueRub == totalValueRub &&
other.warnings == warnings;
@override
int get hashCode =>
asOf.hashCode +
buckets.hashCode +
cashAvailableRub.hashCode +
dimension.hashCode +
portfolioId.hashCode +
totalValueRub.hashCode +
warnings.hashCode;
factory RebalanceOut.fromJson(Map<String, dynamic> json) => _$RebalanceOutFromJson(json);
Map<String, dynamic> toJson() => _$RebalanceOutToJson(this);
@override
String toString() {
return toJson().toString();
}
}
@@ -0,0 +1,187 @@
// GENERATED CODE - DO NOT MODIFY BY HAND
part of 'rebalance_out.dart';
// **************************************************************************
// CopyWithGenerator
// **************************************************************************
abstract class _$RebalanceOutCWProxy {
RebalanceOut asOf(DateTime asOf);
RebalanceOut buckets(List<RebalanceBucketOut> buckets);
RebalanceOut cashAvailableRub(String cashAvailableRub);
RebalanceOut dimension(String dimension);
RebalanceOut portfolioId(int portfolioId);
RebalanceOut totalValueRub(String totalValueRub);
RebalanceOut warnings(List<String> warnings);
/// This function **does support** nullification of nullable fields. All `null` values passed to `non-nullable` fields will be ignored. You can also use `RebalanceOut(...).copyWith.fieldName(...)` to override fields one at a time with nullification support.
///
/// Usage
/// ```dart
/// RebalanceOut(...).copyWith(id: 12, name: "My name")
/// ````
RebalanceOut call({
DateTime asOf,
List<RebalanceBucketOut> buckets,
String cashAvailableRub,
String dimension,
int portfolioId,
String totalValueRub,
List<String> warnings,
});
}
/// Proxy class for `copyWith` functionality. This is a callable class and can be used as follows: `instanceOfRebalanceOut.copyWith(...)`. Additionally contains functions for specific fields e.g. `instanceOfRebalanceOut.copyWith.fieldName(...)`
class _$RebalanceOutCWProxyImpl implements _$RebalanceOutCWProxy {
const _$RebalanceOutCWProxyImpl(this._value);
final RebalanceOut _value;
@override
RebalanceOut asOf(DateTime asOf) => this(asOf: asOf);
@override
RebalanceOut buckets(List<RebalanceBucketOut> buckets) =>
this(buckets: buckets);
@override
RebalanceOut cashAvailableRub(String cashAvailableRub) =>
this(cashAvailableRub: cashAvailableRub);
@override
RebalanceOut dimension(String dimension) => this(dimension: dimension);
@override
RebalanceOut portfolioId(int portfolioId) => this(portfolioId: portfolioId);
@override
RebalanceOut totalValueRub(String totalValueRub) =>
this(totalValueRub: totalValueRub);
@override
RebalanceOut warnings(List<String> warnings) => this(warnings: warnings);
@override
/// This function **does support** nullification of nullable fields. All `null` values passed to `non-nullable` fields will be ignored. You can also use `RebalanceOut(...).copyWith.fieldName(...)` to override fields one at a time with nullification support.
///
/// Usage
/// ```dart
/// RebalanceOut(...).copyWith(id: 12, name: "My name")
/// ````
RebalanceOut call({
Object? asOf = const $CopyWithPlaceholder(),
Object? buckets = const $CopyWithPlaceholder(),
Object? cashAvailableRub = const $CopyWithPlaceholder(),
Object? dimension = const $CopyWithPlaceholder(),
Object? portfolioId = const $CopyWithPlaceholder(),
Object? totalValueRub = const $CopyWithPlaceholder(),
Object? warnings = const $CopyWithPlaceholder(),
}) {
return RebalanceOut(
asOf: asOf == const $CopyWithPlaceholder()
? _value.asOf
// ignore: cast_nullable_to_non_nullable
: asOf as DateTime,
buckets: buckets == const $CopyWithPlaceholder()
? _value.buckets
// ignore: cast_nullable_to_non_nullable
: buckets as List<RebalanceBucketOut>,
cashAvailableRub: cashAvailableRub == const $CopyWithPlaceholder()
? _value.cashAvailableRub
// ignore: cast_nullable_to_non_nullable
: cashAvailableRub as String,
dimension: dimension == const $CopyWithPlaceholder()
? _value.dimension
// ignore: cast_nullable_to_non_nullable
: dimension as String,
portfolioId: portfolioId == const $CopyWithPlaceholder()
? _value.portfolioId
// ignore: cast_nullable_to_non_nullable
: portfolioId as int,
totalValueRub: totalValueRub == const $CopyWithPlaceholder()
? _value.totalValueRub
// ignore: cast_nullable_to_non_nullable
: totalValueRub as String,
warnings: warnings == const $CopyWithPlaceholder()
? _value.warnings
// ignore: cast_nullable_to_non_nullable
: warnings as List<String>,
);
}
}
extension $RebalanceOutCopyWith on RebalanceOut {
/// Returns a callable class that can be used as follows: `instanceOfRebalanceOut.copyWith(...)` or like so:`instanceOfRebalanceOut.copyWith.fieldName(...)`.
// ignore: library_private_types_in_public_api
_$RebalanceOutCWProxy get copyWith => _$RebalanceOutCWProxyImpl(this);
}
// **************************************************************************
// JsonSerializableGenerator
// **************************************************************************
RebalanceOut _$RebalanceOutFromJson(
Map<String, dynamic> json,
) => $checkedCreate(
'RebalanceOut',
json,
($checkedConvert) {
$checkKeys(
json,
requiredKeys: const [
'as_of',
'buckets',
'cash_available_rub',
'dimension',
'portfolio_id',
'total_value_rub',
'warnings',
],
);
final val = RebalanceOut(
asOf: $checkedConvert('as_of', (v) => DateTime.parse(v as String)),
buckets: $checkedConvert(
'buckets',
(v) => (v as List<dynamic>)
.map((e) => RebalanceBucketOut.fromJson(e as Map<String, dynamic>))
.toList(),
),
cashAvailableRub: $checkedConvert(
'cash_available_rub',
(v) => v as String,
),
dimension: $checkedConvert('dimension', (v) => v as String),
portfolioId: $checkedConvert('portfolio_id', (v) => (v as num).toInt()),
totalValueRub: $checkedConvert('total_value_rub', (v) => v as String),
warnings: $checkedConvert(
'warnings',
(v) => (v as List<dynamic>).map((e) => e as String).toList(),
),
);
return val;
},
fieldKeyMap: const {
'asOf': 'as_of',
'cashAvailableRub': 'cash_available_rub',
'portfolioId': 'portfolio_id',
'totalValueRub': 'total_value_rub',
},
);
Map<String, dynamic> _$RebalanceOutToJson(RebalanceOut instance) =>
<String, dynamic>{
'as_of': instance.asOf.toIso8601String(),
'buckets': instance.buckets.map((e) => e.toJson()).toList(),
'cash_available_rub': instance.cashAvailableRub,
'dimension': instance.dimension,
'portfolio_id': instance.portfolioId,
'total_value_rub': instance.totalValueRub,
'warnings': instance.warnings,
};
@@ -0,0 +1,125 @@
//
// AUTO-GENERATED FILE, DO NOT MODIFY!
//
// ignore_for_file: unused_element
import 'package:copy_with_extension/copy_with_extension.dart';
import 'package:json_annotation/json_annotation.dart';
part 'reconciliation_cash.g.dart';
@CopyWith()
@JsonSerializable(
checked: true,
createToJson: true,
disallowUnrecognizedKeys: false,
explicitToJson: true,
)
class ReconciliationCash {
/// Returns a new [ReconciliationCash] instance.
ReconciliationCash({
required this.balanceDerived,
required this.balanceReport,
required this.currency,
required this.delta,
required this.matches,
});
/// decimal as string
@JsonKey(
name: r'balance_derived',
required: true,
includeIfNull: true,
)
final String? balanceDerived;
/// decimal as string
@JsonKey(
name: r'balance_report',
required: true,
includeIfNull: false,
)
final String balanceReport;
@JsonKey(
name: r'currency',
required: true,
includeIfNull: false,
)
final String currency;
/// decimal as string
@JsonKey(
name: r'delta',
required: true,
includeIfNull: true,
)
final String? delta;
@JsonKey(
name: r'matches',
required: true,
includeIfNull: false,
)
final bool matches;
@override
bool operator ==(Object other) => identical(this, other) || other is ReconciliationCash &&
other.balanceDerived == balanceDerived &&
other.balanceReport == balanceReport &&
other.currency == currency &&
other.delta == delta &&
other.matches == matches;
@override
int get hashCode =>
(balanceDerived == null ? 0 : balanceDerived.hashCode) +
balanceReport.hashCode +
currency.hashCode +
(delta == null ? 0 : delta.hashCode) +
matches.hashCode;
factory ReconciliationCash.fromJson(Map<String, dynamic> json) => _$ReconciliationCashFromJson(json);
Map<String, dynamic> toJson() => _$ReconciliationCashToJson(this);
@override
String toString() {
return toJson().toString();
}
}
@@ -0,0 +1,148 @@
// GENERATED CODE - DO NOT MODIFY BY HAND
part of 'reconciliation_cash.dart';
// **************************************************************************
// CopyWithGenerator
// **************************************************************************
abstract class _$ReconciliationCashCWProxy {
ReconciliationCash balanceDerived(String? balanceDerived);
ReconciliationCash balanceReport(String balanceReport);
ReconciliationCash currency(String currency);
ReconciliationCash delta(String? delta);
ReconciliationCash matches(bool matches);
/// This function **does support** nullification of nullable fields. All `null` values passed to `non-nullable` fields will be ignored. You can also use `ReconciliationCash(...).copyWith.fieldName(...)` to override fields one at a time with nullification support.
///
/// Usage
/// ```dart
/// ReconciliationCash(...).copyWith(id: 12, name: "My name")
/// ````
ReconciliationCash call({
String? balanceDerived,
String balanceReport,
String currency,
String? delta,
bool matches,
});
}
/// Proxy class for `copyWith` functionality. This is a callable class and can be used as follows: `instanceOfReconciliationCash.copyWith(...)`. Additionally contains functions for specific fields e.g. `instanceOfReconciliationCash.copyWith.fieldName(...)`
class _$ReconciliationCashCWProxyImpl implements _$ReconciliationCashCWProxy {
const _$ReconciliationCashCWProxyImpl(this._value);
final ReconciliationCash _value;
@override
ReconciliationCash balanceDerived(String? balanceDerived) =>
this(balanceDerived: balanceDerived);
@override
ReconciliationCash balanceReport(String balanceReport) =>
this(balanceReport: balanceReport);
@override
ReconciliationCash currency(String currency) => this(currency: currency);
@override
ReconciliationCash delta(String? delta) => this(delta: delta);
@override
ReconciliationCash matches(bool matches) => this(matches: matches);
@override
/// This function **does support** nullification of nullable fields. All `null` values passed to `non-nullable` fields will be ignored. You can also use `ReconciliationCash(...).copyWith.fieldName(...)` to override fields one at a time with nullification support.
///
/// Usage
/// ```dart
/// ReconciliationCash(...).copyWith(id: 12, name: "My name")
/// ````
ReconciliationCash call({
Object? balanceDerived = const $CopyWithPlaceholder(),
Object? balanceReport = const $CopyWithPlaceholder(),
Object? currency = const $CopyWithPlaceholder(),
Object? delta = const $CopyWithPlaceholder(),
Object? matches = const $CopyWithPlaceholder(),
}) {
return ReconciliationCash(
balanceDerived: balanceDerived == const $CopyWithPlaceholder()
? _value.balanceDerived
// ignore: cast_nullable_to_non_nullable
: balanceDerived as String?,
balanceReport: balanceReport == const $CopyWithPlaceholder()
? _value.balanceReport
// ignore: cast_nullable_to_non_nullable
: balanceReport as String,
currency: currency == const $CopyWithPlaceholder()
? _value.currency
// ignore: cast_nullable_to_non_nullable
: currency as String,
delta: delta == const $CopyWithPlaceholder()
? _value.delta
// ignore: cast_nullable_to_non_nullable
: delta as String?,
matches: matches == const $CopyWithPlaceholder()
? _value.matches
// ignore: cast_nullable_to_non_nullable
: matches as bool,
);
}
}
extension $ReconciliationCashCopyWith on ReconciliationCash {
/// Returns a callable class that can be used as follows: `instanceOfReconciliationCash.copyWith(...)` or like so:`instanceOfReconciliationCash.copyWith.fieldName(...)`.
// ignore: library_private_types_in_public_api
_$ReconciliationCashCWProxy get copyWith =>
_$ReconciliationCashCWProxyImpl(this);
}
// **************************************************************************
// JsonSerializableGenerator
// **************************************************************************
ReconciliationCash _$ReconciliationCashFromJson(Map<String, dynamic> json) =>
$checkedCreate(
'ReconciliationCash',
json,
($checkedConvert) {
$checkKeys(
json,
requiredKeys: const [
'balance_derived',
'balance_report',
'currency',
'delta',
'matches',
],
);
final val = ReconciliationCash(
balanceDerived: $checkedConvert(
'balance_derived',
(v) => v as String?,
),
balanceReport: $checkedConvert('balance_report', (v) => v as String),
currency: $checkedConvert('currency', (v) => v as String),
delta: $checkedConvert('delta', (v) => v as String?),
matches: $checkedConvert('matches', (v) => v as bool),
);
return val;
},
fieldKeyMap: const {
'balanceDerived': 'balance_derived',
'balanceReport': 'balance_report',
},
);
Map<String, dynamic> _$ReconciliationCashToJson(ReconciliationCash instance) =>
<String, dynamic>{
'balance_derived': instance.balanceDerived,
'balance_report': instance.balanceReport,
'currency': instance.currency,
'delta': instance.delta,
'matches': instance.matches,
};
@@ -0,0 +1,108 @@
//
// AUTO-GENERATED FILE, DO NOT MODIFY!
//
// ignore_for_file: unused_element
import 'package:fintracker_api/src/model/reconciliation_cash.dart';
import 'package:fintracker_api/src/model/reconciliation_position.dart';
import 'package:copy_with_extension/copy_with_extension.dart';
import 'package:json_annotation/json_annotation.dart';
part 'reconciliation_out.g.dart';
@CopyWith()
@JsonSerializable(
checked: true,
createToJson: true,
disallowUnrecognizedKeys: false,
explicitToJson: true,
)
class ReconciliationOut {
/// Returns a new [ReconciliationOut] instance.
ReconciliationOut({
required this.asOf,
this.cash,
this.matches = true,
this.positions,
});
@JsonKey(
name: r'as_of',
required: true,
includeIfNull: true,
)
final DateTime? asOf;
@JsonKey(
name: r'cash',
required: false,
includeIfNull: false,
)
final List<ReconciliationCash>? cash;
@JsonKey(
defaultValue: true,
name: r'matches',
required: false,
includeIfNull: false,
)
final bool? matches;
@JsonKey(
name: r'positions',
required: false,
includeIfNull: false,
)
final List<ReconciliationPosition>? positions;
@override
bool operator ==(Object other) => identical(this, other) || other is ReconciliationOut &&
other.asOf == asOf &&
other.cash == cash &&
other.matches == matches &&
other.positions == positions;
@override
int get hashCode =>
(asOf == null ? 0 : asOf.hashCode) +
cash.hashCode +
matches.hashCode +
positions.hashCode;
factory ReconciliationOut.fromJson(Map<String, dynamic> json) => _$ReconciliationOutFromJson(json);
Map<String, dynamic> toJson() => _$ReconciliationOutToJson(this);
@override
String toString() {
return toJson().toString();
}
}
@@ -0,0 +1,132 @@
// GENERATED CODE - DO NOT MODIFY BY HAND
part of 'reconciliation_out.dart';
// **************************************************************************
// CopyWithGenerator
// **************************************************************************
abstract class _$ReconciliationOutCWProxy {
ReconciliationOut asOf(DateTime? asOf);
ReconciliationOut cash(List<ReconciliationCash>? cash);
ReconciliationOut matches(bool? matches);
ReconciliationOut positions(List<ReconciliationPosition>? positions);
/// This function **does support** nullification of nullable fields. All `null` values passed to `non-nullable` fields will be ignored. You can also use `ReconciliationOut(...).copyWith.fieldName(...)` to override fields one at a time with nullification support.
///
/// Usage
/// ```dart
/// ReconciliationOut(...).copyWith(id: 12, name: "My name")
/// ````
ReconciliationOut call({
DateTime? asOf,
List<ReconciliationCash>? cash,
bool? matches,
List<ReconciliationPosition>? positions,
});
}
/// Proxy class for `copyWith` functionality. This is a callable class and can be used as follows: `instanceOfReconciliationOut.copyWith(...)`. Additionally contains functions for specific fields e.g. `instanceOfReconciliationOut.copyWith.fieldName(...)`
class _$ReconciliationOutCWProxyImpl implements _$ReconciliationOutCWProxy {
const _$ReconciliationOutCWProxyImpl(this._value);
final ReconciliationOut _value;
@override
ReconciliationOut asOf(DateTime? asOf) => this(asOf: asOf);
@override
ReconciliationOut cash(List<ReconciliationCash>? cash) => this(cash: cash);
@override
ReconciliationOut matches(bool? matches) => this(matches: matches);
@override
ReconciliationOut positions(List<ReconciliationPosition>? positions) =>
this(positions: positions);
@override
/// This function **does support** nullification of nullable fields. All `null` values passed to `non-nullable` fields will be ignored. You can also use `ReconciliationOut(...).copyWith.fieldName(...)` to override fields one at a time with nullification support.
///
/// Usage
/// ```dart
/// ReconciliationOut(...).copyWith(id: 12, name: "My name")
/// ````
ReconciliationOut call({
Object? asOf = const $CopyWithPlaceholder(),
Object? cash = const $CopyWithPlaceholder(),
Object? matches = const $CopyWithPlaceholder(),
Object? positions = const $CopyWithPlaceholder(),
}) {
return ReconciliationOut(
asOf: asOf == const $CopyWithPlaceholder()
? _value.asOf
// ignore: cast_nullable_to_non_nullable
: asOf as DateTime?,
cash: cash == const $CopyWithPlaceholder()
? _value.cash
// ignore: cast_nullable_to_non_nullable
: cash as List<ReconciliationCash>?,
matches: matches == const $CopyWithPlaceholder()
? _value.matches
// ignore: cast_nullable_to_non_nullable
: matches as bool?,
positions: positions == const $CopyWithPlaceholder()
? _value.positions
// ignore: cast_nullable_to_non_nullable
: positions as List<ReconciliationPosition>?,
);
}
}
extension $ReconciliationOutCopyWith on ReconciliationOut {
/// Returns a callable class that can be used as follows: `instanceOfReconciliationOut.copyWith(...)` or like so:`instanceOfReconciliationOut.copyWith.fieldName(...)`.
// ignore: library_private_types_in_public_api
_$ReconciliationOutCWProxy get copyWith =>
_$ReconciliationOutCWProxyImpl(this);
}
// **************************************************************************
// JsonSerializableGenerator
// **************************************************************************
ReconciliationOut _$ReconciliationOutFromJson(Map<String, dynamic> json) =>
$checkedCreate('ReconciliationOut', json, ($checkedConvert) {
$checkKeys(json, requiredKeys: const ['as_of']);
final val = ReconciliationOut(
asOf: $checkedConvert(
'as_of',
(v) => v == null ? null : DateTime.parse(v as String),
),
cash: $checkedConvert(
'cash',
(v) => (v as List<dynamic>?)
?.map(
(e) => ReconciliationCash.fromJson(e as Map<String, dynamic>),
)
.toList(),
),
matches: $checkedConvert('matches', (v) => v as bool? ?? true),
positions: $checkedConvert(
'positions',
(v) => (v as List<dynamic>?)
?.map(
(e) =>
ReconciliationPosition.fromJson(e as Map<String, dynamic>),
)
.toList(),
),
);
return val;
}, fieldKeyMap: const {'asOf': 'as_of'});
Map<String, dynamic> _$ReconciliationOutToJson(ReconciliationOut instance) =>
<String, dynamic>{
'as_of': instance.asOf?.toIso8601String(),
'cash': ?instance.cash?.map((e) => e.toJson()).toList(),
'matches': ?instance.matches,
'positions': ?instance.positions?.map((e) => e.toJson()).toList(),
};
@@ -0,0 +1,173 @@
//
// AUTO-GENERATED FILE, DO NOT MODIFY!
//
// ignore_for_file: unused_element
import 'package:copy_with_extension/copy_with_extension.dart';
import 'package:json_annotation/json_annotation.dart';
part 'reconciliation_position.g.dart';
@CopyWith()
@JsonSerializable(
checked: true,
createToJson: true,
disallowUnrecognizedKeys: false,
explicitToJson: true,
)
class ReconciliationPosition {
/// Returns a new [ReconciliationPosition] instance.
ReconciliationPosition({
required this.instrumentId,
required this.instrumentName,
required this.isin,
required this.matches,
required this.qtyDelta,
required this.qtyDerived,
required this.qtyReport,
required this.ticker,
});
@JsonKey(
name: r'instrument_id',
required: true,
includeIfNull: true,
)
final int? instrumentId;
@JsonKey(
name: r'instrument_name',
required: true,
includeIfNull: false,
)
final String instrumentName;
@JsonKey(
name: r'isin',
required: true,
includeIfNull: true,
)
final String? isin;
@JsonKey(
name: r'matches',
required: true,
includeIfNull: false,
)
final bool matches;
/// decimal as string
@JsonKey(
name: r'qty_delta',
required: true,
includeIfNull: true,
)
final String? qtyDelta;
/// decimal as string
@JsonKey(
name: r'qty_derived',
required: true,
includeIfNull: true,
)
final String? qtyDerived;
/// decimal as string
@JsonKey(
name: r'qty_report',
required: true,
includeIfNull: false,
)
final String qtyReport;
@JsonKey(
name: r'ticker',
required: true,
includeIfNull: true,
)
final String? ticker;
@override
bool operator ==(Object other) => identical(this, other) || other is ReconciliationPosition &&
other.instrumentId == instrumentId &&
other.instrumentName == instrumentName &&
other.isin == isin &&
other.matches == matches &&
other.qtyDelta == qtyDelta &&
other.qtyDerived == qtyDerived &&
other.qtyReport == qtyReport &&
other.ticker == ticker;
@override
int get hashCode =>
(instrumentId == null ? 0 : instrumentId.hashCode) +
instrumentName.hashCode +
(isin == null ? 0 : isin.hashCode) +
matches.hashCode +
(qtyDelta == null ? 0 : qtyDelta.hashCode) +
(qtyDerived == null ? 0 : qtyDerived.hashCode) +
qtyReport.hashCode +
(ticker == null ? 0 : ticker.hashCode);
factory ReconciliationPosition.fromJson(Map<String, dynamic> json) => _$ReconciliationPositionFromJson(json);
Map<String, dynamic> toJson() => _$ReconciliationPositionToJson(this);
@override
String toString() {
return toJson().toString();
}
}
@@ -0,0 +1,198 @@
// GENERATED CODE - DO NOT MODIFY BY HAND
part of 'reconciliation_position.dart';
// **************************************************************************
// CopyWithGenerator
// **************************************************************************
abstract class _$ReconciliationPositionCWProxy {
ReconciliationPosition instrumentId(int? instrumentId);
ReconciliationPosition instrumentName(String instrumentName);
ReconciliationPosition isin(String? isin);
ReconciliationPosition matches(bool matches);
ReconciliationPosition qtyDelta(String? qtyDelta);
ReconciliationPosition qtyDerived(String? qtyDerived);
ReconciliationPosition qtyReport(String qtyReport);
ReconciliationPosition ticker(String? ticker);
/// This function **does support** nullification of nullable fields. All `null` values passed to `non-nullable` fields will be ignored. You can also use `ReconciliationPosition(...).copyWith.fieldName(...)` to override fields one at a time with nullification support.
///
/// Usage
/// ```dart
/// ReconciliationPosition(...).copyWith(id: 12, name: "My name")
/// ````
ReconciliationPosition call({
int? instrumentId,
String instrumentName,
String? isin,
bool matches,
String? qtyDelta,
String? qtyDerived,
String qtyReport,
String? ticker,
});
}
/// Proxy class for `copyWith` functionality. This is a callable class and can be used as follows: `instanceOfReconciliationPosition.copyWith(...)`. Additionally contains functions for specific fields e.g. `instanceOfReconciliationPosition.copyWith.fieldName(...)`
class _$ReconciliationPositionCWProxyImpl
implements _$ReconciliationPositionCWProxy {
const _$ReconciliationPositionCWProxyImpl(this._value);
final ReconciliationPosition _value;
@override
ReconciliationPosition instrumentId(int? instrumentId) =>
this(instrumentId: instrumentId);
@override
ReconciliationPosition instrumentName(String instrumentName) =>
this(instrumentName: instrumentName);
@override
ReconciliationPosition isin(String? isin) => this(isin: isin);
@override
ReconciliationPosition matches(bool matches) => this(matches: matches);
@override
ReconciliationPosition qtyDelta(String? qtyDelta) => this(qtyDelta: qtyDelta);
@override
ReconciliationPosition qtyDerived(String? qtyDerived) =>
this(qtyDerived: qtyDerived);
@override
ReconciliationPosition qtyReport(String qtyReport) =>
this(qtyReport: qtyReport);
@override
ReconciliationPosition ticker(String? ticker) => this(ticker: ticker);
@override
/// This function **does support** nullification of nullable fields. All `null` values passed to `non-nullable` fields will be ignored. You can also use `ReconciliationPosition(...).copyWith.fieldName(...)` to override fields one at a time with nullification support.
///
/// Usage
/// ```dart
/// ReconciliationPosition(...).copyWith(id: 12, name: "My name")
/// ````
ReconciliationPosition call({
Object? instrumentId = const $CopyWithPlaceholder(),
Object? instrumentName = const $CopyWithPlaceholder(),
Object? isin = const $CopyWithPlaceholder(),
Object? matches = const $CopyWithPlaceholder(),
Object? qtyDelta = const $CopyWithPlaceholder(),
Object? qtyDerived = const $CopyWithPlaceholder(),
Object? qtyReport = const $CopyWithPlaceholder(),
Object? ticker = const $CopyWithPlaceholder(),
}) {
return ReconciliationPosition(
instrumentId: instrumentId == const $CopyWithPlaceholder()
? _value.instrumentId
// ignore: cast_nullable_to_non_nullable
: instrumentId as int?,
instrumentName: instrumentName == const $CopyWithPlaceholder()
? _value.instrumentName
// ignore: cast_nullable_to_non_nullable
: instrumentName as String,
isin: isin == const $CopyWithPlaceholder()
? _value.isin
// ignore: cast_nullable_to_non_nullable
: isin as String?,
matches: matches == const $CopyWithPlaceholder()
? _value.matches
// ignore: cast_nullable_to_non_nullable
: matches as bool,
qtyDelta: qtyDelta == const $CopyWithPlaceholder()
? _value.qtyDelta
// ignore: cast_nullable_to_non_nullable
: qtyDelta as String?,
qtyDerived: qtyDerived == const $CopyWithPlaceholder()
? _value.qtyDerived
// ignore: cast_nullable_to_non_nullable
: qtyDerived as String?,
qtyReport: qtyReport == const $CopyWithPlaceholder()
? _value.qtyReport
// ignore: cast_nullable_to_non_nullable
: qtyReport as String,
ticker: ticker == const $CopyWithPlaceholder()
? _value.ticker
// ignore: cast_nullable_to_non_nullable
: ticker as String?,
);
}
}
extension $ReconciliationPositionCopyWith on ReconciliationPosition {
/// Returns a callable class that can be used as follows: `instanceOfReconciliationPosition.copyWith(...)` or like so:`instanceOfReconciliationPosition.copyWith.fieldName(...)`.
// ignore: library_private_types_in_public_api
_$ReconciliationPositionCWProxy get copyWith =>
_$ReconciliationPositionCWProxyImpl(this);
}
// **************************************************************************
// JsonSerializableGenerator
// **************************************************************************
ReconciliationPosition _$ReconciliationPositionFromJson(
Map<String, dynamic> json,
) => $checkedCreate(
'ReconciliationPosition',
json,
($checkedConvert) {
$checkKeys(
json,
requiredKeys: const [
'instrument_id',
'instrument_name',
'isin',
'matches',
'qty_delta',
'qty_derived',
'qty_report',
'ticker',
],
);
final val = ReconciliationPosition(
instrumentId: $checkedConvert(
'instrument_id',
(v) => (v as num?)?.toInt(),
),
instrumentName: $checkedConvert('instrument_name', (v) => v as String),
isin: $checkedConvert('isin', (v) => v as String?),
matches: $checkedConvert('matches', (v) => v as bool),
qtyDelta: $checkedConvert('qty_delta', (v) => v as String?),
qtyDerived: $checkedConvert('qty_derived', (v) => v as String?),
qtyReport: $checkedConvert('qty_report', (v) => v as String),
ticker: $checkedConvert('ticker', (v) => v as String?),
);
return val;
},
fieldKeyMap: const {
'instrumentId': 'instrument_id',
'instrumentName': 'instrument_name',
'qtyDelta': 'qty_delta',
'qtyDerived': 'qty_derived',
'qtyReport': 'qty_report',
},
);
Map<String, dynamic> _$ReconciliationPositionToJson(
ReconciliationPosition instance,
) => <String, dynamic>{
'instrument_id': instance.instrumentId,
'instrument_name': instance.instrumentName,
'isin': instance.isin,
'matches': instance.matches,
'qty_delta': instance.qtyDelta,
'qty_derived': instance.qtyDerived,
'qty_report': instance.qtyReport,
'ticker': instance.ticker,
};
@@ -0,0 +1,302 @@
//
// AUTO-GENERATED FILE, DO NOT MODIFY!
//
// ignore_for_file: unused_element
import 'package:copy_with_extension/copy_with_extension.dart';
import 'package:json_annotation/json_annotation.dart';
part 'sample_event_out.g.dart';
@CopyWith()
@JsonSerializable(
checked: true,
createToJson: true,
disallowUnrecognizedKeys: false,
explicitToJson: true,
)
class SampleEventOut {
/// Returns a new [SampleEventOut] instance.
SampleEventOut({
required this.amount,
required this.currency,
required this.dedupeKey,
this.description,
this.fee,
this.instrumentId,
this.instrumentKey,
this.instrumentName,
required this.isDuplicate,
required this.kind,
required this.lineNo,
this.price,
this.quantity,
this.settleDate,
required this.tradeDate,
this.tradeNo,
});
/// decimal as string
@JsonKey(
name: r'amount',
required: true,
includeIfNull: false,
)
final String amount;
@JsonKey(
name: r'currency',
required: true,
includeIfNull: false,
)
final String currency;
@JsonKey(
name: r'dedupe_key',
required: true,
includeIfNull: false,
)
final String dedupeKey;
@JsonKey(
name: r'description',
required: false,
includeIfNull: false,
)
final String? description;
/// decimal as string
@JsonKey(
name: r'fee',
required: false,
includeIfNull: false,
)
final String? fee;
@JsonKey(
name: r'instrument_id',
required: false,
includeIfNull: false,
)
final int? instrumentId;
@JsonKey(
name: r'instrument_key',
required: false,
includeIfNull: false,
)
final String? instrumentKey;
@JsonKey(
name: r'instrument_name',
required: false,
includeIfNull: false,
)
final String? instrumentName;
@JsonKey(
name: r'is_duplicate',
required: true,
includeIfNull: false,
)
final bool isDuplicate;
@JsonKey(
name: r'kind',
required: true,
includeIfNull: false,
)
final String kind;
@JsonKey(
name: r'line_no',
required: true,
includeIfNull: false,
)
final int lineNo;
/// decimal as string
@JsonKey(
name: r'price',
required: false,
includeIfNull: false,
)
final String? price;
/// decimal as string
@JsonKey(
name: r'quantity',
required: false,
includeIfNull: false,
)
final String? quantity;
@JsonKey(
name: r'settle_date',
required: false,
includeIfNull: false,
)
final DateTime? settleDate;
@JsonKey(
name: r'trade_date',
required: true,
includeIfNull: false,
)
final DateTime tradeDate;
@JsonKey(
name: r'trade_no',
required: false,
includeIfNull: false,
)
final String? tradeNo;
@override
bool operator ==(Object other) => identical(this, other) || other is SampleEventOut &&
other.amount == amount &&
other.currency == currency &&
other.dedupeKey == dedupeKey &&
other.description == description &&
other.fee == fee &&
other.instrumentId == instrumentId &&
other.instrumentKey == instrumentKey &&
other.instrumentName == instrumentName &&
other.isDuplicate == isDuplicate &&
other.kind == kind &&
other.lineNo == lineNo &&
other.price == price &&
other.quantity == quantity &&
other.settleDate == settleDate &&
other.tradeDate == tradeDate &&
other.tradeNo == tradeNo;
@override
int get hashCode =>
amount.hashCode +
currency.hashCode +
dedupeKey.hashCode +
(description == null ? 0 : description.hashCode) +
(fee == null ? 0 : fee.hashCode) +
(instrumentId == null ? 0 : instrumentId.hashCode) +
(instrumentKey == null ? 0 : instrumentKey.hashCode) +
(instrumentName == null ? 0 : instrumentName.hashCode) +
isDuplicate.hashCode +
kind.hashCode +
lineNo.hashCode +
(price == null ? 0 : price.hashCode) +
(quantity == null ? 0 : quantity.hashCode) +
(settleDate == null ? 0 : settleDate.hashCode) +
tradeDate.hashCode +
(tradeNo == null ? 0 : tradeNo.hashCode);
factory SampleEventOut.fromJson(Map<String, dynamic> json) => _$SampleEventOutFromJson(json);
Map<String, dynamic> toJson() => _$SampleEventOutToJson(this);
@override
String toString() {
return toJson().toString();
}
}
@@ -0,0 +1,312 @@
// GENERATED CODE - DO NOT MODIFY BY HAND
part of 'sample_event_out.dart';
// **************************************************************************
// CopyWithGenerator
// **************************************************************************
abstract class _$SampleEventOutCWProxy {
SampleEventOut amount(String amount);
SampleEventOut currency(String currency);
SampleEventOut dedupeKey(String dedupeKey);
SampleEventOut description(String? description);
SampleEventOut fee(String? fee);
SampleEventOut instrumentId(int? instrumentId);
SampleEventOut instrumentKey(String? instrumentKey);
SampleEventOut instrumentName(String? instrumentName);
SampleEventOut isDuplicate(bool isDuplicate);
SampleEventOut kind(String kind);
SampleEventOut lineNo(int lineNo);
SampleEventOut price(String? price);
SampleEventOut quantity(String? quantity);
SampleEventOut settleDate(DateTime? settleDate);
SampleEventOut tradeDate(DateTime tradeDate);
SampleEventOut tradeNo(String? tradeNo);
/// This function **does support** nullification of nullable fields. All `null` values passed to `non-nullable` fields will be ignored. You can also use `SampleEventOut(...).copyWith.fieldName(...)` to override fields one at a time with nullification support.
///
/// Usage
/// ```dart
/// SampleEventOut(...).copyWith(id: 12, name: "My name")
/// ````
SampleEventOut call({
String amount,
String currency,
String dedupeKey,
String? description,
String? fee,
int? instrumentId,
String? instrumentKey,
String? instrumentName,
bool isDuplicate,
String kind,
int lineNo,
String? price,
String? quantity,
DateTime? settleDate,
DateTime tradeDate,
String? tradeNo,
});
}
/// Proxy class for `copyWith` functionality. This is a callable class and can be used as follows: `instanceOfSampleEventOut.copyWith(...)`. Additionally contains functions for specific fields e.g. `instanceOfSampleEventOut.copyWith.fieldName(...)`
class _$SampleEventOutCWProxyImpl implements _$SampleEventOutCWProxy {
const _$SampleEventOutCWProxyImpl(this._value);
final SampleEventOut _value;
@override
SampleEventOut amount(String amount) => this(amount: amount);
@override
SampleEventOut currency(String currency) => this(currency: currency);
@override
SampleEventOut dedupeKey(String dedupeKey) => this(dedupeKey: dedupeKey);
@override
SampleEventOut description(String? description) =>
this(description: description);
@override
SampleEventOut fee(String? fee) => this(fee: fee);
@override
SampleEventOut instrumentId(int? instrumentId) =>
this(instrumentId: instrumentId);
@override
SampleEventOut instrumentKey(String? instrumentKey) =>
this(instrumentKey: instrumentKey);
@override
SampleEventOut instrumentName(String? instrumentName) =>
this(instrumentName: instrumentName);
@override
SampleEventOut isDuplicate(bool isDuplicate) =>
this(isDuplicate: isDuplicate);
@override
SampleEventOut kind(String kind) => this(kind: kind);
@override
SampleEventOut lineNo(int lineNo) => this(lineNo: lineNo);
@override
SampleEventOut price(String? price) => this(price: price);
@override
SampleEventOut quantity(String? quantity) => this(quantity: quantity);
@override
SampleEventOut settleDate(DateTime? settleDate) =>
this(settleDate: settleDate);
@override
SampleEventOut tradeDate(DateTime tradeDate) => this(tradeDate: tradeDate);
@override
SampleEventOut tradeNo(String? tradeNo) => this(tradeNo: tradeNo);
@override
/// This function **does support** nullification of nullable fields. All `null` values passed to `non-nullable` fields will be ignored. You can also use `SampleEventOut(...).copyWith.fieldName(...)` to override fields one at a time with nullification support.
///
/// Usage
/// ```dart
/// SampleEventOut(...).copyWith(id: 12, name: "My name")
/// ````
SampleEventOut call({
Object? amount = const $CopyWithPlaceholder(),
Object? currency = const $CopyWithPlaceholder(),
Object? dedupeKey = const $CopyWithPlaceholder(),
Object? description = const $CopyWithPlaceholder(),
Object? fee = const $CopyWithPlaceholder(),
Object? instrumentId = const $CopyWithPlaceholder(),
Object? instrumentKey = const $CopyWithPlaceholder(),
Object? instrumentName = const $CopyWithPlaceholder(),
Object? isDuplicate = const $CopyWithPlaceholder(),
Object? kind = const $CopyWithPlaceholder(),
Object? lineNo = const $CopyWithPlaceholder(),
Object? price = const $CopyWithPlaceholder(),
Object? quantity = const $CopyWithPlaceholder(),
Object? settleDate = const $CopyWithPlaceholder(),
Object? tradeDate = const $CopyWithPlaceholder(),
Object? tradeNo = const $CopyWithPlaceholder(),
}) {
return SampleEventOut(
amount: amount == const $CopyWithPlaceholder()
? _value.amount
// ignore: cast_nullable_to_non_nullable
: amount as String,
currency: currency == const $CopyWithPlaceholder()
? _value.currency
// ignore: cast_nullable_to_non_nullable
: currency as String,
dedupeKey: dedupeKey == const $CopyWithPlaceholder()
? _value.dedupeKey
// ignore: cast_nullable_to_non_nullable
: dedupeKey as String,
description: description == const $CopyWithPlaceholder()
? _value.description
// ignore: cast_nullable_to_non_nullable
: description as String?,
fee: fee == const $CopyWithPlaceholder()
? _value.fee
// ignore: cast_nullable_to_non_nullable
: fee as String?,
instrumentId: instrumentId == const $CopyWithPlaceholder()
? _value.instrumentId
// ignore: cast_nullable_to_non_nullable
: instrumentId as int?,
instrumentKey: instrumentKey == const $CopyWithPlaceholder()
? _value.instrumentKey
// ignore: cast_nullable_to_non_nullable
: instrumentKey as String?,
instrumentName: instrumentName == const $CopyWithPlaceholder()
? _value.instrumentName
// ignore: cast_nullable_to_non_nullable
: instrumentName as String?,
isDuplicate: isDuplicate == const $CopyWithPlaceholder()
? _value.isDuplicate
// ignore: cast_nullable_to_non_nullable
: isDuplicate as bool,
kind: kind == const $CopyWithPlaceholder()
? _value.kind
// ignore: cast_nullable_to_non_nullable
: kind as String,
lineNo: lineNo == const $CopyWithPlaceholder()
? _value.lineNo
// ignore: cast_nullable_to_non_nullable
: lineNo as int,
price: price == const $CopyWithPlaceholder()
? _value.price
// ignore: cast_nullable_to_non_nullable
: price as String?,
quantity: quantity == const $CopyWithPlaceholder()
? _value.quantity
// ignore: cast_nullable_to_non_nullable
: quantity as String?,
settleDate: settleDate == const $CopyWithPlaceholder()
? _value.settleDate
// ignore: cast_nullable_to_non_nullable
: settleDate as DateTime?,
tradeDate: tradeDate == const $CopyWithPlaceholder()
? _value.tradeDate
// ignore: cast_nullable_to_non_nullable
: tradeDate as DateTime,
tradeNo: tradeNo == const $CopyWithPlaceholder()
? _value.tradeNo
// ignore: cast_nullable_to_non_nullable
: tradeNo as String?,
);
}
}
extension $SampleEventOutCopyWith on SampleEventOut {
/// Returns a callable class that can be used as follows: `instanceOfSampleEventOut.copyWith(...)` or like so:`instanceOfSampleEventOut.copyWith.fieldName(...)`.
// ignore: library_private_types_in_public_api
_$SampleEventOutCWProxy get copyWith => _$SampleEventOutCWProxyImpl(this);
}
// **************************************************************************
// JsonSerializableGenerator
// **************************************************************************
SampleEventOut _$SampleEventOutFromJson(Map<String, dynamic> json) =>
$checkedCreate(
'SampleEventOut',
json,
($checkedConvert) {
$checkKeys(
json,
requiredKeys: const [
'amount',
'currency',
'dedupe_key',
'is_duplicate',
'kind',
'line_no',
'trade_date',
],
);
final val = SampleEventOut(
amount: $checkedConvert('amount', (v) => v as String),
currency: $checkedConvert('currency', (v) => v as String),
dedupeKey: $checkedConvert('dedupe_key', (v) => v as String),
description: $checkedConvert('description', (v) => v as String?),
fee: $checkedConvert('fee', (v) => v as String?),
instrumentId: $checkedConvert(
'instrument_id',
(v) => (v as num?)?.toInt(),
),
instrumentKey: $checkedConvert('instrument_key', (v) => v as String?),
instrumentName: $checkedConvert(
'instrument_name',
(v) => v as String?,
),
isDuplicate: $checkedConvert('is_duplicate', (v) => v as bool),
kind: $checkedConvert('kind', (v) => v as String),
lineNo: $checkedConvert('line_no', (v) => (v as num).toInt()),
price: $checkedConvert('price', (v) => v as String?),
quantity: $checkedConvert('quantity', (v) => v as String?),
settleDate: $checkedConvert(
'settle_date',
(v) => v == null ? null : DateTime.parse(v as String),
),
tradeDate: $checkedConvert(
'trade_date',
(v) => DateTime.parse(v as String),
),
tradeNo: $checkedConvert('trade_no', (v) => v as String?),
);
return val;
},
fieldKeyMap: const {
'dedupeKey': 'dedupe_key',
'instrumentId': 'instrument_id',
'instrumentKey': 'instrument_key',
'instrumentName': 'instrument_name',
'isDuplicate': 'is_duplicate',
'lineNo': 'line_no',
'settleDate': 'settle_date',
'tradeDate': 'trade_date',
'tradeNo': 'trade_no',
},
);
Map<String, dynamic> _$SampleEventOutToJson(SampleEventOut instance) =>
<String, dynamic>{
'amount': instance.amount,
'currency': instance.currency,
'dedupe_key': instance.dedupeKey,
'description': ?instance.description,
'fee': ?instance.fee,
'instrument_id': ?instance.instrumentId,
'instrument_key': ?instance.instrumentKey,
'instrument_name': ?instance.instrumentName,
'is_duplicate': instance.isDuplicate,
'kind': instance.kind,
'line_no': instance.lineNo,
'price': ?instance.price,
'quantity': ?instance.quantity,
'settle_date': ?instance.settleDate?.toIso8601String(),
'trade_date': instance.tradeDate.toIso8601String(),
'trade_no': ?instance.tradeNo,
};
@@ -0,0 +1,108 @@
//
// AUTO-GENERATED FILE, DO NOT MODIFY!
//
// ignore_for_file: unused_element
import 'package:copy_with_extension/copy_with_extension.dart';
import 'package:json_annotation/json_annotation.dart';
part 'target_in.g.dart';
@CopyWith()
@JsonSerializable(
checked: true,
createToJson: true,
disallowUnrecognizedKeys: false,
explicitToJson: true,
)
class TargetIn {
/// Returns a new [TargetIn] instance.
TargetIn({
this.band,
required this.bucket,
this.note,
required this.targetWeight,
});
/// decimal as string
@JsonKey(
name: r'band',
required: false,
includeIfNull: false,
)
final String? band;
@JsonKey(
name: r'bucket',
required: true,
includeIfNull: false,
)
final String bucket;
@JsonKey(
name: r'note',
required: false,
includeIfNull: false,
)
final String? note;
/// decimal as string
@JsonKey(
name: r'target_weight',
required: true,
includeIfNull: false,
)
final String targetWeight;
@override
bool operator ==(Object other) => identical(this, other) || other is TargetIn &&
other.band == band &&
other.bucket == bucket &&
other.note == note &&
other.targetWeight == targetWeight;
@override
int get hashCode =>
(band == null ? 0 : band.hashCode) +
bucket.hashCode +
(note == null ? 0 : note.hashCode) +
targetWeight.hashCode;
factory TargetIn.fromJson(Map<String, dynamic> json) => _$TargetInFromJson(json);
Map<String, dynamic> toJson() => _$TargetInToJson(this);
@override
String toString() {
return toJson().toString();
}
}
@@ -0,0 +1,112 @@
// GENERATED CODE - DO NOT MODIFY BY HAND
part of 'target_in.dart';
// **************************************************************************
// CopyWithGenerator
// **************************************************************************
abstract class _$TargetInCWProxy {
TargetIn band(String? band);
TargetIn bucket(String bucket);
TargetIn note(String? note);
TargetIn targetWeight(String targetWeight);
/// This function **does support** nullification of nullable fields. All `null` values passed to `non-nullable` fields will be ignored. You can also use `TargetIn(...).copyWith.fieldName(...)` to override fields one at a time with nullification support.
///
/// Usage
/// ```dart
/// TargetIn(...).copyWith(id: 12, name: "My name")
/// ````
TargetIn call({
String? band,
String bucket,
String? note,
String targetWeight,
});
}
/// Proxy class for `copyWith` functionality. This is a callable class and can be used as follows: `instanceOfTargetIn.copyWith(...)`. Additionally contains functions for specific fields e.g. `instanceOfTargetIn.copyWith.fieldName(...)`
class _$TargetInCWProxyImpl implements _$TargetInCWProxy {
const _$TargetInCWProxyImpl(this._value);
final TargetIn _value;
@override
TargetIn band(String? band) => this(band: band);
@override
TargetIn bucket(String bucket) => this(bucket: bucket);
@override
TargetIn note(String? note) => this(note: note);
@override
TargetIn targetWeight(String targetWeight) =>
this(targetWeight: targetWeight);
@override
/// This function **does support** nullification of nullable fields. All `null` values passed to `non-nullable` fields will be ignored. You can also use `TargetIn(...).copyWith.fieldName(...)` to override fields one at a time with nullification support.
///
/// Usage
/// ```dart
/// TargetIn(...).copyWith(id: 12, name: "My name")
/// ````
TargetIn call({
Object? band = const $CopyWithPlaceholder(),
Object? bucket = const $CopyWithPlaceholder(),
Object? note = const $CopyWithPlaceholder(),
Object? targetWeight = const $CopyWithPlaceholder(),
}) {
return TargetIn(
band: band == const $CopyWithPlaceholder()
? _value.band
// ignore: cast_nullable_to_non_nullable
: band as String?,
bucket: bucket == const $CopyWithPlaceholder()
? _value.bucket
// ignore: cast_nullable_to_non_nullable
: bucket as String,
note: note == const $CopyWithPlaceholder()
? _value.note
// ignore: cast_nullable_to_non_nullable
: note as String?,
targetWeight: targetWeight == const $CopyWithPlaceholder()
? _value.targetWeight
// ignore: cast_nullable_to_non_nullable
: targetWeight as String,
);
}
}
extension $TargetInCopyWith on TargetIn {
/// Returns a callable class that can be used as follows: `instanceOfTargetIn.copyWith(...)` or like so:`instanceOfTargetIn.copyWith.fieldName(...)`.
// ignore: library_private_types_in_public_api
_$TargetInCWProxy get copyWith => _$TargetInCWProxyImpl(this);
}
// **************************************************************************
// JsonSerializableGenerator
// **************************************************************************
TargetIn _$TargetInFromJson(Map<String, dynamic> json) =>
$checkedCreate('TargetIn', json, ($checkedConvert) {
$checkKeys(json, requiredKeys: const ['bucket', 'target_weight']);
final val = TargetIn(
band: $checkedConvert('band', (v) => v as String?),
bucket: $checkedConvert('bucket', (v) => v as String),
note: $checkedConvert('note', (v) => v as String?),
targetWeight: $checkedConvert('target_weight', (v) => v as String),
);
return val;
}, fieldKeyMap: const {'targetWeight': 'target_weight'});
Map<String, dynamic> _$TargetInToJson(TargetIn instance) => <String, dynamic>{
'band': ?instance.band,
'bucket': instance.bucket,
'note': ?instance.note,
'target_weight': instance.targetWeight,
};
@@ -0,0 +1,108 @@
//
// AUTO-GENERATED FILE, DO NOT MODIFY!
//
// ignore_for_file: unused_element
import 'package:copy_with_extension/copy_with_extension.dart';
import 'package:json_annotation/json_annotation.dart';
part 'target_out.g.dart';
@CopyWith()
@JsonSerializable(
checked: true,
createToJson: true,
disallowUnrecognizedKeys: false,
explicitToJson: true,
)
class TargetOut {
/// Returns a new [TargetOut] instance.
TargetOut({
required this.band,
required this.bucket,
required this.note,
required this.targetWeight,
});
/// decimal as string
@JsonKey(
name: r'band',
required: true,
includeIfNull: true,
)
final String? band;
@JsonKey(
name: r'bucket',
required: true,
includeIfNull: false,
)
final String bucket;
@JsonKey(
name: r'note',
required: true,
includeIfNull: true,
)
final String? note;
/// decimal as string
@JsonKey(
name: r'target_weight',
required: true,
includeIfNull: false,
)
final String targetWeight;
@override
bool operator ==(Object other) => identical(this, other) || other is TargetOut &&
other.band == band &&
other.bucket == bucket &&
other.note == note &&
other.targetWeight == targetWeight;
@override
int get hashCode =>
(band == null ? 0 : band.hashCode) +
bucket.hashCode +
(note == null ? 0 : note.hashCode) +
targetWeight.hashCode;
factory TargetOut.fromJson(Map<String, dynamic> json) => _$TargetOutFromJson(json);
Map<String, dynamic> toJson() => _$TargetOutToJson(this);
@override
String toString() {
return toJson().toString();
}
}
@@ -0,0 +1,115 @@
// GENERATED CODE - DO NOT MODIFY BY HAND
part of 'target_out.dart';
// **************************************************************************
// CopyWithGenerator
// **************************************************************************
abstract class _$TargetOutCWProxy {
TargetOut band(String? band);
TargetOut bucket(String bucket);
TargetOut note(String? note);
TargetOut targetWeight(String targetWeight);
/// This function **does support** nullification of nullable fields. All `null` values passed to `non-nullable` fields will be ignored. You can also use `TargetOut(...).copyWith.fieldName(...)` to override fields one at a time with nullification support.
///
/// Usage
/// ```dart
/// TargetOut(...).copyWith(id: 12, name: "My name")
/// ````
TargetOut call({
String? band,
String bucket,
String? note,
String targetWeight,
});
}
/// Proxy class for `copyWith` functionality. This is a callable class and can be used as follows: `instanceOfTargetOut.copyWith(...)`. Additionally contains functions for specific fields e.g. `instanceOfTargetOut.copyWith.fieldName(...)`
class _$TargetOutCWProxyImpl implements _$TargetOutCWProxy {
const _$TargetOutCWProxyImpl(this._value);
final TargetOut _value;
@override
TargetOut band(String? band) => this(band: band);
@override
TargetOut bucket(String bucket) => this(bucket: bucket);
@override
TargetOut note(String? note) => this(note: note);
@override
TargetOut targetWeight(String targetWeight) =>
this(targetWeight: targetWeight);
@override
/// This function **does support** nullification of nullable fields. All `null` values passed to `non-nullable` fields will be ignored. You can also use `TargetOut(...).copyWith.fieldName(...)` to override fields one at a time with nullification support.
///
/// Usage
/// ```dart
/// TargetOut(...).copyWith(id: 12, name: "My name")
/// ````
TargetOut call({
Object? band = const $CopyWithPlaceholder(),
Object? bucket = const $CopyWithPlaceholder(),
Object? note = const $CopyWithPlaceholder(),
Object? targetWeight = const $CopyWithPlaceholder(),
}) {
return TargetOut(
band: band == const $CopyWithPlaceholder()
? _value.band
// ignore: cast_nullable_to_non_nullable
: band as String?,
bucket: bucket == const $CopyWithPlaceholder()
? _value.bucket
// ignore: cast_nullable_to_non_nullable
: bucket as String,
note: note == const $CopyWithPlaceholder()
? _value.note
// ignore: cast_nullable_to_non_nullable
: note as String?,
targetWeight: targetWeight == const $CopyWithPlaceholder()
? _value.targetWeight
// ignore: cast_nullable_to_non_nullable
: targetWeight as String,
);
}
}
extension $TargetOutCopyWith on TargetOut {
/// Returns a callable class that can be used as follows: `instanceOfTargetOut.copyWith(...)` or like so:`instanceOfTargetOut.copyWith.fieldName(...)`.
// ignore: library_private_types_in_public_api
_$TargetOutCWProxy get copyWith => _$TargetOutCWProxyImpl(this);
}
// **************************************************************************
// JsonSerializableGenerator
// **************************************************************************
TargetOut _$TargetOutFromJson(Map<String, dynamic> json) =>
$checkedCreate('TargetOut', json, ($checkedConvert) {
$checkKeys(
json,
requiredKeys: const ['band', 'bucket', 'note', 'target_weight'],
);
final val = TargetOut(
band: $checkedConvert('band', (v) => v as String?),
bucket: $checkedConvert('bucket', (v) => v as String),
note: $checkedConvert('note', (v) => v as String?),
targetWeight: $checkedConvert('target_weight', (v) => v as String),
);
return val;
}, fieldKeyMap: const {'targetWeight': 'target_weight'});
Map<String, dynamic> _$TargetOutToJson(TargetOut instance) => <String, dynamic>{
'band': instance.band,
'bucket': instance.bucket,
'note': instance.note,
'target_weight': instance.targetWeight,
};
@@ -0,0 +1,76 @@
//
// AUTO-GENERATED FILE, DO NOT MODIFY!
//
// ignore_for_file: unused_element
import 'package:fintracker_api/src/model/target_in.dart';
import 'package:copy_with_extension/copy_with_extension.dart';
import 'package:json_annotation/json_annotation.dart';
part 'targets_in.g.dart';
@CopyWith()
@JsonSerializable(
checked: true,
createToJson: true,
disallowUnrecognizedKeys: false,
explicitToJson: true,
)
class TargetsIn {
/// Returns a new [TargetsIn] instance.
TargetsIn({
required this.dimension,
required this.targets,
});
/// asset_class | sector | country | currency
@JsonKey(
name: r'dimension',
required: true,
includeIfNull: false,
)
final String dimension;
@JsonKey(
name: r'targets',
required: true,
includeIfNull: false,
)
final List<TargetIn> targets;
@override
bool operator ==(Object other) => identical(this, other) || other is TargetsIn &&
other.dimension == dimension &&
other.targets == targets;
@override
int get hashCode =>
dimension.hashCode +
targets.hashCode;
factory TargetsIn.fromJson(Map<String, dynamic> json) => _$TargetsInFromJson(json);
Map<String, dynamic> toJson() => _$TargetsInToJson(this);
@override
String toString() {
return toJson().toString();
}
}
@@ -0,0 +1,87 @@
// GENERATED CODE - DO NOT MODIFY BY HAND
part of 'targets_in.dart';
// **************************************************************************
// CopyWithGenerator
// **************************************************************************
abstract class _$TargetsInCWProxy {
TargetsIn dimension(String dimension);
TargetsIn targets(List<TargetIn> targets);
/// This function **does support** nullification of nullable fields. All `null` values passed to `non-nullable` fields will be ignored. You can also use `TargetsIn(...).copyWith.fieldName(...)` to override fields one at a time with nullification support.
///
/// Usage
/// ```dart
/// TargetsIn(...).copyWith(id: 12, name: "My name")
/// ````
TargetsIn call({String dimension, List<TargetIn> targets});
}
/// Proxy class for `copyWith` functionality. This is a callable class and can be used as follows: `instanceOfTargetsIn.copyWith(...)`. Additionally contains functions for specific fields e.g. `instanceOfTargetsIn.copyWith.fieldName(...)`
class _$TargetsInCWProxyImpl implements _$TargetsInCWProxy {
const _$TargetsInCWProxyImpl(this._value);
final TargetsIn _value;
@override
TargetsIn dimension(String dimension) => this(dimension: dimension);
@override
TargetsIn targets(List<TargetIn> targets) => this(targets: targets);
@override
/// This function **does support** nullification of nullable fields. All `null` values passed to `non-nullable` fields will be ignored. You can also use `TargetsIn(...).copyWith.fieldName(...)` to override fields one at a time with nullification support.
///
/// Usage
/// ```dart
/// TargetsIn(...).copyWith(id: 12, name: "My name")
/// ````
TargetsIn call({
Object? dimension = const $CopyWithPlaceholder(),
Object? targets = const $CopyWithPlaceholder(),
}) {
return TargetsIn(
dimension: dimension == const $CopyWithPlaceholder()
? _value.dimension
// ignore: cast_nullable_to_non_nullable
: dimension as String,
targets: targets == const $CopyWithPlaceholder()
? _value.targets
// ignore: cast_nullable_to_non_nullable
: targets as List<TargetIn>,
);
}
}
extension $TargetsInCopyWith on TargetsIn {
/// Returns a callable class that can be used as follows: `instanceOfTargetsIn.copyWith(...)` or like so:`instanceOfTargetsIn.copyWith.fieldName(...)`.
// ignore: library_private_types_in_public_api
_$TargetsInCWProxy get copyWith => _$TargetsInCWProxyImpl(this);
}
// **************************************************************************
// JsonSerializableGenerator
// **************************************************************************
TargetsIn _$TargetsInFromJson(Map<String, dynamic> json) =>
$checkedCreate('TargetsIn', json, ($checkedConvert) {
$checkKeys(json, requiredKeys: const ['dimension', 'targets']);
final val = TargetsIn(
dimension: $checkedConvert('dimension', (v) => v as String),
targets: $checkedConvert(
'targets',
(v) => (v as List<dynamic>)
.map((e) => TargetIn.fromJson(e as Map<String, dynamic>))
.toList(),
),
);
return val;
});
Map<String, dynamic> _$TargetsInToJson(TargetsIn instance) => <String, dynamic>{
'dimension': instance.dimension,
'targets': instance.targets.map((e) => e.toJson()).toList(),
};
@@ -0,0 +1,108 @@
//
// AUTO-GENERATED FILE, DO NOT MODIFY!
//
// ignore_for_file: unused_element
import 'package:fintracker_api/src/model/target_out.dart';
import 'package:copy_with_extension/copy_with_extension.dart';
import 'package:json_annotation/json_annotation.dart';
part 'targets_out.g.dart';
@CopyWith()
@JsonSerializable(
checked: true,
createToJson: true,
disallowUnrecognizedKeys: false,
explicitToJson: true,
)
class TargetsOut {
/// Returns a new [TargetsOut] instance.
TargetsOut({
required this.dimension,
required this.portfolioId,
required this.targets,
required this.weightsSum,
});
@JsonKey(
name: r'dimension',
required: true,
includeIfNull: false,
)
final String dimension;
@JsonKey(
name: r'portfolio_id',
required: true,
includeIfNull: false,
)
final int portfolioId;
@JsonKey(
name: r'targets',
required: true,
includeIfNull: false,
)
final List<TargetOut> targets;
/// decimal as string
@JsonKey(
name: r'weights_sum',
required: true,
includeIfNull: false,
)
final String weightsSum;
@override
bool operator ==(Object other) => identical(this, other) || other is TargetsOut &&
other.dimension == dimension &&
other.portfolioId == portfolioId &&
other.targets == targets &&
other.weightsSum == weightsSum;
@override
int get hashCode =>
dimension.hashCode +
portfolioId.hashCode +
targets.hashCode +
weightsSum.hashCode;
factory TargetsOut.fromJson(Map<String, dynamic> json) => _$TargetsOutFromJson(json);
Map<String, dynamic> toJson() => _$TargetsOutToJson(this);
@override
String toString() {
return toJson().toString();
}
}
@@ -0,0 +1,132 @@
// GENERATED CODE - DO NOT MODIFY BY HAND
part of 'targets_out.dart';
// **************************************************************************
// CopyWithGenerator
// **************************************************************************
abstract class _$TargetsOutCWProxy {
TargetsOut dimension(String dimension);
TargetsOut portfolioId(int portfolioId);
TargetsOut targets(List<TargetOut> targets);
TargetsOut weightsSum(String weightsSum);
/// This function **does support** nullification of nullable fields. All `null` values passed to `non-nullable` fields will be ignored. You can also use `TargetsOut(...).copyWith.fieldName(...)` to override fields one at a time with nullification support.
///
/// Usage
/// ```dart
/// TargetsOut(...).copyWith(id: 12, name: "My name")
/// ````
TargetsOut call({
String dimension,
int portfolioId,
List<TargetOut> targets,
String weightsSum,
});
}
/// Proxy class for `copyWith` functionality. This is a callable class and can be used as follows: `instanceOfTargetsOut.copyWith(...)`. Additionally contains functions for specific fields e.g. `instanceOfTargetsOut.copyWith.fieldName(...)`
class _$TargetsOutCWProxyImpl implements _$TargetsOutCWProxy {
const _$TargetsOutCWProxyImpl(this._value);
final TargetsOut _value;
@override
TargetsOut dimension(String dimension) => this(dimension: dimension);
@override
TargetsOut portfolioId(int portfolioId) => this(portfolioId: portfolioId);
@override
TargetsOut targets(List<TargetOut> targets) => this(targets: targets);
@override
TargetsOut weightsSum(String weightsSum) => this(weightsSum: weightsSum);
@override
/// This function **does support** nullification of nullable fields. All `null` values passed to `non-nullable` fields will be ignored. You can also use `TargetsOut(...).copyWith.fieldName(...)` to override fields one at a time with nullification support.
///
/// Usage
/// ```dart
/// TargetsOut(...).copyWith(id: 12, name: "My name")
/// ````
TargetsOut call({
Object? dimension = const $CopyWithPlaceholder(),
Object? portfolioId = const $CopyWithPlaceholder(),
Object? targets = const $CopyWithPlaceholder(),
Object? weightsSum = const $CopyWithPlaceholder(),
}) {
return TargetsOut(
dimension: dimension == const $CopyWithPlaceholder()
? _value.dimension
// ignore: cast_nullable_to_non_nullable
: dimension as String,
portfolioId: portfolioId == const $CopyWithPlaceholder()
? _value.portfolioId
// ignore: cast_nullable_to_non_nullable
: portfolioId as int,
targets: targets == const $CopyWithPlaceholder()
? _value.targets
// ignore: cast_nullable_to_non_nullable
: targets as List<TargetOut>,
weightsSum: weightsSum == const $CopyWithPlaceholder()
? _value.weightsSum
// ignore: cast_nullable_to_non_nullable
: weightsSum as String,
);
}
}
extension $TargetsOutCopyWith on TargetsOut {
/// Returns a callable class that can be used as follows: `instanceOfTargetsOut.copyWith(...)` or like so:`instanceOfTargetsOut.copyWith.fieldName(...)`.
// ignore: library_private_types_in_public_api
_$TargetsOutCWProxy get copyWith => _$TargetsOutCWProxyImpl(this);
}
// **************************************************************************
// JsonSerializableGenerator
// **************************************************************************
TargetsOut _$TargetsOutFromJson(Map<String, dynamic> json) => $checkedCreate(
'TargetsOut',
json,
($checkedConvert) {
$checkKeys(
json,
requiredKeys: const [
'dimension',
'portfolio_id',
'targets',
'weights_sum',
],
);
final val = TargetsOut(
dimension: $checkedConvert('dimension', (v) => v as String),
portfolioId: $checkedConvert('portfolio_id', (v) => (v as num).toInt()),
targets: $checkedConvert(
'targets',
(v) => (v as List<dynamic>)
.map((e) => TargetOut.fromJson(e as Map<String, dynamic>))
.toList(),
),
weightsSum: $checkedConvert('weights_sum', (v) => v as String),
);
return val;
},
fieldKeyMap: const {
'portfolioId': 'portfolio_id',
'weightsSum': 'weights_sum',
},
);
Map<String, dynamic> _$TargetsOutToJson(TargetsOut instance) =>
<String, dynamic>{
'dimension': instance.dimension,
'portfolio_id': instance.portfolioId,
'targets': instance.targets.map((e) => e.toJson()).toList(),
'weights_sum': instance.weightsSum,
};
@@ -0,0 +1,210 @@
//
// 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 'tax_account_out.g.dart';
@CopyWith()
@JsonSerializable(
checked: true,
createToJson: true,
disallowUnrecognizedKeys: false,
explicitToJson: true,
)
class TaxAccountOut {
/// Returns a new [TaxAccountOut] instance.
TaxAccountOut({
required this.accountId,
required this.accountName,
required this.couponsGrossRub,
required this.dividendsGrossRub,
required this.estimatedTaxRub,
required this.ldvExemptRub,
required this.realizedGainRub,
required this.realizedLossRub,
required this.taxWithheldRub,
required this.taxableBaseRub,
});
@JsonKey(
name: r'account_id',
required: true,
includeIfNull: false,
)
final int accountId;
@JsonKey(
name: r'account_name',
required: true,
includeIfNull: false,
)
final String accountName;
/// decimal as string
@JsonKey(
name: r'coupons_gross_rub',
required: true,
includeIfNull: false,
)
final String couponsGrossRub;
/// decimal as string
@JsonKey(
name: r'dividends_gross_rub',
required: true,
includeIfNull: false,
)
final String dividendsGrossRub;
/// decimal as string
@JsonKey(
name: r'estimated_tax_rub',
required: true,
includeIfNull: false,
)
final String estimatedTaxRub;
/// decimal as string
@JsonKey(
name: r'ldv_exempt_rub',
required: true,
includeIfNull: false,
)
final String ldvExemptRub;
/// decimal as string
@JsonKey(
name: r'realized_gain_rub',
required: true,
includeIfNull: false,
)
final String realizedGainRub;
/// decimal as string
@JsonKey(
name: r'realized_loss_rub',
required: true,
includeIfNull: false,
)
final String realizedLossRub;
/// decimal as string
@JsonKey(
name: r'tax_withheld_rub',
required: true,
includeIfNull: false,
)
final String taxWithheldRub;
/// decimal as string
@JsonKey(
name: r'taxable_base_rub',
required: true,
includeIfNull: false,
)
final String taxableBaseRub;
@override
bool operator ==(Object other) => identical(this, other) || other is TaxAccountOut &&
other.accountId == accountId &&
other.accountName == accountName &&
other.couponsGrossRub == couponsGrossRub &&
other.dividendsGrossRub == dividendsGrossRub &&
other.estimatedTaxRub == estimatedTaxRub &&
other.ldvExemptRub == ldvExemptRub &&
other.realizedGainRub == realizedGainRub &&
other.realizedLossRub == realizedLossRub &&
other.taxWithheldRub == taxWithheldRub &&
other.taxableBaseRub == taxableBaseRub;
@override
int get hashCode =>
accountId.hashCode +
accountName.hashCode +
couponsGrossRub.hashCode +
dividendsGrossRub.hashCode +
estimatedTaxRub.hashCode +
ldvExemptRub.hashCode +
realizedGainRub.hashCode +
realizedLossRub.hashCode +
taxWithheldRub.hashCode +
taxableBaseRub.hashCode;
factory TaxAccountOut.fromJson(Map<String, dynamic> json) => _$TaxAccountOutFromJson(json);
Map<String, dynamic> toJson() => _$TaxAccountOutToJson(this);
@override
String toString() {
return toJson().toString();
}
}
@@ -0,0 +1,233 @@
// GENERATED CODE - DO NOT MODIFY BY HAND
part of 'tax_account_out.dart';
// **************************************************************************
// CopyWithGenerator
// **************************************************************************
abstract class _$TaxAccountOutCWProxy {
TaxAccountOut accountId(int accountId);
TaxAccountOut accountName(String accountName);
TaxAccountOut couponsGrossRub(String couponsGrossRub);
TaxAccountOut dividendsGrossRub(String dividendsGrossRub);
TaxAccountOut estimatedTaxRub(String estimatedTaxRub);
TaxAccountOut ldvExemptRub(String ldvExemptRub);
TaxAccountOut realizedGainRub(String realizedGainRub);
TaxAccountOut realizedLossRub(String realizedLossRub);
TaxAccountOut taxWithheldRub(String taxWithheldRub);
TaxAccountOut taxableBaseRub(String taxableBaseRub);
/// This function **does support** nullification of nullable fields. All `null` values passed to `non-nullable` fields will be ignored. You can also use `TaxAccountOut(...).copyWith.fieldName(...)` to override fields one at a time with nullification support.
///
/// Usage
/// ```dart
/// TaxAccountOut(...).copyWith(id: 12, name: "My name")
/// ````
TaxAccountOut call({
int accountId,
String accountName,
String couponsGrossRub,
String dividendsGrossRub,
String estimatedTaxRub,
String ldvExemptRub,
String realizedGainRub,
String realizedLossRub,
String taxWithheldRub,
String taxableBaseRub,
});
}
/// Proxy class for `copyWith` functionality. This is a callable class and can be used as follows: `instanceOfTaxAccountOut.copyWith(...)`. Additionally contains functions for specific fields e.g. `instanceOfTaxAccountOut.copyWith.fieldName(...)`
class _$TaxAccountOutCWProxyImpl implements _$TaxAccountOutCWProxy {
const _$TaxAccountOutCWProxyImpl(this._value);
final TaxAccountOut _value;
@override
TaxAccountOut accountId(int accountId) => this(accountId: accountId);
@override
TaxAccountOut accountName(String accountName) =>
this(accountName: accountName);
@override
TaxAccountOut couponsGrossRub(String couponsGrossRub) =>
this(couponsGrossRub: couponsGrossRub);
@override
TaxAccountOut dividendsGrossRub(String dividendsGrossRub) =>
this(dividendsGrossRub: dividendsGrossRub);
@override
TaxAccountOut estimatedTaxRub(String estimatedTaxRub) =>
this(estimatedTaxRub: estimatedTaxRub);
@override
TaxAccountOut ldvExemptRub(String ldvExemptRub) =>
this(ldvExemptRub: ldvExemptRub);
@override
TaxAccountOut realizedGainRub(String realizedGainRub) =>
this(realizedGainRub: realizedGainRub);
@override
TaxAccountOut realizedLossRub(String realizedLossRub) =>
this(realizedLossRub: realizedLossRub);
@override
TaxAccountOut taxWithheldRub(String taxWithheldRub) =>
this(taxWithheldRub: taxWithheldRub);
@override
TaxAccountOut taxableBaseRub(String taxableBaseRub) =>
this(taxableBaseRub: taxableBaseRub);
@override
/// This function **does support** nullification of nullable fields. All `null` values passed to `non-nullable` fields will be ignored. You can also use `TaxAccountOut(...).copyWith.fieldName(...)` to override fields one at a time with nullification support.
///
/// Usage
/// ```dart
/// TaxAccountOut(...).copyWith(id: 12, name: "My name")
/// ````
TaxAccountOut call({
Object? accountId = const $CopyWithPlaceholder(),
Object? accountName = const $CopyWithPlaceholder(),
Object? couponsGrossRub = const $CopyWithPlaceholder(),
Object? dividendsGrossRub = const $CopyWithPlaceholder(),
Object? estimatedTaxRub = const $CopyWithPlaceholder(),
Object? ldvExemptRub = const $CopyWithPlaceholder(),
Object? realizedGainRub = const $CopyWithPlaceholder(),
Object? realizedLossRub = const $CopyWithPlaceholder(),
Object? taxWithheldRub = const $CopyWithPlaceholder(),
Object? taxableBaseRub = const $CopyWithPlaceholder(),
}) {
return TaxAccountOut(
accountId: accountId == const $CopyWithPlaceholder()
? _value.accountId
// ignore: cast_nullable_to_non_nullable
: accountId as int,
accountName: accountName == const $CopyWithPlaceholder()
? _value.accountName
// ignore: cast_nullable_to_non_nullable
: accountName as String,
couponsGrossRub: couponsGrossRub == const $CopyWithPlaceholder()
? _value.couponsGrossRub
// ignore: cast_nullable_to_non_nullable
: couponsGrossRub as String,
dividendsGrossRub: dividendsGrossRub == const $CopyWithPlaceholder()
? _value.dividendsGrossRub
// ignore: cast_nullable_to_non_nullable
: dividendsGrossRub as String,
estimatedTaxRub: estimatedTaxRub == const $CopyWithPlaceholder()
? _value.estimatedTaxRub
// ignore: cast_nullable_to_non_nullable
: estimatedTaxRub as String,
ldvExemptRub: ldvExemptRub == const $CopyWithPlaceholder()
? _value.ldvExemptRub
// ignore: cast_nullable_to_non_nullable
: ldvExemptRub as String,
realizedGainRub: realizedGainRub == const $CopyWithPlaceholder()
? _value.realizedGainRub
// ignore: cast_nullable_to_non_nullable
: realizedGainRub as String,
realizedLossRub: realizedLossRub == const $CopyWithPlaceholder()
? _value.realizedLossRub
// ignore: cast_nullable_to_non_nullable
: realizedLossRub as String,
taxWithheldRub: taxWithheldRub == const $CopyWithPlaceholder()
? _value.taxWithheldRub
// ignore: cast_nullable_to_non_nullable
: taxWithheldRub as String,
taxableBaseRub: taxableBaseRub == const $CopyWithPlaceholder()
? _value.taxableBaseRub
// ignore: cast_nullable_to_non_nullable
: taxableBaseRub as String,
);
}
}
extension $TaxAccountOutCopyWith on TaxAccountOut {
/// Returns a callable class that can be used as follows: `instanceOfTaxAccountOut.copyWith(...)` or like so:`instanceOfTaxAccountOut.copyWith.fieldName(...)`.
// ignore: library_private_types_in_public_api
_$TaxAccountOutCWProxy get copyWith => _$TaxAccountOutCWProxyImpl(this);
}
// **************************************************************************
// JsonSerializableGenerator
// **************************************************************************
TaxAccountOut _$TaxAccountOutFromJson(
Map<String, dynamic> json,
) => $checkedCreate(
'TaxAccountOut',
json,
($checkedConvert) {
$checkKeys(
json,
requiredKeys: const [
'account_id',
'account_name',
'coupons_gross_rub',
'dividends_gross_rub',
'estimated_tax_rub',
'ldv_exempt_rub',
'realized_gain_rub',
'realized_loss_rub',
'tax_withheld_rub',
'taxable_base_rub',
],
);
final val = TaxAccountOut(
accountId: $checkedConvert('account_id', (v) => (v as num).toInt()),
accountName: $checkedConvert('account_name', (v) => v as String),
couponsGrossRub: $checkedConvert('coupons_gross_rub', (v) => v as String),
dividendsGrossRub: $checkedConvert(
'dividends_gross_rub',
(v) => v as String,
),
estimatedTaxRub: $checkedConvert('estimated_tax_rub', (v) => v as String),
ldvExemptRub: $checkedConvert('ldv_exempt_rub', (v) => v as String),
realizedGainRub: $checkedConvert('realized_gain_rub', (v) => v as String),
realizedLossRub: $checkedConvert('realized_loss_rub', (v) => v as String),
taxWithheldRub: $checkedConvert('tax_withheld_rub', (v) => v as String),
taxableBaseRub: $checkedConvert('taxable_base_rub', (v) => v as String),
);
return val;
},
fieldKeyMap: const {
'accountId': 'account_id',
'accountName': 'account_name',
'couponsGrossRub': 'coupons_gross_rub',
'dividendsGrossRub': 'dividends_gross_rub',
'estimatedTaxRub': 'estimated_tax_rub',
'ldvExemptRub': 'ldv_exempt_rub',
'realizedGainRub': 'realized_gain_rub',
'realizedLossRub': 'realized_loss_rub',
'taxWithheldRub': 'tax_withheld_rub',
'taxableBaseRub': 'taxable_base_rub',
},
);
Map<String, dynamic> _$TaxAccountOutToJson(TaxAccountOut instance) =>
<String, dynamic>{
'account_id': instance.accountId,
'account_name': instance.accountName,
'coupons_gross_rub': instance.couponsGrossRub,
'dividends_gross_rub': instance.dividendsGrossRub,
'estimated_tax_rub': instance.estimatedTaxRub,
'ldv_exempt_rub': instance.ldvExemptRub,
'realized_gain_rub': instance.realizedGainRub,
'realized_loss_rub': instance.realizedLossRub,
'tax_withheld_rub': instance.taxWithheldRub,
'taxable_base_rub': instance.taxableBaseRub,
};
@@ -0,0 +1,287 @@
//
// 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 'tax_lot_out.g.dart';
@CopyWith()
@JsonSerializable(
checked: true,
createToJson: true,
disallowUnrecognizedKeys: false,
explicitToJson: true,
)
class TaxLotOut {
/// Returns a new [TaxLotOut] instance.
TaxLotOut({
required this.accountId,
required this.accountName,
required this.costRub,
required this.daysToLdv,
required this.instrumentId,
required this.ldvDate,
required this.ldvEligible,
required this.lotId,
required this.marketValueRub,
required this.name,
required this.openDate,
required this.qtyRemaining,
required this.taxIfSoldNowRub,
required this.ticker,
required this.unrealizedGainRub,
});
@JsonKey(
name: r'account_id',
required: true,
includeIfNull: false,
)
final int accountId;
@JsonKey(
name: r'account_name',
required: true,
includeIfNull: false,
)
final String accountName;
/// decimal as string
@JsonKey(
name: r'cost_rub',
required: true,
includeIfNull: true,
)
final String? costRub;
@JsonKey(
name: r'days_to_ldv',
required: true,
includeIfNull: true,
)
final int? daysToLdv;
@JsonKey(
name: r'instrument_id',
required: true,
includeIfNull: false,
)
final int instrumentId;
@JsonKey(
name: r'ldv_date',
required: true,
includeIfNull: true,
)
final DateTime? ldvDate;
@JsonKey(
name: r'ldv_eligible',
required: true,
includeIfNull: false,
)
final bool ldvEligible;
@JsonKey(
name: r'lot_id',
required: true,
includeIfNull: false,
)
final int lotId;
/// decimal as string
@JsonKey(
name: r'market_value_rub',
required: true,
includeIfNull: true,
)
final String? marketValueRub;
@JsonKey(
name: r'name',
required: true,
includeIfNull: false,
)
final String name;
@JsonKey(
name: r'open_date',
required: true,
includeIfNull: false,
)
final DateTime openDate;
/// decimal as string
@JsonKey(
name: r'qty_remaining',
required: true,
includeIfNull: false,
)
final String qtyRemaining;
/// decimal as string
@JsonKey(
name: r'tax_if_sold_now_rub',
required: true,
includeIfNull: true,
)
final String? taxIfSoldNowRub;
@JsonKey(
name: r'ticker',
required: true,
includeIfNull: true,
)
final String? ticker;
/// decimal as string
@JsonKey(
name: r'unrealized_gain_rub',
required: true,
includeIfNull: true,
)
final String? unrealizedGainRub;
@override
bool operator ==(Object other) => identical(this, other) || other is TaxLotOut &&
other.accountId == accountId &&
other.accountName == accountName &&
other.costRub == costRub &&
other.daysToLdv == daysToLdv &&
other.instrumentId == instrumentId &&
other.ldvDate == ldvDate &&
other.ldvEligible == ldvEligible &&
other.lotId == lotId &&
other.marketValueRub == marketValueRub &&
other.name == name &&
other.openDate == openDate &&
other.qtyRemaining == qtyRemaining &&
other.taxIfSoldNowRub == taxIfSoldNowRub &&
other.ticker == ticker &&
other.unrealizedGainRub == unrealizedGainRub;
@override
int get hashCode =>
accountId.hashCode +
accountName.hashCode +
(costRub == null ? 0 : costRub.hashCode) +
(daysToLdv == null ? 0 : daysToLdv.hashCode) +
instrumentId.hashCode +
(ldvDate == null ? 0 : ldvDate.hashCode) +
ldvEligible.hashCode +
lotId.hashCode +
(marketValueRub == null ? 0 : marketValueRub.hashCode) +
name.hashCode +
openDate.hashCode +
qtyRemaining.hashCode +
(taxIfSoldNowRub == null ? 0 : taxIfSoldNowRub.hashCode) +
(ticker == null ? 0 : ticker.hashCode) +
(unrealizedGainRub == null ? 0 : unrealizedGainRub.hashCode);
factory TaxLotOut.fromJson(Map<String, dynamic> json) => _$TaxLotOutFromJson(json);
Map<String, dynamic> toJson() => _$TaxLotOutToJson(this);
@override
String toString() {
return toJson().toString();
}
}
@@ -0,0 +1,307 @@
// GENERATED CODE - DO NOT MODIFY BY HAND
part of 'tax_lot_out.dart';
// **************************************************************************
// CopyWithGenerator
// **************************************************************************
abstract class _$TaxLotOutCWProxy {
TaxLotOut accountId(int accountId);
TaxLotOut accountName(String accountName);
TaxLotOut costRub(String? costRub);
TaxLotOut daysToLdv(int? daysToLdv);
TaxLotOut instrumentId(int instrumentId);
TaxLotOut ldvDate(DateTime? ldvDate);
TaxLotOut ldvEligible(bool ldvEligible);
TaxLotOut lotId(int lotId);
TaxLotOut marketValueRub(String? marketValueRub);
TaxLotOut name(String name);
TaxLotOut openDate(DateTime openDate);
TaxLotOut qtyRemaining(String qtyRemaining);
TaxLotOut taxIfSoldNowRub(String? taxIfSoldNowRub);
TaxLotOut ticker(String? ticker);
TaxLotOut unrealizedGainRub(String? unrealizedGainRub);
/// This function **does support** nullification of nullable fields. All `null` values passed to `non-nullable` fields will be ignored. You can also use `TaxLotOut(...).copyWith.fieldName(...)` to override fields one at a time with nullification support.
///
/// Usage
/// ```dart
/// TaxLotOut(...).copyWith(id: 12, name: "My name")
/// ````
TaxLotOut call({
int accountId,
String accountName,
String? costRub,
int? daysToLdv,
int instrumentId,
DateTime? ldvDate,
bool ldvEligible,
int lotId,
String? marketValueRub,
String name,
DateTime openDate,
String qtyRemaining,
String? taxIfSoldNowRub,
String? ticker,
String? unrealizedGainRub,
});
}
/// Proxy class for `copyWith` functionality. This is a callable class and can be used as follows: `instanceOfTaxLotOut.copyWith(...)`. Additionally contains functions for specific fields e.g. `instanceOfTaxLotOut.copyWith.fieldName(...)`
class _$TaxLotOutCWProxyImpl implements _$TaxLotOutCWProxy {
const _$TaxLotOutCWProxyImpl(this._value);
final TaxLotOut _value;
@override
TaxLotOut accountId(int accountId) => this(accountId: accountId);
@override
TaxLotOut accountName(String accountName) => this(accountName: accountName);
@override
TaxLotOut costRub(String? costRub) => this(costRub: costRub);
@override
TaxLotOut daysToLdv(int? daysToLdv) => this(daysToLdv: daysToLdv);
@override
TaxLotOut instrumentId(int instrumentId) => this(instrumentId: instrumentId);
@override
TaxLotOut ldvDate(DateTime? ldvDate) => this(ldvDate: ldvDate);
@override
TaxLotOut ldvEligible(bool ldvEligible) => this(ldvEligible: ldvEligible);
@override
TaxLotOut lotId(int lotId) => this(lotId: lotId);
@override
TaxLotOut marketValueRub(String? marketValueRub) =>
this(marketValueRub: marketValueRub);
@override
TaxLotOut name(String name) => this(name: name);
@override
TaxLotOut openDate(DateTime openDate) => this(openDate: openDate);
@override
TaxLotOut qtyRemaining(String qtyRemaining) =>
this(qtyRemaining: qtyRemaining);
@override
TaxLotOut taxIfSoldNowRub(String? taxIfSoldNowRub) =>
this(taxIfSoldNowRub: taxIfSoldNowRub);
@override
TaxLotOut ticker(String? ticker) => this(ticker: ticker);
@override
TaxLotOut unrealizedGainRub(String? unrealizedGainRub) =>
this(unrealizedGainRub: unrealizedGainRub);
@override
/// This function **does support** nullification of nullable fields. All `null` values passed to `non-nullable` fields will be ignored. You can also use `TaxLotOut(...).copyWith.fieldName(...)` to override fields one at a time with nullification support.
///
/// Usage
/// ```dart
/// TaxLotOut(...).copyWith(id: 12, name: "My name")
/// ````
TaxLotOut call({
Object? accountId = const $CopyWithPlaceholder(),
Object? accountName = const $CopyWithPlaceholder(),
Object? costRub = const $CopyWithPlaceholder(),
Object? daysToLdv = const $CopyWithPlaceholder(),
Object? instrumentId = const $CopyWithPlaceholder(),
Object? ldvDate = const $CopyWithPlaceholder(),
Object? ldvEligible = const $CopyWithPlaceholder(),
Object? lotId = const $CopyWithPlaceholder(),
Object? marketValueRub = const $CopyWithPlaceholder(),
Object? name = const $CopyWithPlaceholder(),
Object? openDate = const $CopyWithPlaceholder(),
Object? qtyRemaining = const $CopyWithPlaceholder(),
Object? taxIfSoldNowRub = const $CopyWithPlaceholder(),
Object? ticker = const $CopyWithPlaceholder(),
Object? unrealizedGainRub = const $CopyWithPlaceholder(),
}) {
return TaxLotOut(
accountId: accountId == const $CopyWithPlaceholder()
? _value.accountId
// ignore: cast_nullable_to_non_nullable
: accountId as int,
accountName: accountName == const $CopyWithPlaceholder()
? _value.accountName
// ignore: cast_nullable_to_non_nullable
: accountName as String,
costRub: costRub == const $CopyWithPlaceholder()
? _value.costRub
// ignore: cast_nullable_to_non_nullable
: costRub as String?,
daysToLdv: daysToLdv == const $CopyWithPlaceholder()
? _value.daysToLdv
// ignore: cast_nullable_to_non_nullable
: daysToLdv as int?,
instrumentId: instrumentId == const $CopyWithPlaceholder()
? _value.instrumentId
// ignore: cast_nullable_to_non_nullable
: instrumentId as int,
ldvDate: ldvDate == const $CopyWithPlaceholder()
? _value.ldvDate
// ignore: cast_nullable_to_non_nullable
: ldvDate as DateTime?,
ldvEligible: ldvEligible == const $CopyWithPlaceholder()
? _value.ldvEligible
// ignore: cast_nullable_to_non_nullable
: ldvEligible as bool,
lotId: lotId == const $CopyWithPlaceholder()
? _value.lotId
// ignore: cast_nullable_to_non_nullable
: lotId as int,
marketValueRub: marketValueRub == const $CopyWithPlaceholder()
? _value.marketValueRub
// ignore: cast_nullable_to_non_nullable
: marketValueRub as String?,
name: name == const $CopyWithPlaceholder()
? _value.name
// ignore: cast_nullable_to_non_nullable
: name as String,
openDate: openDate == const $CopyWithPlaceholder()
? _value.openDate
// ignore: cast_nullable_to_non_nullable
: openDate as DateTime,
qtyRemaining: qtyRemaining == const $CopyWithPlaceholder()
? _value.qtyRemaining
// ignore: cast_nullable_to_non_nullable
: qtyRemaining as String,
taxIfSoldNowRub: taxIfSoldNowRub == const $CopyWithPlaceholder()
? _value.taxIfSoldNowRub
// ignore: cast_nullable_to_non_nullable
: taxIfSoldNowRub as String?,
ticker: ticker == const $CopyWithPlaceholder()
? _value.ticker
// ignore: cast_nullable_to_non_nullable
: ticker as String?,
unrealizedGainRub: unrealizedGainRub == const $CopyWithPlaceholder()
? _value.unrealizedGainRub
// ignore: cast_nullable_to_non_nullable
: unrealizedGainRub as String?,
);
}
}
extension $TaxLotOutCopyWith on TaxLotOut {
/// Returns a callable class that can be used as follows: `instanceOfTaxLotOut.copyWith(...)` or like so:`instanceOfTaxLotOut.copyWith.fieldName(...)`.
// ignore: library_private_types_in_public_api
_$TaxLotOutCWProxy get copyWith => _$TaxLotOutCWProxyImpl(this);
}
// **************************************************************************
// JsonSerializableGenerator
// **************************************************************************
TaxLotOut _$TaxLotOutFromJson(Map<String, dynamic> json) => $checkedCreate(
'TaxLotOut',
json,
($checkedConvert) {
$checkKeys(
json,
requiredKeys: const [
'account_id',
'account_name',
'cost_rub',
'days_to_ldv',
'instrument_id',
'ldv_date',
'ldv_eligible',
'lot_id',
'market_value_rub',
'name',
'open_date',
'qty_remaining',
'tax_if_sold_now_rub',
'ticker',
'unrealized_gain_rub',
],
);
final val = TaxLotOut(
accountId: $checkedConvert('account_id', (v) => (v as num).toInt()),
accountName: $checkedConvert('account_name', (v) => v as String),
costRub: $checkedConvert('cost_rub', (v) => v as String?),
daysToLdv: $checkedConvert('days_to_ldv', (v) => (v as num?)?.toInt()),
instrumentId: $checkedConvert('instrument_id', (v) => (v as num).toInt()),
ldvDate: $checkedConvert(
'ldv_date',
(v) => v == null ? null : DateTime.parse(v as String),
),
ldvEligible: $checkedConvert('ldv_eligible', (v) => v as bool),
lotId: $checkedConvert('lot_id', (v) => (v as num).toInt()),
marketValueRub: $checkedConvert('market_value_rub', (v) => v as String?),
name: $checkedConvert('name', (v) => v as String),
openDate: $checkedConvert(
'open_date',
(v) => DateTime.parse(v as String),
),
qtyRemaining: $checkedConvert('qty_remaining', (v) => v as String),
taxIfSoldNowRub: $checkedConvert(
'tax_if_sold_now_rub',
(v) => v as String?,
),
ticker: $checkedConvert('ticker', (v) => v as String?),
unrealizedGainRub: $checkedConvert(
'unrealized_gain_rub',
(v) => v as String?,
),
);
return val;
},
fieldKeyMap: const {
'accountId': 'account_id',
'accountName': 'account_name',
'costRub': 'cost_rub',
'daysToLdv': 'days_to_ldv',
'instrumentId': 'instrument_id',
'ldvDate': 'ldv_date',
'ldvEligible': 'ldv_eligible',
'lotId': 'lot_id',
'marketValueRub': 'market_value_rub',
'openDate': 'open_date',
'qtyRemaining': 'qty_remaining',
'taxIfSoldNowRub': 'tax_if_sold_now_rub',
'unrealizedGainRub': 'unrealized_gain_rub',
},
);
Map<String, dynamic> _$TaxLotOutToJson(TaxLotOut instance) => <String, dynamic>{
'account_id': instance.accountId,
'account_name': instance.accountName,
'cost_rub': instance.costRub,
'days_to_ldv': instance.daysToLdv,
'instrument_id': instance.instrumentId,
'ldv_date': instance.ldvDate?.toIso8601String(),
'ldv_eligible': instance.ldvEligible,
'lot_id': instance.lotId,
'market_value_rub': instance.marketValueRub,
'name': instance.name,
'open_date': instance.openDate.toIso8601String(),
'qty_remaining': instance.qtyRemaining,
'tax_if_sold_now_rub': instance.taxIfSoldNowRub,
'ticker': instance.ticker,
'unrealized_gain_rub': instance.unrealizedGainRub,
};
@@ -0,0 +1,140 @@
//
// AUTO-GENERATED FILE, DO NOT MODIFY!
//
// ignore_for_file: unused_element
import 'package:fintracker_api/src/model/tax_lot_out.dart';
import 'package:copy_with_extension/copy_with_extension.dart';
import 'package:json_annotation/json_annotation.dart';
part 'tax_lots_out.g.dart';
@CopyWith()
@JsonSerializable(
checked: true,
createToJson: true,
disallowUnrecognizedKeys: false,
explicitToJson: true,
)
class TaxLotsOut {
/// Returns a new [TaxLotsOut] instance.
TaxLotsOut({
required this.asOf,
required this.disclaimer,
this.estimated = true,
required this.lots,
required this.taxRate,
required this.year,
});
@JsonKey(
name: r'as_of',
required: true,
includeIfNull: false,
)
final DateTime asOf;
@JsonKey(
name: r'disclaimer',
required: true,
includeIfNull: false,
)
final String disclaimer;
@JsonKey(
defaultValue: true,
name: r'estimated',
required: false,
includeIfNull: false,
)
final bool? estimated;
@JsonKey(
name: r'lots',
required: true,
includeIfNull: false,
)
final List<TaxLotOut> lots;
/// decimal as string
@JsonKey(
name: r'tax_rate',
required: true,
includeIfNull: false,
)
final String taxRate;
@JsonKey(
name: r'year',
required: true,
includeIfNull: false,
)
final int year;
@override
bool operator ==(Object other) => identical(this, other) || other is TaxLotsOut &&
other.asOf == asOf &&
other.disclaimer == disclaimer &&
other.estimated == estimated &&
other.lots == lots &&
other.taxRate == taxRate &&
other.year == year;
@override
int get hashCode =>
asOf.hashCode +
disclaimer.hashCode +
estimated.hashCode +
lots.hashCode +
taxRate.hashCode +
year.hashCode;
factory TaxLotsOut.fromJson(Map<String, dynamic> json) => _$TaxLotsOutFromJson(json);
Map<String, dynamic> toJson() => _$TaxLotsOutToJson(this);
@override
String toString() {
return toJson().toString();
}
}
@@ -0,0 +1,146 @@
// GENERATED CODE - DO NOT MODIFY BY HAND
part of 'tax_lots_out.dart';
// **************************************************************************
// CopyWithGenerator
// **************************************************************************
abstract class _$TaxLotsOutCWProxy {
TaxLotsOut asOf(DateTime asOf);
TaxLotsOut disclaimer(String disclaimer);
TaxLotsOut estimated(bool? estimated);
TaxLotsOut lots(List<TaxLotOut> lots);
TaxLotsOut taxRate(String taxRate);
TaxLotsOut year(int year);
/// This function **does support** nullification of nullable fields. All `null` values passed to `non-nullable` fields will be ignored. You can also use `TaxLotsOut(...).copyWith.fieldName(...)` to override fields one at a time with nullification support.
///
/// Usage
/// ```dart
/// TaxLotsOut(...).copyWith(id: 12, name: "My name")
/// ````
TaxLotsOut call({
DateTime asOf,
String disclaimer,
bool? estimated,
List<TaxLotOut> lots,
String taxRate,
int year,
});
}
/// Proxy class for `copyWith` functionality. This is a callable class and can be used as follows: `instanceOfTaxLotsOut.copyWith(...)`. Additionally contains functions for specific fields e.g. `instanceOfTaxLotsOut.copyWith.fieldName(...)`
class _$TaxLotsOutCWProxyImpl implements _$TaxLotsOutCWProxy {
const _$TaxLotsOutCWProxyImpl(this._value);
final TaxLotsOut _value;
@override
TaxLotsOut asOf(DateTime asOf) => this(asOf: asOf);
@override
TaxLotsOut disclaimer(String disclaimer) => this(disclaimer: disclaimer);
@override
TaxLotsOut estimated(bool? estimated) => this(estimated: estimated);
@override
TaxLotsOut lots(List<TaxLotOut> lots) => this(lots: lots);
@override
TaxLotsOut taxRate(String taxRate) => this(taxRate: taxRate);
@override
TaxLotsOut year(int year) => this(year: year);
@override
/// This function **does support** nullification of nullable fields. All `null` values passed to `non-nullable` fields will be ignored. You can also use `TaxLotsOut(...).copyWith.fieldName(...)` to override fields one at a time with nullification support.
///
/// Usage
/// ```dart
/// TaxLotsOut(...).copyWith(id: 12, name: "My name")
/// ````
TaxLotsOut call({
Object? asOf = const $CopyWithPlaceholder(),
Object? disclaimer = const $CopyWithPlaceholder(),
Object? estimated = const $CopyWithPlaceholder(),
Object? lots = const $CopyWithPlaceholder(),
Object? taxRate = const $CopyWithPlaceholder(),
Object? year = const $CopyWithPlaceholder(),
}) {
return TaxLotsOut(
asOf: asOf == const $CopyWithPlaceholder()
? _value.asOf
// ignore: cast_nullable_to_non_nullable
: asOf as DateTime,
disclaimer: disclaimer == const $CopyWithPlaceholder()
? _value.disclaimer
// ignore: cast_nullable_to_non_nullable
: disclaimer as String,
estimated: estimated == const $CopyWithPlaceholder()
? _value.estimated
// ignore: cast_nullable_to_non_nullable
: estimated as bool?,
lots: lots == const $CopyWithPlaceholder()
? _value.lots
// ignore: cast_nullable_to_non_nullable
: lots as List<TaxLotOut>,
taxRate: taxRate == const $CopyWithPlaceholder()
? _value.taxRate
// ignore: cast_nullable_to_non_nullable
: taxRate as String,
year: year == const $CopyWithPlaceholder()
? _value.year
// ignore: cast_nullable_to_non_nullable
: year as int,
);
}
}
extension $TaxLotsOutCopyWith on TaxLotsOut {
/// Returns a callable class that can be used as follows: `instanceOfTaxLotsOut.copyWith(...)` or like so:`instanceOfTaxLotsOut.copyWith.fieldName(...)`.
// ignore: library_private_types_in_public_api
_$TaxLotsOutCWProxy get copyWith => _$TaxLotsOutCWProxyImpl(this);
}
// **************************************************************************
// JsonSerializableGenerator
// **************************************************************************
TaxLotsOut _$TaxLotsOutFromJson(Map<String, dynamic> json) =>
$checkedCreate('TaxLotsOut', json, ($checkedConvert) {
$checkKeys(
json,
requiredKeys: const ['as_of', 'disclaimer', 'lots', 'tax_rate', 'year'],
);
final val = TaxLotsOut(
asOf: $checkedConvert('as_of', (v) => DateTime.parse(v as String)),
disclaimer: $checkedConvert('disclaimer', (v) => v as String),
estimated: $checkedConvert('estimated', (v) => v as bool? ?? true),
lots: $checkedConvert(
'lots',
(v) => (v as List<dynamic>)
.map((e) => TaxLotOut.fromJson(e as Map<String, dynamic>))
.toList(),
),
taxRate: $checkedConvert('tax_rate', (v) => v as String),
year: $checkedConvert('year', (v) => (v as num).toInt()),
);
return val;
}, fieldKeyMap: const {'asOf': 'as_of', 'taxRate': 'tax_rate'});
Map<String, dynamic> _$TaxLotsOutToJson(TaxLotsOut instance) =>
<String, dynamic>{
'as_of': instance.asOf.toIso8601String(),
'disclaimer': instance.disclaimer,
'estimated': ?instance.estimated,
'lots': instance.lots.map((e) => e.toJson()).toList(),
'tax_rate': instance.taxRate,
'year': instance.year,
};
@@ -0,0 +1,178 @@
//
// 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 'tax_totals.g.dart';
@CopyWith()
@JsonSerializable(
checked: true,
createToJson: true,
disallowUnrecognizedKeys: false,
explicitToJson: true,
)
class TaxTotals {
/// Returns a new [TaxTotals] instance.
TaxTotals({
required this.couponsGrossRub,
required this.dividendsGrossRub,
required this.estimatedTaxRub,
required this.ldvExemptRub,
required this.realizedGainRub,
required this.realizedLossRub,
required this.taxWithheldRub,
required this.taxableBaseRub,
});
/// decimal as string
@JsonKey(
name: r'coupons_gross_rub',
required: true,
includeIfNull: false,
)
final String couponsGrossRub;
/// decimal as string
@JsonKey(
name: r'dividends_gross_rub',
required: true,
includeIfNull: false,
)
final String dividendsGrossRub;
/// decimal as string
@JsonKey(
name: r'estimated_tax_rub',
required: true,
includeIfNull: false,
)
final String estimatedTaxRub;
/// decimal as string
@JsonKey(
name: r'ldv_exempt_rub',
required: true,
includeIfNull: false,
)
final String ldvExemptRub;
/// decimal as string
@JsonKey(
name: r'realized_gain_rub',
required: true,
includeIfNull: false,
)
final String realizedGainRub;
/// decimal as string
@JsonKey(
name: r'realized_loss_rub',
required: true,
includeIfNull: false,
)
final String realizedLossRub;
/// decimal as string
@JsonKey(
name: r'tax_withheld_rub',
required: true,
includeIfNull: false,
)
final String taxWithheldRub;
/// decimal as string
@JsonKey(
name: r'taxable_base_rub',
required: true,
includeIfNull: false,
)
final String taxableBaseRub;
@override
bool operator ==(Object other) => identical(this, other) || other is TaxTotals &&
other.couponsGrossRub == couponsGrossRub &&
other.dividendsGrossRub == dividendsGrossRub &&
other.estimatedTaxRub == estimatedTaxRub &&
other.ldvExemptRub == ldvExemptRub &&
other.realizedGainRub == realizedGainRub &&
other.realizedLossRub == realizedLossRub &&
other.taxWithheldRub == taxWithheldRub &&
other.taxableBaseRub == taxableBaseRub;
@override
int get hashCode =>
couponsGrossRub.hashCode +
dividendsGrossRub.hashCode +
estimatedTaxRub.hashCode +
ldvExemptRub.hashCode +
realizedGainRub.hashCode +
realizedLossRub.hashCode +
taxWithheldRub.hashCode +
taxableBaseRub.hashCode;
factory TaxTotals.fromJson(Map<String, dynamic> json) => _$TaxTotalsFromJson(json);
Map<String, dynamic> toJson() => _$TaxTotalsToJson(this);
@override
String toString() {
return toJson().toString();
}
}
@@ -0,0 +1,199 @@
// GENERATED CODE - DO NOT MODIFY BY HAND
part of 'tax_totals.dart';
// **************************************************************************
// CopyWithGenerator
// **************************************************************************
abstract class _$TaxTotalsCWProxy {
TaxTotals couponsGrossRub(String couponsGrossRub);
TaxTotals dividendsGrossRub(String dividendsGrossRub);
TaxTotals estimatedTaxRub(String estimatedTaxRub);
TaxTotals ldvExemptRub(String ldvExemptRub);
TaxTotals realizedGainRub(String realizedGainRub);
TaxTotals realizedLossRub(String realizedLossRub);
TaxTotals taxWithheldRub(String taxWithheldRub);
TaxTotals taxableBaseRub(String taxableBaseRub);
/// This function **does support** nullification of nullable fields. All `null` values passed to `non-nullable` fields will be ignored. You can also use `TaxTotals(...).copyWith.fieldName(...)` to override fields one at a time with nullification support.
///
/// Usage
/// ```dart
/// TaxTotals(...).copyWith(id: 12, name: "My name")
/// ````
TaxTotals call({
String couponsGrossRub,
String dividendsGrossRub,
String estimatedTaxRub,
String ldvExemptRub,
String realizedGainRub,
String realizedLossRub,
String taxWithheldRub,
String taxableBaseRub,
});
}
/// Proxy class for `copyWith` functionality. This is a callable class and can be used as follows: `instanceOfTaxTotals.copyWith(...)`. Additionally contains functions for specific fields e.g. `instanceOfTaxTotals.copyWith.fieldName(...)`
class _$TaxTotalsCWProxyImpl implements _$TaxTotalsCWProxy {
const _$TaxTotalsCWProxyImpl(this._value);
final TaxTotals _value;
@override
TaxTotals couponsGrossRub(String couponsGrossRub) =>
this(couponsGrossRub: couponsGrossRub);
@override
TaxTotals dividendsGrossRub(String dividendsGrossRub) =>
this(dividendsGrossRub: dividendsGrossRub);
@override
TaxTotals estimatedTaxRub(String estimatedTaxRub) =>
this(estimatedTaxRub: estimatedTaxRub);
@override
TaxTotals ldvExemptRub(String ldvExemptRub) =>
this(ldvExemptRub: ldvExemptRub);
@override
TaxTotals realizedGainRub(String realizedGainRub) =>
this(realizedGainRub: realizedGainRub);
@override
TaxTotals realizedLossRub(String realizedLossRub) =>
this(realizedLossRub: realizedLossRub);
@override
TaxTotals taxWithheldRub(String taxWithheldRub) =>
this(taxWithheldRub: taxWithheldRub);
@override
TaxTotals taxableBaseRub(String taxableBaseRub) =>
this(taxableBaseRub: taxableBaseRub);
@override
/// This function **does support** nullification of nullable fields. All `null` values passed to `non-nullable` fields will be ignored. You can also use `TaxTotals(...).copyWith.fieldName(...)` to override fields one at a time with nullification support.
///
/// Usage
/// ```dart
/// TaxTotals(...).copyWith(id: 12, name: "My name")
/// ````
TaxTotals call({
Object? couponsGrossRub = const $CopyWithPlaceholder(),
Object? dividendsGrossRub = const $CopyWithPlaceholder(),
Object? estimatedTaxRub = const $CopyWithPlaceholder(),
Object? ldvExemptRub = const $CopyWithPlaceholder(),
Object? realizedGainRub = const $CopyWithPlaceholder(),
Object? realizedLossRub = const $CopyWithPlaceholder(),
Object? taxWithheldRub = const $CopyWithPlaceholder(),
Object? taxableBaseRub = const $CopyWithPlaceholder(),
}) {
return TaxTotals(
couponsGrossRub: couponsGrossRub == const $CopyWithPlaceholder()
? _value.couponsGrossRub
// ignore: cast_nullable_to_non_nullable
: couponsGrossRub as String,
dividendsGrossRub: dividendsGrossRub == const $CopyWithPlaceholder()
? _value.dividendsGrossRub
// ignore: cast_nullable_to_non_nullable
: dividendsGrossRub as String,
estimatedTaxRub: estimatedTaxRub == const $CopyWithPlaceholder()
? _value.estimatedTaxRub
// ignore: cast_nullable_to_non_nullable
: estimatedTaxRub as String,
ldvExemptRub: ldvExemptRub == const $CopyWithPlaceholder()
? _value.ldvExemptRub
// ignore: cast_nullable_to_non_nullable
: ldvExemptRub as String,
realizedGainRub: realizedGainRub == const $CopyWithPlaceholder()
? _value.realizedGainRub
// ignore: cast_nullable_to_non_nullable
: realizedGainRub as String,
realizedLossRub: realizedLossRub == const $CopyWithPlaceholder()
? _value.realizedLossRub
// ignore: cast_nullable_to_non_nullable
: realizedLossRub as String,
taxWithheldRub: taxWithheldRub == const $CopyWithPlaceholder()
? _value.taxWithheldRub
// ignore: cast_nullable_to_non_nullable
: taxWithheldRub as String,
taxableBaseRub: taxableBaseRub == const $CopyWithPlaceholder()
? _value.taxableBaseRub
// ignore: cast_nullable_to_non_nullable
: taxableBaseRub as String,
);
}
}
extension $TaxTotalsCopyWith on TaxTotals {
/// Returns a callable class that can be used as follows: `instanceOfTaxTotals.copyWith(...)` or like so:`instanceOfTaxTotals.copyWith.fieldName(...)`.
// ignore: library_private_types_in_public_api
_$TaxTotalsCWProxy get copyWith => _$TaxTotalsCWProxyImpl(this);
}
// **************************************************************************
// JsonSerializableGenerator
// **************************************************************************
TaxTotals _$TaxTotalsFromJson(Map<String, dynamic> json) => $checkedCreate(
'TaxTotals',
json,
($checkedConvert) {
$checkKeys(
json,
requiredKeys: const [
'coupons_gross_rub',
'dividends_gross_rub',
'estimated_tax_rub',
'ldv_exempt_rub',
'realized_gain_rub',
'realized_loss_rub',
'tax_withheld_rub',
'taxable_base_rub',
],
);
final val = TaxTotals(
couponsGrossRub: $checkedConvert('coupons_gross_rub', (v) => v as String),
dividendsGrossRub: $checkedConvert(
'dividends_gross_rub',
(v) => v as String,
),
estimatedTaxRub: $checkedConvert('estimated_tax_rub', (v) => v as String),
ldvExemptRub: $checkedConvert('ldv_exempt_rub', (v) => v as String),
realizedGainRub: $checkedConvert('realized_gain_rub', (v) => v as String),
realizedLossRub: $checkedConvert('realized_loss_rub', (v) => v as String),
taxWithheldRub: $checkedConvert('tax_withheld_rub', (v) => v as String),
taxableBaseRub: $checkedConvert('taxable_base_rub', (v) => v as String),
);
return val;
},
fieldKeyMap: const {
'couponsGrossRub': 'coupons_gross_rub',
'dividendsGrossRub': 'dividends_gross_rub',
'estimatedTaxRub': 'estimated_tax_rub',
'ldvExemptRub': 'ldv_exempt_rub',
'realizedGainRub': 'realized_gain_rub',
'realizedLossRub': 'realized_loss_rub',
'taxWithheldRub': 'tax_withheld_rub',
'taxableBaseRub': 'taxable_base_rub',
},
);
Map<String, dynamic> _$TaxTotalsToJson(TaxTotals instance) => <String, dynamic>{
'coupons_gross_rub': instance.couponsGrossRub,
'dividends_gross_rub': instance.dividendsGrossRub,
'estimated_tax_rub': instance.estimatedTaxRub,
'ldv_exempt_rub': instance.ldvExemptRub,
'realized_gain_rub': instance.realizedGainRub,
'realized_loss_rub': instance.realizedLossRub,
'tax_withheld_rub': instance.taxWithheldRub,
'taxable_base_rub': instance.taxableBaseRub,
};
@@ -0,0 +1,141 @@
//
// AUTO-GENERATED FILE, DO NOT MODIFY!
//
// ignore_for_file: unused_element
import 'package:fintracker_api/src/model/tax_totals.dart';
import 'package:fintracker_api/src/model/tax_account_out.dart';
import 'package:copy_with_extension/copy_with_extension.dart';
import 'package:json_annotation/json_annotation.dart';
part 'tax_year_out.g.dart';
@CopyWith()
@JsonSerializable(
checked: true,
createToJson: true,
disallowUnrecognizedKeys: false,
explicitToJson: true,
)
class TaxYearOut {
/// Returns a new [TaxYearOut] instance.
TaxYearOut({
required this.accounts,
required this.disclaimer,
this.estimated = true,
required this.taxRate,
required this.totals,
required this.year,
});
@JsonKey(
name: r'accounts',
required: true,
includeIfNull: false,
)
final List<TaxAccountOut> accounts;
@JsonKey(
name: r'disclaimer',
required: true,
includeIfNull: false,
)
final String disclaimer;
@JsonKey(
defaultValue: true,
name: r'estimated',
required: false,
includeIfNull: false,
)
final bool? estimated;
/// decimal as string
@JsonKey(
name: r'tax_rate',
required: true,
includeIfNull: false,
)
final String taxRate;
@JsonKey(
name: r'totals',
required: true,
includeIfNull: false,
)
final TaxTotals totals;
@JsonKey(
name: r'year',
required: true,
includeIfNull: false,
)
final int year;
@override
bool operator ==(Object other) => identical(this, other) || other is TaxYearOut &&
other.accounts == accounts &&
other.disclaimer == disclaimer &&
other.estimated == estimated &&
other.taxRate == taxRate &&
other.totals == totals &&
other.year == year;
@override
int get hashCode =>
accounts.hashCode +
disclaimer.hashCode +
estimated.hashCode +
taxRate.hashCode +
totals.hashCode +
year.hashCode;
factory TaxYearOut.fromJson(Map<String, dynamic> json) => _$TaxYearOutFromJson(json);
Map<String, dynamic> toJson() => _$TaxYearOutToJson(this);
@override
String toString() {
return toJson().toString();
}
}
@@ -0,0 +1,155 @@
// GENERATED CODE - DO NOT MODIFY BY HAND
part of 'tax_year_out.dart';
// **************************************************************************
// CopyWithGenerator
// **************************************************************************
abstract class _$TaxYearOutCWProxy {
TaxYearOut accounts(List<TaxAccountOut> accounts);
TaxYearOut disclaimer(String disclaimer);
TaxYearOut estimated(bool? estimated);
TaxYearOut taxRate(String taxRate);
TaxYearOut totals(TaxTotals totals);
TaxYearOut year(int year);
/// This function **does support** nullification of nullable fields. All `null` values passed to `non-nullable` fields will be ignored. You can also use `TaxYearOut(...).copyWith.fieldName(...)` to override fields one at a time with nullification support.
///
/// Usage
/// ```dart
/// TaxYearOut(...).copyWith(id: 12, name: "My name")
/// ````
TaxYearOut call({
List<TaxAccountOut> accounts,
String disclaimer,
bool? estimated,
String taxRate,
TaxTotals totals,
int year,
});
}
/// Proxy class for `copyWith` functionality. This is a callable class and can be used as follows: `instanceOfTaxYearOut.copyWith(...)`. Additionally contains functions for specific fields e.g. `instanceOfTaxYearOut.copyWith.fieldName(...)`
class _$TaxYearOutCWProxyImpl implements _$TaxYearOutCWProxy {
const _$TaxYearOutCWProxyImpl(this._value);
final TaxYearOut _value;
@override
TaxYearOut accounts(List<TaxAccountOut> accounts) => this(accounts: accounts);
@override
TaxYearOut disclaimer(String disclaimer) => this(disclaimer: disclaimer);
@override
TaxYearOut estimated(bool? estimated) => this(estimated: estimated);
@override
TaxYearOut taxRate(String taxRate) => this(taxRate: taxRate);
@override
TaxYearOut totals(TaxTotals totals) => this(totals: totals);
@override
TaxYearOut year(int year) => this(year: year);
@override
/// This function **does support** nullification of nullable fields. All `null` values passed to `non-nullable` fields will be ignored. You can also use `TaxYearOut(...).copyWith.fieldName(...)` to override fields one at a time with nullification support.
///
/// Usage
/// ```dart
/// TaxYearOut(...).copyWith(id: 12, name: "My name")
/// ````
TaxYearOut call({
Object? accounts = const $CopyWithPlaceholder(),
Object? disclaimer = const $CopyWithPlaceholder(),
Object? estimated = const $CopyWithPlaceholder(),
Object? taxRate = const $CopyWithPlaceholder(),
Object? totals = const $CopyWithPlaceholder(),
Object? year = const $CopyWithPlaceholder(),
}) {
return TaxYearOut(
accounts: accounts == const $CopyWithPlaceholder()
? _value.accounts
// ignore: cast_nullable_to_non_nullable
: accounts as List<TaxAccountOut>,
disclaimer: disclaimer == const $CopyWithPlaceholder()
? _value.disclaimer
// ignore: cast_nullable_to_non_nullable
: disclaimer as String,
estimated: estimated == const $CopyWithPlaceholder()
? _value.estimated
// ignore: cast_nullable_to_non_nullable
: estimated as bool?,
taxRate: taxRate == const $CopyWithPlaceholder()
? _value.taxRate
// ignore: cast_nullable_to_non_nullable
: taxRate as String,
totals: totals == const $CopyWithPlaceholder()
? _value.totals
// ignore: cast_nullable_to_non_nullable
: totals as TaxTotals,
year: year == const $CopyWithPlaceholder()
? _value.year
// ignore: cast_nullable_to_non_nullable
: year as int,
);
}
}
extension $TaxYearOutCopyWith on TaxYearOut {
/// Returns a callable class that can be used as follows: `instanceOfTaxYearOut.copyWith(...)` or like so:`instanceOfTaxYearOut.copyWith.fieldName(...)`.
// ignore: library_private_types_in_public_api
_$TaxYearOutCWProxy get copyWith => _$TaxYearOutCWProxyImpl(this);
}
// **************************************************************************
// JsonSerializableGenerator
// **************************************************************************
TaxYearOut _$TaxYearOutFromJson(Map<String, dynamic> json) =>
$checkedCreate('TaxYearOut', json, ($checkedConvert) {
$checkKeys(
json,
requiredKeys: const [
'accounts',
'disclaimer',
'tax_rate',
'totals',
'year',
],
);
final val = TaxYearOut(
accounts: $checkedConvert(
'accounts',
(v) => (v as List<dynamic>)
.map((e) => TaxAccountOut.fromJson(e as Map<String, dynamic>))
.toList(),
),
disclaimer: $checkedConvert('disclaimer', (v) => v as String),
estimated: $checkedConvert('estimated', (v) => v as bool? ?? true),
taxRate: $checkedConvert('tax_rate', (v) => v as String),
totals: $checkedConvert(
'totals',
(v) => TaxTotals.fromJson(v as Map<String, dynamic>),
),
year: $checkedConvert('year', (v) => (v as num).toInt()),
);
return val;
}, fieldKeyMap: const {'taxRate': 'tax_rate'});
Map<String, dynamic> _$TaxYearOutToJson(TaxYearOut instance) =>
<String, dynamic>{
'accounts': instance.accounts.map((e) => e.toJson()).toList(),
'disclaimer': instance.disclaimer,
'estimated': ?instance.estimated,
'tax_rate': instance.taxRate,
'totals': instance.totals.toJson(),
'year': instance.year,
};

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