393 lines
13 KiB
Dart
393 lines
13 KiB
Dart
// GENERATED CODE - DO NOT MODIFY BY HAND
|
|
|
|
part of 'event_out.dart';
|
|
|
|
// **************************************************************************
|
|
// CopyWithGenerator
|
|
// **************************************************************************
|
|
|
|
abstract class _$EventOutCWProxy {
|
|
EventOut accountId(int accountId);
|
|
|
|
EventOut accruedInterest(String? accruedInterest);
|
|
|
|
EventOut amount(String amount);
|
|
|
|
EventOut amountRub(String? amountRub);
|
|
|
|
EventOut currency(String currency);
|
|
|
|
EventOut description(String? description);
|
|
|
|
EventOut externalFlow(bool externalFlow);
|
|
|
|
EventOut fee(String? fee);
|
|
|
|
EventOut id(int id);
|
|
|
|
EventOut instrumentId(int? instrumentId);
|
|
|
|
EventOut kind(EventKind kind);
|
|
|
|
EventOut price(String? price);
|
|
|
|
EventOut priceCurrency(String? priceCurrency);
|
|
|
|
EventOut quantity(String? quantity);
|
|
|
|
EventOut status(EventStatus status);
|
|
|
|
EventOut tax(String? tax);
|
|
|
|
EventOut ticker(String? ticker);
|
|
|
|
EventOut tradeDate(DateTime tradeDate);
|
|
|
|
EventOut ts(DateTime ts);
|
|
|
|
/// This function **does support** nullification of nullable fields. All `null` values passed to `non-nullable` fields will be ignored. You can also use `EventOut(...).copyWith.fieldName(...)` to override fields one at a time with nullification support.
|
|
///
|
|
/// Usage
|
|
/// ```dart
|
|
/// EventOut(...).copyWith(id: 12, name: "My name")
|
|
/// ````
|
|
EventOut call({
|
|
int accountId,
|
|
String? accruedInterest,
|
|
String amount,
|
|
String? amountRub,
|
|
String currency,
|
|
String? description,
|
|
bool externalFlow,
|
|
String? fee,
|
|
int id,
|
|
int? instrumentId,
|
|
EventKind kind,
|
|
String? price,
|
|
String? priceCurrency,
|
|
String? quantity,
|
|
EventStatus status,
|
|
String? tax,
|
|
String? ticker,
|
|
DateTime tradeDate,
|
|
DateTime ts,
|
|
});
|
|
}
|
|
|
|
/// Proxy class for `copyWith` functionality. This is a callable class and can be used as follows: `instanceOfEventOut.copyWith(...)`. Additionally contains functions for specific fields e.g. `instanceOfEventOut.copyWith.fieldName(...)`
|
|
class _$EventOutCWProxyImpl implements _$EventOutCWProxy {
|
|
const _$EventOutCWProxyImpl(this._value);
|
|
|
|
final EventOut _value;
|
|
|
|
@override
|
|
EventOut accountId(int accountId) => this(accountId: accountId);
|
|
|
|
@override
|
|
EventOut accruedInterest(String? accruedInterest) =>
|
|
this(accruedInterest: accruedInterest);
|
|
|
|
@override
|
|
EventOut amount(String amount) => this(amount: amount);
|
|
|
|
@override
|
|
EventOut amountRub(String? amountRub) => this(amountRub: amountRub);
|
|
|
|
@override
|
|
EventOut currency(String currency) => this(currency: currency);
|
|
|
|
@override
|
|
EventOut description(String? description) => this(description: description);
|
|
|
|
@override
|
|
EventOut externalFlow(bool externalFlow) => this(externalFlow: externalFlow);
|
|
|
|
@override
|
|
EventOut fee(String? fee) => this(fee: fee);
|
|
|
|
@override
|
|
EventOut id(int id) => this(id: id);
|
|
|
|
@override
|
|
EventOut instrumentId(int? instrumentId) => this(instrumentId: instrumentId);
|
|
|
|
@override
|
|
EventOut kind(EventKind kind) => this(kind: kind);
|
|
|
|
@override
|
|
EventOut price(String? price) => this(price: price);
|
|
|
|
@override
|
|
EventOut priceCurrency(String? priceCurrency) =>
|
|
this(priceCurrency: priceCurrency);
|
|
|
|
@override
|
|
EventOut quantity(String? quantity) => this(quantity: quantity);
|
|
|
|
@override
|
|
EventOut status(EventStatus status) => this(status: status);
|
|
|
|
@override
|
|
EventOut tax(String? tax) => this(tax: tax);
|
|
|
|
@override
|
|
EventOut ticker(String? ticker) => this(ticker: ticker);
|
|
|
|
@override
|
|
EventOut tradeDate(DateTime tradeDate) => this(tradeDate: tradeDate);
|
|
|
|
@override
|
|
EventOut ts(DateTime ts) => this(ts: ts);
|
|
|
|
@override
|
|
/// This function **does support** nullification of nullable fields. All `null` values passed to `non-nullable` fields will be ignored. You can also use `EventOut(...).copyWith.fieldName(...)` to override fields one at a time with nullification support.
|
|
///
|
|
/// Usage
|
|
/// ```dart
|
|
/// EventOut(...).copyWith(id: 12, name: "My name")
|
|
/// ````
|
|
EventOut call({
|
|
Object? accountId = const $CopyWithPlaceholder(),
|
|
Object? accruedInterest = const $CopyWithPlaceholder(),
|
|
Object? amount = const $CopyWithPlaceholder(),
|
|
Object? amountRub = const $CopyWithPlaceholder(),
|
|
Object? currency = const $CopyWithPlaceholder(),
|
|
Object? description = const $CopyWithPlaceholder(),
|
|
Object? externalFlow = const $CopyWithPlaceholder(),
|
|
Object? fee = const $CopyWithPlaceholder(),
|
|
Object? id = const $CopyWithPlaceholder(),
|
|
Object? instrumentId = const $CopyWithPlaceholder(),
|
|
Object? kind = const $CopyWithPlaceholder(),
|
|
Object? price = const $CopyWithPlaceholder(),
|
|
Object? priceCurrency = const $CopyWithPlaceholder(),
|
|
Object? quantity = const $CopyWithPlaceholder(),
|
|
Object? status = const $CopyWithPlaceholder(),
|
|
Object? tax = const $CopyWithPlaceholder(),
|
|
Object? ticker = const $CopyWithPlaceholder(),
|
|
Object? tradeDate = const $CopyWithPlaceholder(),
|
|
Object? ts = const $CopyWithPlaceholder(),
|
|
}) {
|
|
return EventOut(
|
|
accountId: accountId == const $CopyWithPlaceholder()
|
|
? _value.accountId
|
|
// ignore: cast_nullable_to_non_nullable
|
|
: accountId as int,
|
|
accruedInterest: accruedInterest == const $CopyWithPlaceholder()
|
|
? _value.accruedInterest
|
|
// ignore: cast_nullable_to_non_nullable
|
|
: accruedInterest as String?,
|
|
amount: amount == const $CopyWithPlaceholder()
|
|
? _value.amount
|
|
// ignore: cast_nullable_to_non_nullable
|
|
: amount as String,
|
|
amountRub: amountRub == const $CopyWithPlaceholder()
|
|
? _value.amountRub
|
|
// ignore: cast_nullable_to_non_nullable
|
|
: amountRub as String?,
|
|
currency: currency == const $CopyWithPlaceholder()
|
|
? _value.currency
|
|
// ignore: cast_nullable_to_non_nullable
|
|
: currency as String,
|
|
description: description == const $CopyWithPlaceholder()
|
|
? _value.description
|
|
// ignore: cast_nullable_to_non_nullable
|
|
: description as String?,
|
|
externalFlow: externalFlow == const $CopyWithPlaceholder()
|
|
? _value.externalFlow
|
|
// ignore: cast_nullable_to_non_nullable
|
|
: externalFlow as bool,
|
|
fee: fee == const $CopyWithPlaceholder()
|
|
? _value.fee
|
|
// ignore: cast_nullable_to_non_nullable
|
|
: fee as String?,
|
|
id: id == const $CopyWithPlaceholder()
|
|
? _value.id
|
|
// ignore: cast_nullable_to_non_nullable
|
|
: id as int,
|
|
instrumentId: instrumentId == const $CopyWithPlaceholder()
|
|
? _value.instrumentId
|
|
// ignore: cast_nullable_to_non_nullable
|
|
: instrumentId as int?,
|
|
kind: kind == const $CopyWithPlaceholder()
|
|
? _value.kind
|
|
// ignore: cast_nullable_to_non_nullable
|
|
: kind as EventKind,
|
|
price: price == const $CopyWithPlaceholder()
|
|
? _value.price
|
|
// ignore: cast_nullable_to_non_nullable
|
|
: price as String?,
|
|
priceCurrency: priceCurrency == const $CopyWithPlaceholder()
|
|
? _value.priceCurrency
|
|
// ignore: cast_nullable_to_non_nullable
|
|
: priceCurrency as String?,
|
|
quantity: quantity == const $CopyWithPlaceholder()
|
|
? _value.quantity
|
|
// ignore: cast_nullable_to_non_nullable
|
|
: quantity as String?,
|
|
status: status == const $CopyWithPlaceholder()
|
|
? _value.status
|
|
// ignore: cast_nullable_to_non_nullable
|
|
: status as EventStatus,
|
|
tax: tax == const $CopyWithPlaceholder()
|
|
? _value.tax
|
|
// ignore: cast_nullable_to_non_nullable
|
|
: tax as String?,
|
|
ticker: ticker == const $CopyWithPlaceholder()
|
|
? _value.ticker
|
|
// ignore: cast_nullable_to_non_nullable
|
|
: ticker as String?,
|
|
tradeDate: tradeDate == const $CopyWithPlaceholder()
|
|
? _value.tradeDate
|
|
// ignore: cast_nullable_to_non_nullable
|
|
: tradeDate as DateTime,
|
|
ts: ts == const $CopyWithPlaceholder()
|
|
? _value.ts
|
|
// ignore: cast_nullable_to_non_nullable
|
|
: ts as DateTime,
|
|
);
|
|
}
|
|
}
|
|
|
|
extension $EventOutCopyWith on EventOut {
|
|
/// Returns a callable class that can be used as follows: `instanceOfEventOut.copyWith(...)` or like so:`instanceOfEventOut.copyWith.fieldName(...)`.
|
|
// ignore: library_private_types_in_public_api
|
|
_$EventOutCWProxy get copyWith => _$EventOutCWProxyImpl(this);
|
|
}
|
|
|
|
// **************************************************************************
|
|
// JsonSerializableGenerator
|
|
// **************************************************************************
|
|
|
|
EventOut _$EventOutFromJson(Map<String, dynamic> json) => $checkedCreate(
|
|
'EventOut',
|
|
json,
|
|
($checkedConvert) {
|
|
$checkKeys(
|
|
json,
|
|
requiredKeys: const [
|
|
'account_id',
|
|
'accrued_interest',
|
|
'amount',
|
|
'amount_rub',
|
|
'currency',
|
|
'description',
|
|
'external_flow',
|
|
'fee',
|
|
'id',
|
|
'instrument_id',
|
|
'kind',
|
|
'price',
|
|
'price_currency',
|
|
'quantity',
|
|
'status',
|
|
'tax',
|
|
'ticker',
|
|
'trade_date',
|
|
'ts',
|
|
],
|
|
);
|
|
final val = EventOut(
|
|
accountId: $checkedConvert('account_id', (v) => (v as num).toInt()),
|
|
accruedInterest: $checkedConvert('accrued_interest', (v) => v as String?),
|
|
amount: $checkedConvert('amount', (v) => v as String),
|
|
amountRub: $checkedConvert('amount_rub', (v) => v as String?),
|
|
currency: $checkedConvert('currency', (v) => v as String),
|
|
description: $checkedConvert('description', (v) => v as String?),
|
|
externalFlow: $checkedConvert('external_flow', (v) => v as bool),
|
|
fee: $checkedConvert('fee', (v) => v as String?),
|
|
id: $checkedConvert('id', (v) => (v as num).toInt()),
|
|
instrumentId: $checkedConvert(
|
|
'instrument_id',
|
|
(v) => (v as num?)?.toInt(),
|
|
),
|
|
kind: $checkedConvert(
|
|
'kind',
|
|
(v) => $enumDecode(
|
|
_$EventKindEnumMap,
|
|
v,
|
|
unknownValue: EventKind.unknownDefaultOpenApi,
|
|
),
|
|
),
|
|
price: $checkedConvert('price', (v) => v as String?),
|
|
priceCurrency: $checkedConvert('price_currency', (v) => v as String?),
|
|
quantity: $checkedConvert('quantity', (v) => v as String?),
|
|
status: $checkedConvert(
|
|
'status',
|
|
(v) => $enumDecode(
|
|
_$EventStatusEnumMap,
|
|
v,
|
|
unknownValue: EventStatus.unknownDefaultOpenApi,
|
|
),
|
|
),
|
|
tax: $checkedConvert('tax', (v) => v as String?),
|
|
ticker: $checkedConvert('ticker', (v) => v as String?),
|
|
tradeDate: $checkedConvert(
|
|
'trade_date',
|
|
(v) => DateTime.parse(v as String),
|
|
),
|
|
ts: $checkedConvert('ts', (v) => DateTime.parse(v as String)),
|
|
);
|
|
return val;
|
|
},
|
|
fieldKeyMap: const {
|
|
'accountId': 'account_id',
|
|
'accruedInterest': 'accrued_interest',
|
|
'amountRub': 'amount_rub',
|
|
'externalFlow': 'external_flow',
|
|
'instrumentId': 'instrument_id',
|
|
'priceCurrency': 'price_currency',
|
|
'tradeDate': 'trade_date',
|
|
},
|
|
);
|
|
|
|
Map<String, dynamic> _$EventOutToJson(EventOut instance) => <String, dynamic>{
|
|
'account_id': instance.accountId,
|
|
'accrued_interest': instance.accruedInterest,
|
|
'amount': instance.amount,
|
|
'amount_rub': instance.amountRub,
|
|
'currency': instance.currency,
|
|
'description': instance.description,
|
|
'external_flow': instance.externalFlow,
|
|
'fee': instance.fee,
|
|
'id': instance.id,
|
|
'instrument_id': instance.instrumentId,
|
|
'kind': _$EventKindEnumMap[instance.kind]!,
|
|
'price': instance.price,
|
|
'price_currency': instance.priceCurrency,
|
|
'quantity': instance.quantity,
|
|
'status': _$EventStatusEnumMap[instance.status]!,
|
|
'tax': instance.tax,
|
|
'ticker': instance.ticker,
|
|
'trade_date': instance.tradeDate.toIso8601String(),
|
|
'ts': instance.ts.toIso8601String(),
|
|
};
|
|
|
|
const _$EventKindEnumMap = {
|
|
EventKind.buy: 'buy',
|
|
EventKind.sell: 'sell',
|
|
EventKind.dividend: 'dividend',
|
|
EventKind.coupon: 'coupon',
|
|
EventKind.interest: 'interest',
|
|
EventKind.tax: 'tax',
|
|
EventKind.taxRefund: 'tax_refund',
|
|
EventKind.commission: 'commission',
|
|
EventKind.deposit: 'deposit',
|
|
EventKind.withdrawal: 'withdrawal',
|
|
EventKind.transferIn: 'transfer_in',
|
|
EventKind.transferOut: 'transfer_out',
|
|
EventKind.split: 'split',
|
|
EventKind.amortization: 'amortization',
|
|
EventKind.repayment: 'repayment',
|
|
EventKind.fxExchange: 'fx_exchange',
|
|
EventKind.other: 'other',
|
|
EventKind.unknownDefaultOpenApi: 'unknown_default_open_api',
|
|
};
|
|
|
|
const _$EventStatusEnumMap = {
|
|
EventStatus.confirmed: 'confirmed',
|
|
EventStatus.pending: 'pending',
|
|
EventStatus.shadow: 'shadow',
|
|
EventStatus.ignored: 'ignored',
|
|
EventStatus.unknownDefaultOpenApi: 'unknown_default_open_api',
|
|
};
|