// GENERATED CODE - DO NOT MODIFY BY HAND // ignore_for_file: unused_element, deprecated_member_use, deprecated_member_use_from_same_package, use_function_type_syntax_for_parameters, unnecessary_const, avoid_init_to_null, invalid_override_different_default_values_named, prefer_expression_function_bodies, annotate_overrides part of 'attachment_file.dart'; // ************************************************************************** // FreezedGenerator // ************************************************************************** T _$identity(T value) => value; final _privateConstructorUsedError = UnsupportedError( 'It seems like you constructed your class using `MyClass._()`. This constructor is only meant to be used by freezed and you are not supposed to need it nor use it.\nPlease check the documentation here for more informations: https://github.com/rrousselGit/freezed#custom-getters-and-methods'); UploadState _$UploadStateFromJson(Map json) { switch (json['runtimeType'] as String) { case 'preparing': return Preparing.fromJson(json); case 'inProgress': return InProgress.fromJson(json); case 'success': return Success.fromJson(json); case 'failed': return Failed.fromJson(json); default: throw FallThroughError(); } } /// @nodoc class _$UploadStateTearOff { const _$UploadStateTearOff(); Preparing preparing() { return const Preparing(); } InProgress inProgress({required int uploaded, required int total}) { return InProgress( uploaded: uploaded, total: total, ); } Success success() { return const Success(); } Failed failed({required String error}) { return Failed( error: error, ); } UploadState fromJson(Map json) { return UploadState.fromJson(json); } } /// @nodoc const $UploadState = _$UploadStateTearOff(); /// @nodoc mixin _$UploadState { @optionalTypeArgs TResult when({ required TResult Function() preparing, required TResult Function(int uploaded, int total) inProgress, required TResult Function() success, required TResult Function(String error) failed, }) => throw _privateConstructorUsedError; @optionalTypeArgs TResult maybeWhen({ TResult Function()? preparing, TResult Function(int uploaded, int total)? inProgress, TResult Function()? success, TResult Function(String error)? failed, required TResult orElse(), }) => throw _privateConstructorUsedError; @optionalTypeArgs TResult map({ required TResult Function(Preparing value) preparing, required TResult Function(InProgress value) inProgress, required TResult Function(Success value) success, required TResult Function(Failed value) failed, }) => throw _privateConstructorUsedError; @optionalTypeArgs TResult maybeMap({ TResult Function(Preparing value)? preparing, TResult Function(InProgress value)? inProgress, TResult Function(Success value)? success, TResult Function(Failed value)? failed, required TResult orElse(), }) => throw _privateConstructorUsedError; Map toJson() => throw _privateConstructorUsedError; } /// @nodoc abstract class $UploadStateCopyWith<$Res> { factory $UploadStateCopyWith( UploadState value, $Res Function(UploadState) then) = _$UploadStateCopyWithImpl<$Res>; } /// @nodoc class _$UploadStateCopyWithImpl<$Res> implements $UploadStateCopyWith<$Res> { _$UploadStateCopyWithImpl(this._value, this._then); final UploadState _value; // ignore: unused_field final $Res Function(UploadState) _then; } /// @nodoc abstract class $PreparingCopyWith<$Res> { factory $PreparingCopyWith(Preparing value, $Res Function(Preparing) then) = _$PreparingCopyWithImpl<$Res>; } /// @nodoc class _$PreparingCopyWithImpl<$Res> extends _$UploadStateCopyWithImpl<$Res> implements $PreparingCopyWith<$Res> { _$PreparingCopyWithImpl(Preparing _value, $Res Function(Preparing) _then) : super(_value, (v) => _then(v as Preparing)); @override Preparing get _value => super._value as Preparing; } /// @nodoc @JsonSerializable() class _$Preparing implements Preparing { const _$Preparing(); factory _$Preparing.fromJson(Map json) => _$_$PreparingFromJson(json); @override String toString() { return 'UploadState.preparing()'; } @override bool operator ==(dynamic other) { return identical(this, other) || (other is Preparing); } @override int get hashCode => runtimeType.hashCode; @override @optionalTypeArgs TResult when({ required TResult Function() preparing, required TResult Function(int uploaded, int total) inProgress, required TResult Function() success, required TResult Function(String error) failed, }) { return preparing(); } @override @optionalTypeArgs TResult maybeWhen({ TResult Function()? preparing, TResult Function(int uploaded, int total)? inProgress, TResult Function()? success, TResult Function(String error)? failed, required TResult orElse(), }) { if (preparing != null) { return preparing(); } return orElse(); } @override @optionalTypeArgs TResult map({ required TResult Function(Preparing value) preparing, required TResult Function(InProgress value) inProgress, required TResult Function(Success value) success, required TResult Function(Failed value) failed, }) { return preparing(this); } @override @optionalTypeArgs TResult maybeMap({ TResult Function(Preparing value)? preparing, TResult Function(InProgress value)? inProgress, TResult Function(Success value)? success, TResult Function(Failed value)? failed, required TResult orElse(), }) { if (preparing != null) { return preparing(this); } return orElse(); } @override Map toJson() { return _$_$PreparingToJson(this)..['runtimeType'] = 'preparing'; } } abstract class Preparing implements UploadState { const factory Preparing() = _$Preparing; factory Preparing.fromJson(Map json) = _$Preparing.fromJson; } /// @nodoc abstract class $InProgressCopyWith<$Res> { factory $InProgressCopyWith( InProgress value, $Res Function(InProgress) then) = _$InProgressCopyWithImpl<$Res>; $Res call({int uploaded, int total}); } /// @nodoc class _$InProgressCopyWithImpl<$Res> extends _$UploadStateCopyWithImpl<$Res> implements $InProgressCopyWith<$Res> { _$InProgressCopyWithImpl(InProgress _value, $Res Function(InProgress) _then) : super(_value, (v) => _then(v as InProgress)); @override InProgress get _value => super._value as InProgress; @override $Res call({ Object? uploaded = freezed, Object? total = freezed, }) { return _then(InProgress( uploaded: uploaded == freezed ? _value.uploaded : uploaded // ignore: cast_nullable_to_non_nullable as int, total: total == freezed ? _value.total : total // ignore: cast_nullable_to_non_nullable as int, )); } } /// @nodoc @JsonSerializable() class _$InProgress implements InProgress { const _$InProgress({required this.uploaded, required this.total}); factory _$InProgress.fromJson(Map json) => _$_$InProgressFromJson(json); @override final int uploaded; @override final int total; @override String toString() { return 'UploadState.inProgress(uploaded: $uploaded, total: $total)'; } @override bool operator ==(dynamic other) { return identical(this, other) || (other is InProgress && (identical(other.uploaded, uploaded) || const DeepCollectionEquality() .equals(other.uploaded, uploaded)) && (identical(other.total, total) || const DeepCollectionEquality().equals(other.total, total))); } @override int get hashCode => runtimeType.hashCode ^ const DeepCollectionEquality().hash(uploaded) ^ const DeepCollectionEquality().hash(total); @JsonKey(ignore: true) @override $InProgressCopyWith get copyWith => _$InProgressCopyWithImpl(this, _$identity); @override @optionalTypeArgs TResult when({ required TResult Function() preparing, required TResult Function(int uploaded, int total) inProgress, required TResult Function() success, required TResult Function(String error) failed, }) { return inProgress(uploaded, total); } @override @optionalTypeArgs TResult maybeWhen({ TResult Function()? preparing, TResult Function(int uploaded, int total)? inProgress, TResult Function()? success, TResult Function(String error)? failed, required TResult orElse(), }) { if (inProgress != null) { return inProgress(uploaded, total); } return orElse(); } @override @optionalTypeArgs TResult map({ required TResult Function(Preparing value) preparing, required TResult Function(InProgress value) inProgress, required TResult Function(Success value) success, required TResult Function(Failed value) failed, }) { return inProgress(this); } @override @optionalTypeArgs TResult maybeMap({ TResult Function(Preparing value)? preparing, TResult Function(InProgress value)? inProgress, TResult Function(Success value)? success, TResult Function(Failed value)? failed, required TResult orElse(), }) { if (inProgress != null) { return inProgress(this); } return orElse(); } @override Map toJson() { return _$_$InProgressToJson(this)..['runtimeType'] = 'inProgress'; } } abstract class InProgress implements UploadState { const factory InProgress({required int uploaded, required int total}) = _$InProgress; factory InProgress.fromJson(Map json) = _$InProgress.fromJson; int get uploaded => throw _privateConstructorUsedError; int get total => throw _privateConstructorUsedError; @JsonKey(ignore: true) $InProgressCopyWith get copyWith => throw _privateConstructorUsedError; } /// @nodoc abstract class $SuccessCopyWith<$Res> { factory $SuccessCopyWith(Success value, $Res Function(Success) then) = _$SuccessCopyWithImpl<$Res>; } /// @nodoc class _$SuccessCopyWithImpl<$Res> extends _$UploadStateCopyWithImpl<$Res> implements $SuccessCopyWith<$Res> { _$SuccessCopyWithImpl(Success _value, $Res Function(Success) _then) : super(_value, (v) => _then(v as Success)); @override Success get _value => super._value as Success; } /// @nodoc @JsonSerializable() class _$Success implements Success { const _$Success(); factory _$Success.fromJson(Map json) => _$_$SuccessFromJson(json); @override String toString() { return 'UploadState.success()'; } @override bool operator ==(dynamic other) { return identical(this, other) || (other is Success); } @override int get hashCode => runtimeType.hashCode; @override @optionalTypeArgs TResult when({ required TResult Function() preparing, required TResult Function(int uploaded, int total) inProgress, required TResult Function() success, required TResult Function(String error) failed, }) { return success(); } @override @optionalTypeArgs TResult maybeWhen({ TResult Function()? preparing, TResult Function(int uploaded, int total)? inProgress, TResult Function()? success, TResult Function(String error)? failed, required TResult orElse(), }) { if (success != null) { return success(); } return orElse(); } @override @optionalTypeArgs TResult map({ required TResult Function(Preparing value) preparing, required TResult Function(InProgress value) inProgress, required TResult Function(Success value) success, required TResult Function(Failed value) failed, }) { return success(this); } @override @optionalTypeArgs TResult maybeMap({ TResult Function(Preparing value)? preparing, TResult Function(InProgress value)? inProgress, TResult Function(Success value)? success, TResult Function(Failed value)? failed, required TResult orElse(), }) { if (success != null) { return success(this); } return orElse(); } @override Map toJson() { return _$_$SuccessToJson(this)..['runtimeType'] = 'success'; } } abstract class Success implements UploadState { const factory Success() = _$Success; factory Success.fromJson(Map json) = _$Success.fromJson; } /// @nodoc abstract class $FailedCopyWith<$Res> { factory $FailedCopyWith(Failed value, $Res Function(Failed) then) = _$FailedCopyWithImpl<$Res>; $Res call({String error}); } /// @nodoc class _$FailedCopyWithImpl<$Res> extends _$UploadStateCopyWithImpl<$Res> implements $FailedCopyWith<$Res> { _$FailedCopyWithImpl(Failed _value, $Res Function(Failed) _then) : super(_value, (v) => _then(v as Failed)); @override Failed get _value => super._value as Failed; @override $Res call({ Object? error = freezed, }) { return _then(Failed( error: error == freezed ? _value.error : error // ignore: cast_nullable_to_non_nullable as String, )); } } /// @nodoc @JsonSerializable() class _$Failed implements Failed { const _$Failed({required this.error}); factory _$Failed.fromJson(Map json) => _$_$FailedFromJson(json); @override final String error; @override String toString() { return 'UploadState.failed(error: $error)'; } @override bool operator ==(dynamic other) { return identical(this, other) || (other is Failed && (identical(other.error, error) || const DeepCollectionEquality().equals(other.error, error))); } @override int get hashCode => runtimeType.hashCode ^ const DeepCollectionEquality().hash(error); @JsonKey(ignore: true) @override $FailedCopyWith get copyWith => _$FailedCopyWithImpl(this, _$identity); @override @optionalTypeArgs TResult when({ required TResult Function() preparing, required TResult Function(int uploaded, int total) inProgress, required TResult Function() success, required TResult Function(String error) failed, }) { return failed(error); } @override @optionalTypeArgs TResult maybeWhen({ TResult Function()? preparing, TResult Function(int uploaded, int total)? inProgress, TResult Function()? success, TResult Function(String error)? failed, required TResult orElse(), }) { if (failed != null) { return failed(error); } return orElse(); } @override @optionalTypeArgs TResult map({ required TResult Function(Preparing value) preparing, required TResult Function(InProgress value) inProgress, required TResult Function(Success value) success, required TResult Function(Failed value) failed, }) { return failed(this); } @override @optionalTypeArgs TResult maybeMap({ TResult Function(Preparing value)? preparing, TResult Function(InProgress value)? inProgress, TResult Function(Success value)? success, TResult Function(Failed value)? failed, required TResult orElse(), }) { if (failed != null) { return failed(this); } return orElse(); } @override Map toJson() { return _$_$FailedToJson(this)..['runtimeType'] = 'failed'; } } abstract class Failed implements UploadState { const factory Failed({required String error}) = _$Failed; factory Failed.fromJson(Map json) = _$Failed.fromJson; String get error => throw _privateConstructorUsedError; @JsonKey(ignore: true) $FailedCopyWith get copyWith => throw _privateConstructorUsedError; }