// GENERATED CODE - DO NOT MODIFY BY HAND part of 'rule_create.dart'; // ************************************************************************** // CopyWithGenerator // ************************************************************************** abstract class _$RuleCreateCWProxy { RuleCreate enabled(bool? enabled); RuleCreate kind(RuleKind kind); RuleCreate matchType(RuleMatchType matchType); RuleCreate note(String? note); RuleCreate pattern(String pattern); RuleCreate priority(int? priority); RuleCreate value(String? value); /// This function **does support** nullification of nullable fields. All `null` values passed to `non-nullable` fields will be ignored. You can also use `RuleCreate(...).copyWith.fieldName(...)` to override fields one at a time with nullification support. /// /// Usage /// ```dart /// RuleCreate(...).copyWith(id: 12, name: "My name") /// ```` RuleCreate call({ bool? enabled, RuleKind kind, RuleMatchType matchType, String? note, String pattern, int? priority, String? value, }); } /// Proxy class for `copyWith` functionality. This is a callable class and can be used as follows: `instanceOfRuleCreate.copyWith(...)`. Additionally contains functions for specific fields e.g. `instanceOfRuleCreate.copyWith.fieldName(...)` class _$RuleCreateCWProxyImpl implements _$RuleCreateCWProxy { const _$RuleCreateCWProxyImpl(this._value); final RuleCreate _value; @override RuleCreate enabled(bool? enabled) => this(enabled: enabled); @override RuleCreate kind(RuleKind kind) => this(kind: kind); @override RuleCreate matchType(RuleMatchType matchType) => this(matchType: matchType); @override RuleCreate note(String? note) => this(note: note); @override RuleCreate pattern(String pattern) => this(pattern: pattern); @override RuleCreate priority(int? priority) => this(priority: priority); @override RuleCreate value(String? value) => this(value: value); @override /// This function **does support** nullification of nullable fields. All `null` values passed to `non-nullable` fields will be ignored. You can also use `RuleCreate(...).copyWith.fieldName(...)` to override fields one at a time with nullification support. /// /// Usage /// ```dart /// RuleCreate(...).copyWith(id: 12, name: "My name") /// ```` RuleCreate call({ Object? enabled = const $CopyWithPlaceholder(), Object? kind = const $CopyWithPlaceholder(), Object? matchType = const $CopyWithPlaceholder(), Object? note = const $CopyWithPlaceholder(), Object? pattern = const $CopyWithPlaceholder(), Object? priority = const $CopyWithPlaceholder(), Object? value = const $CopyWithPlaceholder(), }) { return RuleCreate( enabled: enabled == const $CopyWithPlaceholder() ? _value.enabled // ignore: cast_nullable_to_non_nullable : enabled as bool?, kind: kind == const $CopyWithPlaceholder() ? _value.kind // ignore: cast_nullable_to_non_nullable : kind as RuleKind, matchType: matchType == const $CopyWithPlaceholder() ? _value.matchType // ignore: cast_nullable_to_non_nullable : matchType as RuleMatchType, note: note == const $CopyWithPlaceholder() ? _value.note // ignore: cast_nullable_to_non_nullable : note as String?, pattern: pattern == const $CopyWithPlaceholder() ? _value.pattern // ignore: cast_nullable_to_non_nullable : pattern as String, priority: priority == const $CopyWithPlaceholder() ? _value.priority // ignore: cast_nullable_to_non_nullable : priority as int?, value: value == const $CopyWithPlaceholder() ? _value.value // ignore: cast_nullable_to_non_nullable : value as String?, ); } } extension $RuleCreateCopyWith on RuleCreate { /// Returns a callable class that can be used as follows: `instanceOfRuleCreate.copyWith(...)` or like so:`instanceOfRuleCreate.copyWith.fieldName(...)`. // ignore: library_private_types_in_public_api _$RuleCreateCWProxy get copyWith => _$RuleCreateCWProxyImpl(this); } // ************************************************************************** // JsonSerializableGenerator // ************************************************************************** RuleCreate _$RuleCreateFromJson(Map json) => $checkedCreate( 'RuleCreate', json, ($checkedConvert) { $checkKeys(json, requiredKeys: const ['kind', 'match_type', 'pattern']); final val = RuleCreate( enabled: $checkedConvert('enabled', (v) => v as bool? ?? true), kind: $checkedConvert( 'kind', (v) => $enumDecode( _$RuleKindEnumMap, v, unknownValue: RuleKind.unknownDefaultOpenApi, ), ), matchType: $checkedConvert( 'match_type', (v) => $enumDecode( _$RuleMatchTypeEnumMap, v, unknownValue: RuleMatchType.unknownDefaultOpenApi, ), ), note: $checkedConvert('note', (v) => v as String?), pattern: $checkedConvert('pattern', (v) => v as String), priority: $checkedConvert('priority', (v) => (v as num?)?.toInt() ?? 100), value: $checkedConvert('value', (v) => v as String?), ); return val; }, fieldKeyMap: const {'matchType': 'match_type'}, ); Map _$RuleCreateToJson(RuleCreate instance) => { 'enabled': ?instance.enabled, 'kind': _$RuleKindEnumMap[instance.kind]!, 'match_type': _$RuleMatchTypeEnumMap[instance.matchType]!, 'note': ?instance.note, 'pattern': instance.pattern, 'priority': ?instance.priority, 'value': ?instance.value, }; const _$RuleKindEnumMap = { RuleKind.savings: 'savings', RuleKind.oneOff: 'one_off', RuleKind.category: 'category', RuleKind.payee: 'payee', RuleKind.brokerTarget: 'broker_target', RuleKind.ignore: 'ignore', RuleKind.unknownDefaultOpenApi: 'unknown_default_open_api', }; const _$RuleMatchTypeEnumMap = { RuleMatchType.id: 'id', RuleMatchType.payee: 'payee', RuleMatchType.comment: 'comment', RuleMatchType.category: 'category', RuleMatchType.mcc: 'mcc', RuleMatchType.account: 'account', RuleMatchType.unknownDefaultOpenApi: 'unknown_default_open_api', };