// GENERATED CODE - DO NOT MODIFY BY HAND part of 'rule_patch.dart'; // ************************************************************************** // CopyWithGenerator // ************************************************************************** abstract class _$RulePatchCWProxy { RulePatch enabled(bool? enabled); RulePatch kind(RuleKind? kind); RulePatch matchType(RuleMatchType? matchType); RulePatch note(String? note); RulePatch pattern(String? pattern); RulePatch priority(int? priority); RulePatch 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 `RulePatch(...).copyWith.fieldName(...)` to override fields one at a time with nullification support. /// /// Usage /// ```dart /// RulePatch(...).copyWith(id: 12, name: "My name") /// ```` RulePatch 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: `instanceOfRulePatch.copyWith(...)`. Additionally contains functions for specific fields e.g. `instanceOfRulePatch.copyWith.fieldName(...)` class _$RulePatchCWProxyImpl implements _$RulePatchCWProxy { const _$RulePatchCWProxyImpl(this._value); final RulePatch _value; @override RulePatch enabled(bool? enabled) => this(enabled: enabled); @override RulePatch kind(RuleKind? kind) => this(kind: kind); @override RulePatch matchType(RuleMatchType? matchType) => this(matchType: matchType); @override RulePatch note(String? note) => this(note: note); @override RulePatch pattern(String? pattern) => this(pattern: pattern); @override RulePatch priority(int? priority) => this(priority: priority); @override RulePatch 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 `RulePatch(...).copyWith.fieldName(...)` to override fields one at a time with nullification support. /// /// Usage /// ```dart /// RulePatch(...).copyWith(id: 12, name: "My name") /// ```` RulePatch 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 RulePatch( 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 $RulePatchCopyWith on RulePatch { /// Returns a callable class that can be used as follows: `instanceOfRulePatch.copyWith(...)` or like so:`instanceOfRulePatch.copyWith.fieldName(...)`. // ignore: library_private_types_in_public_api _$RulePatchCWProxy get copyWith => _$RulePatchCWProxyImpl(this); } // ************************************************************************** // JsonSerializableGenerator // ************************************************************************** RulePatch _$RulePatchFromJson(Map json) => $checkedCreate('RulePatch', json, ($checkedConvert) { final val = RulePatch( enabled: $checkedConvert('enabled', (v) => v as bool?), kind: $checkedConvert( 'kind', (v) => $enumDecodeNullable( _$RuleKindEnumMap, v, unknownValue: RuleKind.unknownDefaultOpenApi, ), ), matchType: $checkedConvert( 'match_type', (v) => $enumDecodeNullable( _$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()), value: $checkedConvert('value', (v) => v as String?), ); return val; }, fieldKeyMap: const {'matchType': 'match_type'}); Map _$RulePatchToJson(RulePatch 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', };