// coverage:ignore-file
// GENERATED CODE - DO NOT MODIFY BY HAND
// ignore_for_file: type=lint
// 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, invalid_annotation_target, unnecessary_question_mark

part of 'errors.dart';

// **************************************************************************
// FreezedGenerator
// **************************************************************************

T _$identity<T>(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 information: https://github.com/rrousselGit/freezed#adding-getters-and-methods-to-our-models');

/// @nodoc
mixin _$AppError {
  String? get message => throw _privateConstructorUsedError;
  @optionalTypeArgs
  TResult when<TResult extends Object?>({
    required TResult Function(String? message) unknown,
    required TResult Function(String? message) network,
    required TResult Function(String? message) unauthorized,
    required TResult Function(String? message) forbidden,
    required TResult Function(String? message) notFound,
    required TResult Function(int? statusCode, String? message) server,
    required TResult Function(String? message) database,
    required TResult Function(String? message, Map<String, String>? fieldErrors)
        validation,
    required TResult Function(String? message) parsing,
  }) =>
      throw _privateConstructorUsedError;
  @optionalTypeArgs
  TResult? whenOrNull<TResult extends Object?>({
    TResult? Function(String? message)? unknown,
    TResult? Function(String? message)? network,
    TResult? Function(String? message)? unauthorized,
    TResult? Function(String? message)? forbidden,
    TResult? Function(String? message)? notFound,
    TResult? Function(int? statusCode, String? message)? server,
    TResult? Function(String? message)? database,
    TResult? Function(String? message, Map<String, String>? fieldErrors)?
        validation,
    TResult? Function(String? message)? parsing,
  }) =>
      throw _privateConstructorUsedError;
  @optionalTypeArgs
  TResult maybeWhen<TResult extends Object?>({
    TResult Function(String? message)? unknown,
    TResult Function(String? message)? network,
    TResult Function(String? message)? unauthorized,
    TResult Function(String? message)? forbidden,
    TResult Function(String? message)? notFound,
    TResult Function(int? statusCode, String? message)? server,
    TResult Function(String? message)? database,
    TResult Function(String? message, Map<String, String>? fieldErrors)?
        validation,
    TResult Function(String? message)? parsing,
    required TResult orElse(),
  }) =>
      throw _privateConstructorUsedError;
  @optionalTypeArgs
  TResult map<TResult extends Object?>({
    required TResult Function(UnknownError value) unknown,
    required TResult Function(NetworkError value) network,
    required TResult Function(UnauthorizedError value) unauthorized,
    required TResult Function(ForbiddenError value) forbidden,
    required TResult Function(NotFoundError value) notFound,
    required TResult Function(ServerError value) server,
    required TResult Function(DatabaseError value) database,
    required TResult Function(ValidationError value) validation,
    required TResult Function(ParsingError value) parsing,
  }) =>
      throw _privateConstructorUsedError;
  @optionalTypeArgs
  TResult? mapOrNull<TResult extends Object?>({
    TResult? Function(UnknownError value)? unknown,
    TResult? Function(NetworkError value)? network,
    TResult? Function(UnauthorizedError value)? unauthorized,
    TResult? Function(ForbiddenError value)? forbidden,
    TResult? Function(NotFoundError value)? notFound,
    TResult? Function(ServerError value)? server,
    TResult? Function(DatabaseError value)? database,
    TResult? Function(ValidationError value)? validation,
    TResult? Function(ParsingError value)? parsing,
  }) =>
      throw _privateConstructorUsedError;
  @optionalTypeArgs
  TResult maybeMap<TResult extends Object?>({
    TResult Function(UnknownError value)? unknown,
    TResult Function(NetworkError value)? network,
    TResult Function(UnauthorizedError value)? unauthorized,
    TResult Function(ForbiddenError value)? forbidden,
    TResult Function(NotFoundError value)? notFound,
    TResult Function(ServerError value)? server,
    TResult Function(DatabaseError value)? database,
    TResult Function(ValidationError value)? validation,
    TResult Function(ParsingError value)? parsing,
    required TResult orElse(),
  }) =>
      throw _privateConstructorUsedError;

  @JsonKey(ignore: true)
  $AppErrorCopyWith<AppError> get copyWith =>
      throw _privateConstructorUsedError;
}

/// @nodoc
abstract class $AppErrorCopyWith<$Res> {
  factory $AppErrorCopyWith(AppError value, $Res Function(AppError) then) =
      _$AppErrorCopyWithImpl<$Res, AppError>;
  @useResult
  $Res call({String? message});
}

/// @nodoc
class _$AppErrorCopyWithImpl<$Res, $Val extends AppError>
    implements $AppErrorCopyWith<$Res> {
  _$AppErrorCopyWithImpl(this._value, this._then);

  // ignore: unused_field
  final $Val _value;
  // ignore: unused_field
  final $Res Function($Val) _then;

  @pragma('vm:prefer-inline')
  @override
  $Res call({
    Object? message = freezed,
  }) {
    return _then(_value.copyWith(
      message: freezed == message
          ? _value.message
          : message // ignore: cast_nullable_to_non_nullable
              as String?,
    ) as $Val);
  }
}

/// @nodoc
abstract class _$$UnknownErrorImplCopyWith<$Res>
    implements $AppErrorCopyWith<$Res> {
  factory _$$UnknownErrorImplCopyWith(
          _$UnknownErrorImpl value, $Res Function(_$UnknownErrorImpl) then) =
      __$$UnknownErrorImplCopyWithImpl<$Res>;
  @override
  @useResult
  $Res call({String? message});
}

/// @nodoc
class __$$UnknownErrorImplCopyWithImpl<$Res>
    extends _$AppErrorCopyWithImpl<$Res, _$UnknownErrorImpl>
    implements _$$UnknownErrorImplCopyWith<$Res> {
  __$$UnknownErrorImplCopyWithImpl(
      _$UnknownErrorImpl _value, $Res Function(_$UnknownErrorImpl) _then)
      : super(_value, _then);

  @pragma('vm:prefer-inline')
  @override
  $Res call({
    Object? message = freezed,
  }) {
    return _then(_$UnknownErrorImpl(
      message: freezed == message
          ? _value.message
          : message // ignore: cast_nullable_to_non_nullable
              as String?,
    ));
  }
}

/// @nodoc

class _$UnknownErrorImpl implements UnknownError {
  const _$UnknownErrorImpl({this.message});

  @override
  final String? message;

  @override
  String toString() {
    return 'AppError.unknown(message: $message)';
  }

  @override
  bool operator ==(Object other) {
    return identical(this, other) ||
        (other.runtimeType == runtimeType &&
            other is _$UnknownErrorImpl &&
            (identical(other.message, message) || other.message == message));
  }

  @override
  int get hashCode => Object.hash(runtimeType, message);

  @JsonKey(ignore: true)
  @override
  @pragma('vm:prefer-inline')
  _$$UnknownErrorImplCopyWith<_$UnknownErrorImpl> get copyWith =>
      __$$UnknownErrorImplCopyWithImpl<_$UnknownErrorImpl>(this, _$identity);

  @override
  @optionalTypeArgs
  TResult when<TResult extends Object?>({
    required TResult Function(String? message) unknown,
    required TResult Function(String? message) network,
    required TResult Function(String? message) unauthorized,
    required TResult Function(String? message) forbidden,
    required TResult Function(String? message) notFound,
    required TResult Function(int? statusCode, String? message) server,
    required TResult Function(String? message) database,
    required TResult Function(String? message, Map<String, String>? fieldErrors)
        validation,
    required TResult Function(String? message) parsing,
  }) {
    return unknown(message);
  }

  @override
  @optionalTypeArgs
  TResult? whenOrNull<TResult extends Object?>({
    TResult? Function(String? message)? unknown,
    TResult? Function(String? message)? network,
    TResult? Function(String? message)? unauthorized,
    TResult? Function(String? message)? forbidden,
    TResult? Function(String? message)? notFound,
    TResult? Function(int? statusCode, String? message)? server,
    TResult? Function(String? message)? database,
    TResult? Function(String? message, Map<String, String>? fieldErrors)?
        validation,
    TResult? Function(String? message)? parsing,
  }) {
    return unknown?.call(message);
  }

  @override
  @optionalTypeArgs
  TResult maybeWhen<TResult extends Object?>({
    TResult Function(String? message)? unknown,
    TResult Function(String? message)? network,
    TResult Function(String? message)? unauthorized,
    TResult Function(String? message)? forbidden,
    TResult Function(String? message)? notFound,
    TResult Function(int? statusCode, String? message)? server,
    TResult Function(String? message)? database,
    TResult Function(String? message, Map<String, String>? fieldErrors)?
        validation,
    TResult Function(String? message)? parsing,
    required TResult orElse(),
  }) {
    if (unknown != null) {
      return unknown(message);
    }
    return orElse();
  }

  @override
  @optionalTypeArgs
  TResult map<TResult extends Object?>({
    required TResult Function(UnknownError value) unknown,
    required TResult Function(NetworkError value) network,
    required TResult Function(UnauthorizedError value) unauthorized,
    required TResult Function(ForbiddenError value) forbidden,
    required TResult Function(NotFoundError value) notFound,
    required TResult Function(ServerError value) server,
    required TResult Function(DatabaseError value) database,
    required TResult Function(ValidationError value) validation,
    required TResult Function(ParsingError value) parsing,
  }) {
    return unknown(this);
  }

  @override
  @optionalTypeArgs
  TResult? mapOrNull<TResult extends Object?>({
    TResult? Function(UnknownError value)? unknown,
    TResult? Function(NetworkError value)? network,
    TResult? Function(UnauthorizedError value)? unauthorized,
    TResult? Function(ForbiddenError value)? forbidden,
    TResult? Function(NotFoundError value)? notFound,
    TResult? Function(ServerError value)? server,
    TResult? Function(DatabaseError value)? database,
    TResult? Function(ValidationError value)? validation,
    TResult? Function(ParsingError value)? parsing,
  }) {
    return unknown?.call(this);
  }

  @override
  @optionalTypeArgs
  TResult maybeMap<TResult extends Object?>({
    TResult Function(UnknownError value)? unknown,
    TResult Function(NetworkError value)? network,
    TResult Function(UnauthorizedError value)? unauthorized,
    TResult Function(ForbiddenError value)? forbidden,
    TResult Function(NotFoundError value)? notFound,
    TResult Function(ServerError value)? server,
    TResult Function(DatabaseError value)? database,
    TResult Function(ValidationError value)? validation,
    TResult Function(ParsingError value)? parsing,
    required TResult orElse(),
  }) {
    if (unknown != null) {
      return unknown(this);
    }
    return orElse();
  }
}

abstract class UnknownError implements AppError {
  const factory UnknownError({final String? message}) = _$UnknownErrorImpl;

  @override
  String? get message;
  @override
  @JsonKey(ignore: true)
  _$$UnknownErrorImplCopyWith<_$UnknownErrorImpl> get copyWith =>
      throw _privateConstructorUsedError;
}

/// @nodoc
abstract class _$$NetworkErrorImplCopyWith<$Res>
    implements $AppErrorCopyWith<$Res> {
  factory _$$NetworkErrorImplCopyWith(
          _$NetworkErrorImpl value, $Res Function(_$NetworkErrorImpl) then) =
      __$$NetworkErrorImplCopyWithImpl<$Res>;
  @override
  @useResult
  $Res call({String? message});
}

/// @nodoc
class __$$NetworkErrorImplCopyWithImpl<$Res>
    extends _$AppErrorCopyWithImpl<$Res, _$NetworkErrorImpl>
    implements _$$NetworkErrorImplCopyWith<$Res> {
  __$$NetworkErrorImplCopyWithImpl(
      _$NetworkErrorImpl _value, $Res Function(_$NetworkErrorImpl) _then)
      : super(_value, _then);

  @pragma('vm:prefer-inline')
  @override
  $Res call({
    Object? message = freezed,
  }) {
    return _then(_$NetworkErrorImpl(
      message: freezed == message
          ? _value.message
          : message // ignore: cast_nullable_to_non_nullable
              as String?,
    ));
  }
}

/// @nodoc

class _$NetworkErrorImpl implements NetworkError {
  const _$NetworkErrorImpl({this.message});

  @override
  final String? message;

  @override
  String toString() {
    return 'AppError.network(message: $message)';
  }

  @override
  bool operator ==(Object other) {
    return identical(this, other) ||
        (other.runtimeType == runtimeType &&
            other is _$NetworkErrorImpl &&
            (identical(other.message, message) || other.message == message));
  }

  @override
  int get hashCode => Object.hash(runtimeType, message);

  @JsonKey(ignore: true)
  @override
  @pragma('vm:prefer-inline')
  _$$NetworkErrorImplCopyWith<_$NetworkErrorImpl> get copyWith =>
      __$$NetworkErrorImplCopyWithImpl<_$NetworkErrorImpl>(this, _$identity);

  @override
  @optionalTypeArgs
  TResult when<TResult extends Object?>({
    required TResult Function(String? message) unknown,
    required TResult Function(String? message) network,
    required TResult Function(String? message) unauthorized,
    required TResult Function(String? message) forbidden,
    required TResult Function(String? message) notFound,
    required TResult Function(int? statusCode, String? message) server,
    required TResult Function(String? message) database,
    required TResult Function(String? message, Map<String, String>? fieldErrors)
        validation,
    required TResult Function(String? message) parsing,
  }) {
    return network(message);
  }

  @override
  @optionalTypeArgs
  TResult? whenOrNull<TResult extends Object?>({
    TResult? Function(String? message)? unknown,
    TResult? Function(String? message)? network,
    TResult? Function(String? message)? unauthorized,
    TResult? Function(String? message)? forbidden,
    TResult? Function(String? message)? notFound,
    TResult? Function(int? statusCode, String? message)? server,
    TResult? Function(String? message)? database,
    TResult? Function(String? message, Map<String, String>? fieldErrors)?
        validation,
    TResult? Function(String? message)? parsing,
  }) {
    return network?.call(message);
  }

  @override
  @optionalTypeArgs
  TResult maybeWhen<TResult extends Object?>({
    TResult Function(String? message)? unknown,
    TResult Function(String? message)? network,
    TResult Function(String? message)? unauthorized,
    TResult Function(String? message)? forbidden,
    TResult Function(String? message)? notFound,
    TResult Function(int? statusCode, String? message)? server,
    TResult Function(String? message)? database,
    TResult Function(String? message, Map<String, String>? fieldErrors)?
        validation,
    TResult Function(String? message)? parsing,
    required TResult orElse(),
  }) {
    if (network != null) {
      return network(message);
    }
    return orElse();
  }

  @override
  @optionalTypeArgs
  TResult map<TResult extends Object?>({
    required TResult Function(UnknownError value) unknown,
    required TResult Function(NetworkError value) network,
    required TResult Function(UnauthorizedError value) unauthorized,
    required TResult Function(ForbiddenError value) forbidden,
    required TResult Function(NotFoundError value) notFound,
    required TResult Function(ServerError value) server,
    required TResult Function(DatabaseError value) database,
    required TResult Function(ValidationError value) validation,
    required TResult Function(ParsingError value) parsing,
  }) {
    return network(this);
  }

  @override
  @optionalTypeArgs
  TResult? mapOrNull<TResult extends Object?>({
    TResult? Function(UnknownError value)? unknown,
    TResult? Function(NetworkError value)? network,
    TResult? Function(UnauthorizedError value)? unauthorized,
    TResult? Function(ForbiddenError value)? forbidden,
    TResult? Function(NotFoundError value)? notFound,
    TResult? Function(ServerError value)? server,
    TResult? Function(DatabaseError value)? database,
    TResult? Function(ValidationError value)? validation,
    TResult? Function(ParsingError value)? parsing,
  }) {
    return network?.call(this);
  }

  @override
  @optionalTypeArgs
  TResult maybeMap<TResult extends Object?>({
    TResult Function(UnknownError value)? unknown,
    TResult Function(NetworkError value)? network,
    TResult Function(UnauthorizedError value)? unauthorized,
    TResult Function(ForbiddenError value)? forbidden,
    TResult Function(NotFoundError value)? notFound,
    TResult Function(ServerError value)? server,
    TResult Function(DatabaseError value)? database,
    TResult Function(ValidationError value)? validation,
    TResult Function(ParsingError value)? parsing,
    required TResult orElse(),
  }) {
    if (network != null) {
      return network(this);
    }
    return orElse();
  }
}

abstract class NetworkError implements AppError {
  const factory NetworkError({final String? message}) = _$NetworkErrorImpl;

  @override
  String? get message;
  @override
  @JsonKey(ignore: true)
  _$$NetworkErrorImplCopyWith<_$NetworkErrorImpl> get copyWith =>
      throw _privateConstructorUsedError;
}

/// @nodoc
abstract class _$$UnauthorizedErrorImplCopyWith<$Res>
    implements $AppErrorCopyWith<$Res> {
  factory _$$UnauthorizedErrorImplCopyWith(_$UnauthorizedErrorImpl value,
          $Res Function(_$UnauthorizedErrorImpl) then) =
      __$$UnauthorizedErrorImplCopyWithImpl<$Res>;
  @override
  @useResult
  $Res call({String? message});
}

/// @nodoc
class __$$UnauthorizedErrorImplCopyWithImpl<$Res>
    extends _$AppErrorCopyWithImpl<$Res, _$UnauthorizedErrorImpl>
    implements _$$UnauthorizedErrorImplCopyWith<$Res> {
  __$$UnauthorizedErrorImplCopyWithImpl(_$UnauthorizedErrorImpl _value,
      $Res Function(_$UnauthorizedErrorImpl) _then)
      : super(_value, _then);

  @pragma('vm:prefer-inline')
  @override
  $Res call({
    Object? message = freezed,
  }) {
    return _then(_$UnauthorizedErrorImpl(
      message: freezed == message
          ? _value.message
          : message // ignore: cast_nullable_to_non_nullable
              as String?,
    ));
  }
}

/// @nodoc

class _$UnauthorizedErrorImpl implements UnauthorizedError {
  const _$UnauthorizedErrorImpl({this.message});

  @override
  final String? message;

  @override
  String toString() {
    return 'AppError.unauthorized(message: $message)';
  }

  @override
  bool operator ==(Object other) {
    return identical(this, other) ||
        (other.runtimeType == runtimeType &&
            other is _$UnauthorizedErrorImpl &&
            (identical(other.message, message) || other.message == message));
  }

  @override
  int get hashCode => Object.hash(runtimeType, message);

  @JsonKey(ignore: true)
  @override
  @pragma('vm:prefer-inline')
  _$$UnauthorizedErrorImplCopyWith<_$UnauthorizedErrorImpl> get copyWith =>
      __$$UnauthorizedErrorImplCopyWithImpl<_$UnauthorizedErrorImpl>(
          this, _$identity);

  @override
  @optionalTypeArgs
  TResult when<TResult extends Object?>({
    required TResult Function(String? message) unknown,
    required TResult Function(String? message) network,
    required TResult Function(String? message) unauthorized,
    required TResult Function(String? message) forbidden,
    required TResult Function(String? message) notFound,
    required TResult Function(int? statusCode, String? message) server,
    required TResult Function(String? message) database,
    required TResult Function(String? message, Map<String, String>? fieldErrors)
        validation,
    required TResult Function(String? message) parsing,
  }) {
    return unauthorized(message);
  }

  @override
  @optionalTypeArgs
  TResult? whenOrNull<TResult extends Object?>({
    TResult? Function(String? message)? unknown,
    TResult? Function(String? message)? network,
    TResult? Function(String? message)? unauthorized,
    TResult? Function(String? message)? forbidden,
    TResult? Function(String? message)? notFound,
    TResult? Function(int? statusCode, String? message)? server,
    TResult? Function(String? message)? database,
    TResult? Function(String? message, Map<String, String>? fieldErrors)?
        validation,
    TResult? Function(String? message)? parsing,
  }) {
    return unauthorized?.call(message);
  }

  @override
  @optionalTypeArgs
  TResult maybeWhen<TResult extends Object?>({
    TResult Function(String? message)? unknown,
    TResult Function(String? message)? network,
    TResult Function(String? message)? unauthorized,
    TResult Function(String? message)? forbidden,
    TResult Function(String? message)? notFound,
    TResult Function(int? statusCode, String? message)? server,
    TResult Function(String? message)? database,
    TResult Function(String? message, Map<String, String>? fieldErrors)?
        validation,
    TResult Function(String? message)? parsing,
    required TResult orElse(),
  }) {
    if (unauthorized != null) {
      return unauthorized(message);
    }
    return orElse();
  }

  @override
  @optionalTypeArgs
  TResult map<TResult extends Object?>({
    required TResult Function(UnknownError value) unknown,
    required TResult Function(NetworkError value) network,
    required TResult Function(UnauthorizedError value) unauthorized,
    required TResult Function(ForbiddenError value) forbidden,
    required TResult Function(NotFoundError value) notFound,
    required TResult Function(ServerError value) server,
    required TResult Function(DatabaseError value) database,
    required TResult Function(ValidationError value) validation,
    required TResult Function(ParsingError value) parsing,
  }) {
    return unauthorized(this);
  }

  @override
  @optionalTypeArgs
  TResult? mapOrNull<TResult extends Object?>({
    TResult? Function(UnknownError value)? unknown,
    TResult? Function(NetworkError value)? network,
    TResult? Function(UnauthorizedError value)? unauthorized,
    TResult? Function(ForbiddenError value)? forbidden,
    TResult? Function(NotFoundError value)? notFound,
    TResult? Function(ServerError value)? server,
    TResult? Function(DatabaseError value)? database,
    TResult? Function(ValidationError value)? validation,
    TResult? Function(ParsingError value)? parsing,
  }) {
    return unauthorized?.call(this);
  }

  @override
  @optionalTypeArgs
  TResult maybeMap<TResult extends Object?>({
    TResult Function(UnknownError value)? unknown,
    TResult Function(NetworkError value)? network,
    TResult Function(UnauthorizedError value)? unauthorized,
    TResult Function(ForbiddenError value)? forbidden,
    TResult Function(NotFoundError value)? notFound,
    TResult Function(ServerError value)? server,
    TResult Function(DatabaseError value)? database,
    TResult Function(ValidationError value)? validation,
    TResult Function(ParsingError value)? parsing,
    required TResult orElse(),
  }) {
    if (unauthorized != null) {
      return unauthorized(this);
    }
    return orElse();
  }
}

abstract class UnauthorizedError implements AppError {
  const factory UnauthorizedError({final String? message}) =
      _$UnauthorizedErrorImpl;

  @override
  String? get message;
  @override
  @JsonKey(ignore: true)
  _$$UnauthorizedErrorImplCopyWith<_$UnauthorizedErrorImpl> get copyWith =>
      throw _privateConstructorUsedError;
}

/// @nodoc
abstract class _$$ForbiddenErrorImplCopyWith<$Res>
    implements $AppErrorCopyWith<$Res> {
  factory _$$ForbiddenErrorImplCopyWith(_$ForbiddenErrorImpl value,
          $Res Function(_$ForbiddenErrorImpl) then) =
      __$$ForbiddenErrorImplCopyWithImpl<$Res>;
  @override
  @useResult
  $Res call({String? message});
}

/// @nodoc
class __$$ForbiddenErrorImplCopyWithImpl<$Res>
    extends _$AppErrorCopyWithImpl<$Res, _$ForbiddenErrorImpl>
    implements _$$ForbiddenErrorImplCopyWith<$Res> {
  __$$ForbiddenErrorImplCopyWithImpl(
      _$ForbiddenErrorImpl _value, $Res Function(_$ForbiddenErrorImpl) _then)
      : super(_value, _then);

  @pragma('vm:prefer-inline')
  @override
  $Res call({
    Object? message = freezed,
  }) {
    return _then(_$ForbiddenErrorImpl(
      message: freezed == message
          ? _value.message
          : message // ignore: cast_nullable_to_non_nullable
              as String?,
    ));
  }
}

/// @nodoc

class _$ForbiddenErrorImpl implements ForbiddenError {
  const _$ForbiddenErrorImpl({this.message});

  @override
  final String? message;

  @override
  String toString() {
    return 'AppError.forbidden(message: $message)';
  }

  @override
  bool operator ==(Object other) {
    return identical(this, other) ||
        (other.runtimeType == runtimeType &&
            other is _$ForbiddenErrorImpl &&
            (identical(other.message, message) || other.message == message));
  }

  @override
  int get hashCode => Object.hash(runtimeType, message);

  @JsonKey(ignore: true)
  @override
  @pragma('vm:prefer-inline')
  _$$ForbiddenErrorImplCopyWith<_$ForbiddenErrorImpl> get copyWith =>
      __$$ForbiddenErrorImplCopyWithImpl<_$ForbiddenErrorImpl>(
          this, _$identity);

  @override
  @optionalTypeArgs
  TResult when<TResult extends Object?>({
    required TResult Function(String? message) unknown,
    required TResult Function(String? message) network,
    required TResult Function(String? message) unauthorized,
    required TResult Function(String? message) forbidden,
    required TResult Function(String? message) notFound,
    required TResult Function(int? statusCode, String? message) server,
    required TResult Function(String? message) database,
    required TResult Function(String? message, Map<String, String>? fieldErrors)
        validation,
    required TResult Function(String? message) parsing,
  }) {
    return forbidden(message);
  }

  @override
  @optionalTypeArgs
  TResult? whenOrNull<TResult extends Object?>({
    TResult? Function(String? message)? unknown,
    TResult? Function(String? message)? network,
    TResult? Function(String? message)? unauthorized,
    TResult? Function(String? message)? forbidden,
    TResult? Function(String? message)? notFound,
    TResult? Function(int? statusCode, String? message)? server,
    TResult? Function(String? message)? database,
    TResult? Function(String? message, Map<String, String>? fieldErrors)?
        validation,
    TResult? Function(String? message)? parsing,
  }) {
    return forbidden?.call(message);
  }

  @override
  @optionalTypeArgs
  TResult maybeWhen<TResult extends Object?>({
    TResult Function(String? message)? unknown,
    TResult Function(String? message)? network,
    TResult Function(String? message)? unauthorized,
    TResult Function(String? message)? forbidden,
    TResult Function(String? message)? notFound,
    TResult Function(int? statusCode, String? message)? server,
    TResult Function(String? message)? database,
    TResult Function(String? message, Map<String, String>? fieldErrors)?
        validation,
    TResult Function(String? message)? parsing,
    required TResult orElse(),
  }) {
    if (forbidden != null) {
      return forbidden(message);
    }
    return orElse();
  }

  @override
  @optionalTypeArgs
  TResult map<TResult extends Object?>({
    required TResult Function(UnknownError value) unknown,
    required TResult Function(NetworkError value) network,
    required TResult Function(UnauthorizedError value) unauthorized,
    required TResult Function(ForbiddenError value) forbidden,
    required TResult Function(NotFoundError value) notFound,
    required TResult Function(ServerError value) server,
    required TResult Function(DatabaseError value) database,
    required TResult Function(ValidationError value) validation,
    required TResult Function(ParsingError value) parsing,
  }) {
    return forbidden(this);
  }

  @override
  @optionalTypeArgs
  TResult? mapOrNull<TResult extends Object?>({
    TResult? Function(UnknownError value)? unknown,
    TResult? Function(NetworkError value)? network,
    TResult? Function(UnauthorizedError value)? unauthorized,
    TResult? Function(ForbiddenError value)? forbidden,
    TResult? Function(NotFoundError value)? notFound,
    TResult? Function(ServerError value)? server,
    TResult? Function(DatabaseError value)? database,
    TResult? Function(ValidationError value)? validation,
    TResult? Function(ParsingError value)? parsing,
  }) {
    return forbidden?.call(this);
  }

  @override
  @optionalTypeArgs
  TResult maybeMap<TResult extends Object?>({
    TResult Function(UnknownError value)? unknown,
    TResult Function(NetworkError value)? network,
    TResult Function(UnauthorizedError value)? unauthorized,
    TResult Function(ForbiddenError value)? forbidden,
    TResult Function(NotFoundError value)? notFound,
    TResult Function(ServerError value)? server,
    TResult Function(DatabaseError value)? database,
    TResult Function(ValidationError value)? validation,
    TResult Function(ParsingError value)? parsing,
    required TResult orElse(),
  }) {
    if (forbidden != null) {
      return forbidden(this);
    }
    return orElse();
  }
}

abstract class ForbiddenError implements AppError {
  const factory ForbiddenError({final String? message}) = _$ForbiddenErrorImpl;

  @override
  String? get message;
  @override
  @JsonKey(ignore: true)
  _$$ForbiddenErrorImplCopyWith<_$ForbiddenErrorImpl> get copyWith =>
      throw _privateConstructorUsedError;
}

/// @nodoc
abstract class _$$NotFoundErrorImplCopyWith<$Res>
    implements $AppErrorCopyWith<$Res> {
  factory _$$NotFoundErrorImplCopyWith(
          _$NotFoundErrorImpl value, $Res Function(_$NotFoundErrorImpl) then) =
      __$$NotFoundErrorImplCopyWithImpl<$Res>;
  @override
  @useResult
  $Res call({String? message});
}

/// @nodoc
class __$$NotFoundErrorImplCopyWithImpl<$Res>
    extends _$AppErrorCopyWithImpl<$Res, _$NotFoundErrorImpl>
    implements _$$NotFoundErrorImplCopyWith<$Res> {
  __$$NotFoundErrorImplCopyWithImpl(
      _$NotFoundErrorImpl _value, $Res Function(_$NotFoundErrorImpl) _then)
      : super(_value, _then);

  @pragma('vm:prefer-inline')
  @override
  $Res call({
    Object? message = freezed,
  }) {
    return _then(_$NotFoundErrorImpl(
      message: freezed == message
          ? _value.message
          : message // ignore: cast_nullable_to_non_nullable
              as String?,
    ));
  }
}

/// @nodoc

class _$NotFoundErrorImpl implements NotFoundError {
  const _$NotFoundErrorImpl({this.message});

  @override
  final String? message;

  @override
  String toString() {
    return 'AppError.notFound(message: $message)';
  }

  @override
  bool operator ==(Object other) {
    return identical(this, other) ||
        (other.runtimeType == runtimeType &&
            other is _$NotFoundErrorImpl &&
            (identical(other.message, message) || other.message == message));
  }

  @override
  int get hashCode => Object.hash(runtimeType, message);

  @JsonKey(ignore: true)
  @override
  @pragma('vm:prefer-inline')
  _$$NotFoundErrorImplCopyWith<_$NotFoundErrorImpl> get copyWith =>
      __$$NotFoundErrorImplCopyWithImpl<_$NotFoundErrorImpl>(this, _$identity);

  @override
  @optionalTypeArgs
  TResult when<TResult extends Object?>({
    required TResult Function(String? message) unknown,
    required TResult Function(String? message) network,
    required TResult Function(String? message) unauthorized,
    required TResult Function(String? message) forbidden,
    required TResult Function(String? message) notFound,
    required TResult Function(int? statusCode, String? message) server,
    required TResult Function(String? message) database,
    required TResult Function(String? message, Map<String, String>? fieldErrors)
        validation,
    required TResult Function(String? message) parsing,
  }) {
    return notFound(message);
  }

  @override
  @optionalTypeArgs
  TResult? whenOrNull<TResult extends Object?>({
    TResult? Function(String? message)? unknown,
    TResult? Function(String? message)? network,
    TResult? Function(String? message)? unauthorized,
    TResult? Function(String? message)? forbidden,
    TResult? Function(String? message)? notFound,
    TResult? Function(int? statusCode, String? message)? server,
    TResult? Function(String? message)? database,
    TResult? Function(String? message, Map<String, String>? fieldErrors)?
        validation,
    TResult? Function(String? message)? parsing,
  }) {
    return notFound?.call(message);
  }

  @override
  @optionalTypeArgs
  TResult maybeWhen<TResult extends Object?>({
    TResult Function(String? message)? unknown,
    TResult Function(String? message)? network,
    TResult Function(String? message)? unauthorized,
    TResult Function(String? message)? forbidden,
    TResult Function(String? message)? notFound,
    TResult Function(int? statusCode, String? message)? server,
    TResult Function(String? message)? database,
    TResult Function(String? message, Map<String, String>? fieldErrors)?
        validation,
    TResult Function(String? message)? parsing,
    required TResult orElse(),
  }) {
    if (notFound != null) {
      return notFound(message);
    }
    return orElse();
  }

  @override
  @optionalTypeArgs
  TResult map<TResult extends Object?>({
    required TResult Function(UnknownError value) unknown,
    required TResult Function(NetworkError value) network,
    required TResult Function(UnauthorizedError value) unauthorized,
    required TResult Function(ForbiddenError value) forbidden,
    required TResult Function(NotFoundError value) notFound,
    required TResult Function(ServerError value) server,
    required TResult Function(DatabaseError value) database,
    required TResult Function(ValidationError value) validation,
    required TResult Function(ParsingError value) parsing,
  }) {
    return notFound(this);
  }

  @override
  @optionalTypeArgs
  TResult? mapOrNull<TResult extends Object?>({
    TResult? Function(UnknownError value)? unknown,
    TResult? Function(NetworkError value)? network,
    TResult? Function(UnauthorizedError value)? unauthorized,
    TResult? Function(ForbiddenError value)? forbidden,
    TResult? Function(NotFoundError value)? notFound,
    TResult? Function(ServerError value)? server,
    TResult? Function(DatabaseError value)? database,
    TResult? Function(ValidationError value)? validation,
    TResult? Function(ParsingError value)? parsing,
  }) {
    return notFound?.call(this);
  }

  @override
  @optionalTypeArgs
  TResult maybeMap<TResult extends Object?>({
    TResult Function(UnknownError value)? unknown,
    TResult Function(NetworkError value)? network,
    TResult Function(UnauthorizedError value)? unauthorized,
    TResult Function(ForbiddenError value)? forbidden,
    TResult Function(NotFoundError value)? notFound,
    TResult Function(ServerError value)? server,
    TResult Function(DatabaseError value)? database,
    TResult Function(ValidationError value)? validation,
    TResult Function(ParsingError value)? parsing,
    required TResult orElse(),
  }) {
    if (notFound != null) {
      return notFound(this);
    }
    return orElse();
  }
}

abstract class NotFoundError implements AppError {
  const factory NotFoundError({final String? message}) = _$NotFoundErrorImpl;

  @override
  String? get message;
  @override
  @JsonKey(ignore: true)
  _$$NotFoundErrorImplCopyWith<_$NotFoundErrorImpl> get copyWith =>
      throw _privateConstructorUsedError;
}

/// @nodoc
abstract class _$$ServerErrorImplCopyWith<$Res>
    implements $AppErrorCopyWith<$Res> {
  factory _$$ServerErrorImplCopyWith(
          _$ServerErrorImpl value, $Res Function(_$ServerErrorImpl) then) =
      __$$ServerErrorImplCopyWithImpl<$Res>;
  @override
  @useResult
  $Res call({int? statusCode, String? message});
}

/// @nodoc
class __$$ServerErrorImplCopyWithImpl<$Res>
    extends _$AppErrorCopyWithImpl<$Res, _$ServerErrorImpl>
    implements _$$ServerErrorImplCopyWith<$Res> {
  __$$ServerErrorImplCopyWithImpl(
      _$ServerErrorImpl _value, $Res Function(_$ServerErrorImpl) _then)
      : super(_value, _then);

  @pragma('vm:prefer-inline')
  @override
  $Res call({
    Object? statusCode = freezed,
    Object? message = freezed,
  }) {
    return _then(_$ServerErrorImpl(
      statusCode: freezed == statusCode
          ? _value.statusCode
          : statusCode // ignore: cast_nullable_to_non_nullable
              as int?,
      message: freezed == message
          ? _value.message
          : message // ignore: cast_nullable_to_non_nullable
              as String?,
    ));
  }
}

/// @nodoc

class _$ServerErrorImpl implements ServerError {
  const _$ServerErrorImpl({this.statusCode, this.message});

  @override
  final int? statusCode;
  @override
  final String? message;

  @override
  String toString() {
    return 'AppError.server(statusCode: $statusCode, message: $message)';
  }

  @override
  bool operator ==(Object other) {
    return identical(this, other) ||
        (other.runtimeType == runtimeType &&
            other is _$ServerErrorImpl &&
            (identical(other.statusCode, statusCode) ||
                other.statusCode == statusCode) &&
            (identical(other.message, message) || other.message == message));
  }

  @override
  int get hashCode => Object.hash(runtimeType, statusCode, message);

  @JsonKey(ignore: true)
  @override
  @pragma('vm:prefer-inline')
  _$$ServerErrorImplCopyWith<_$ServerErrorImpl> get copyWith =>
      __$$ServerErrorImplCopyWithImpl<_$ServerErrorImpl>(this, _$identity);

  @override
  @optionalTypeArgs
  TResult when<TResult extends Object?>({
    required TResult Function(String? message) unknown,
    required TResult Function(String? message) network,
    required TResult Function(String? message) unauthorized,
    required TResult Function(String? message) forbidden,
    required TResult Function(String? message) notFound,
    required TResult Function(int? statusCode, String? message) server,
    required TResult Function(String? message) database,
    required TResult Function(String? message, Map<String, String>? fieldErrors)
        validation,
    required TResult Function(String? message) parsing,
  }) {
    return server(statusCode, message);
  }

  @override
  @optionalTypeArgs
  TResult? whenOrNull<TResult extends Object?>({
    TResult? Function(String? message)? unknown,
    TResult? Function(String? message)? network,
    TResult? Function(String? message)? unauthorized,
    TResult? Function(String? message)? forbidden,
    TResult? Function(String? message)? notFound,
    TResult? Function(int? statusCode, String? message)? server,
    TResult? Function(String? message)? database,
    TResult? Function(String? message, Map<String, String>? fieldErrors)?
        validation,
    TResult? Function(String? message)? parsing,
  }) {
    return server?.call(statusCode, message);
  }

  @override
  @optionalTypeArgs
  TResult maybeWhen<TResult extends Object?>({
    TResult Function(String? message)? unknown,
    TResult Function(String? message)? network,
    TResult Function(String? message)? unauthorized,
    TResult Function(String? message)? forbidden,
    TResult Function(String? message)? notFound,
    TResult Function(int? statusCode, String? message)? server,
    TResult Function(String? message)? database,
    TResult Function(String? message, Map<String, String>? fieldErrors)?
        validation,
    TResult Function(String? message)? parsing,
    required TResult orElse(),
  }) {
    if (server != null) {
      return server(statusCode, message);
    }
    return orElse();
  }

  @override
  @optionalTypeArgs
  TResult map<TResult extends Object?>({
    required TResult Function(UnknownError value) unknown,
    required TResult Function(NetworkError value) network,
    required TResult Function(UnauthorizedError value) unauthorized,
    required TResult Function(ForbiddenError value) forbidden,
    required TResult Function(NotFoundError value) notFound,
    required TResult Function(ServerError value) server,
    required TResult Function(DatabaseError value) database,
    required TResult Function(ValidationError value) validation,
    required TResult Function(ParsingError value) parsing,
  }) {
    return server(this);
  }

  @override
  @optionalTypeArgs
  TResult? mapOrNull<TResult extends Object?>({
    TResult? Function(UnknownError value)? unknown,
    TResult? Function(NetworkError value)? network,
    TResult? Function(UnauthorizedError value)? unauthorized,
    TResult? Function(ForbiddenError value)? forbidden,
    TResult? Function(NotFoundError value)? notFound,
    TResult? Function(ServerError value)? server,
    TResult? Function(DatabaseError value)? database,
    TResult? Function(ValidationError value)? validation,
    TResult? Function(ParsingError value)? parsing,
  }) {
    return server?.call(this);
  }

  @override
  @optionalTypeArgs
  TResult maybeMap<TResult extends Object?>({
    TResult Function(UnknownError value)? unknown,
    TResult Function(NetworkError value)? network,
    TResult Function(UnauthorizedError value)? unauthorized,
    TResult Function(ForbiddenError value)? forbidden,
    TResult Function(NotFoundError value)? notFound,
    TResult Function(ServerError value)? server,
    TResult Function(DatabaseError value)? database,
    TResult Function(ValidationError value)? validation,
    TResult Function(ParsingError value)? parsing,
    required TResult orElse(),
  }) {
    if (server != null) {
      return server(this);
    }
    return orElse();
  }
}

abstract class ServerError implements AppError {
  const factory ServerError({final int? statusCode, final String? message}) =
      _$ServerErrorImpl;

  int? get statusCode;
  @override
  String? get message;
  @override
  @JsonKey(ignore: true)
  _$$ServerErrorImplCopyWith<_$ServerErrorImpl> get copyWith =>
      throw _privateConstructorUsedError;
}

/// @nodoc
abstract class _$$DatabaseErrorImplCopyWith<$Res>
    implements $AppErrorCopyWith<$Res> {
  factory _$$DatabaseErrorImplCopyWith(
          _$DatabaseErrorImpl value, $Res Function(_$DatabaseErrorImpl) then) =
      __$$DatabaseErrorImplCopyWithImpl<$Res>;
  @override
  @useResult
  $Res call({String? message});
}

/// @nodoc
class __$$DatabaseErrorImplCopyWithImpl<$Res>
    extends _$AppErrorCopyWithImpl<$Res, _$DatabaseErrorImpl>
    implements _$$DatabaseErrorImplCopyWith<$Res> {
  __$$DatabaseErrorImplCopyWithImpl(
      _$DatabaseErrorImpl _value, $Res Function(_$DatabaseErrorImpl) _then)
      : super(_value, _then);

  @pragma('vm:prefer-inline')
  @override
  $Res call({
    Object? message = freezed,
  }) {
    return _then(_$DatabaseErrorImpl(
      message: freezed == message
          ? _value.message
          : message // ignore: cast_nullable_to_non_nullable
              as String?,
    ));
  }
}

/// @nodoc

class _$DatabaseErrorImpl implements DatabaseError {
  const _$DatabaseErrorImpl({this.message});

  @override
  final String? message;

  @override
  String toString() {
    return 'AppError.database(message: $message)';
  }

  @override
  bool operator ==(Object other) {
    return identical(this, other) ||
        (other.runtimeType == runtimeType &&
            other is _$DatabaseErrorImpl &&
            (identical(other.message, message) || other.message == message));
  }

  @override
  int get hashCode => Object.hash(runtimeType, message);

  @JsonKey(ignore: true)
  @override
  @pragma('vm:prefer-inline')
  _$$DatabaseErrorImplCopyWith<_$DatabaseErrorImpl> get copyWith =>
      __$$DatabaseErrorImplCopyWithImpl<_$DatabaseErrorImpl>(this, _$identity);

  @override
  @optionalTypeArgs
  TResult when<TResult extends Object?>({
    required TResult Function(String? message) unknown,
    required TResult Function(String? message) network,
    required TResult Function(String? message) unauthorized,
    required TResult Function(String? message) forbidden,
    required TResult Function(String? message) notFound,
    required TResult Function(int? statusCode, String? message) server,
    required TResult Function(String? message) database,
    required TResult Function(String? message, Map<String, String>? fieldErrors)
        validation,
    required TResult Function(String? message) parsing,
  }) {
    return database(message);
  }

  @override
  @optionalTypeArgs
  TResult? whenOrNull<TResult extends Object?>({
    TResult? Function(String? message)? unknown,
    TResult? Function(String? message)? network,
    TResult? Function(String? message)? unauthorized,
    TResult? Function(String? message)? forbidden,
    TResult? Function(String? message)? notFound,
    TResult? Function(int? statusCode, String? message)? server,
    TResult? Function(String? message)? database,
    TResult? Function(String? message, Map<String, String>? fieldErrors)?
        validation,
    TResult? Function(String? message)? parsing,
  }) {
    return database?.call(message);
  }

  @override
  @optionalTypeArgs
  TResult maybeWhen<TResult extends Object?>({
    TResult Function(String? message)? unknown,
    TResult Function(String? message)? network,
    TResult Function(String? message)? unauthorized,
    TResult Function(String? message)? forbidden,
    TResult Function(String? message)? notFound,
    TResult Function(int? statusCode, String? message)? server,
    TResult Function(String? message)? database,
    TResult Function(String? message, Map<String, String>? fieldErrors)?
        validation,
    TResult Function(String? message)? parsing,
    required TResult orElse(),
  }) {
    if (database != null) {
      return database(message);
    }
    return orElse();
  }

  @override
  @optionalTypeArgs
  TResult map<TResult extends Object?>({
    required TResult Function(UnknownError value) unknown,
    required TResult Function(NetworkError value) network,
    required TResult Function(UnauthorizedError value) unauthorized,
    required TResult Function(ForbiddenError value) forbidden,
    required TResult Function(NotFoundError value) notFound,
    required TResult Function(ServerError value) server,
    required TResult Function(DatabaseError value) database,
    required TResult Function(ValidationError value) validation,
    required TResult Function(ParsingError value) parsing,
  }) {
    return database(this);
  }

  @override
  @optionalTypeArgs
  TResult? mapOrNull<TResult extends Object?>({
    TResult? Function(UnknownError value)? unknown,
    TResult? Function(NetworkError value)? network,
    TResult? Function(UnauthorizedError value)? unauthorized,
    TResult? Function(ForbiddenError value)? forbidden,
    TResult? Function(NotFoundError value)? notFound,
    TResult? Function(ServerError value)? server,
    TResult? Function(DatabaseError value)? database,
    TResult? Function(ValidationError value)? validation,
    TResult? Function(ParsingError value)? parsing,
  }) {
    return database?.call(this);
  }

  @override
  @optionalTypeArgs
  TResult maybeMap<TResult extends Object?>({
    TResult Function(UnknownError value)? unknown,
    TResult Function(NetworkError value)? network,
    TResult Function(UnauthorizedError value)? unauthorized,
    TResult Function(ForbiddenError value)? forbidden,
    TResult Function(NotFoundError value)? notFound,
    TResult Function(ServerError value)? server,
    TResult Function(DatabaseError value)? database,
    TResult Function(ValidationError value)? validation,
    TResult Function(ParsingError value)? parsing,
    required TResult orElse(),
  }) {
    if (database != null) {
      return database(this);
    }
    return orElse();
  }
}

abstract class DatabaseError implements AppError {
  const factory DatabaseError({final String? message}) = _$DatabaseErrorImpl;

  @override
  String? get message;
  @override
  @JsonKey(ignore: true)
  _$$DatabaseErrorImplCopyWith<_$DatabaseErrorImpl> get copyWith =>
      throw _privateConstructorUsedError;
}

/// @nodoc
abstract class _$$ValidationErrorImplCopyWith<$Res>
    implements $AppErrorCopyWith<$Res> {
  factory _$$ValidationErrorImplCopyWith(_$ValidationErrorImpl value,
          $Res Function(_$ValidationErrorImpl) then) =
      __$$ValidationErrorImplCopyWithImpl<$Res>;
  @override
  @useResult
  $Res call({String? message, Map<String, String>? fieldErrors});
}

/// @nodoc
class __$$ValidationErrorImplCopyWithImpl<$Res>
    extends _$AppErrorCopyWithImpl<$Res, _$ValidationErrorImpl>
    implements _$$ValidationErrorImplCopyWith<$Res> {
  __$$ValidationErrorImplCopyWithImpl(
      _$ValidationErrorImpl _value, $Res Function(_$ValidationErrorImpl) _then)
      : super(_value, _then);

  @pragma('vm:prefer-inline')
  @override
  $Res call({
    Object? message = freezed,
    Object? fieldErrors = freezed,
  }) {
    return _then(_$ValidationErrorImpl(
      message: freezed == message
          ? _value.message
          : message // ignore: cast_nullable_to_non_nullable
              as String?,
      fieldErrors: freezed == fieldErrors
          ? _value._fieldErrors
          : fieldErrors // ignore: cast_nullable_to_non_nullable
              as Map<String, String>?,
    ));
  }
}

/// @nodoc

class _$ValidationErrorImpl implements ValidationError {
  const _$ValidationErrorImpl(
      {this.message, final Map<String, String>? fieldErrors})
      : _fieldErrors = fieldErrors;

  @override
  final String? message;
  final Map<String, String>? _fieldErrors;
  @override
  Map<String, String>? get fieldErrors {
    final value = _fieldErrors;
    if (value == null) return null;
    if (_fieldErrors is EqualUnmodifiableMapView) return _fieldErrors;
    // ignore: implicit_dynamic_type
    return EqualUnmodifiableMapView(value);
  }

  @override
  String toString() {
    return 'AppError.validation(message: $message, fieldErrors: $fieldErrors)';
  }

  @override
  bool operator ==(Object other) {
    return identical(this, other) ||
        (other.runtimeType == runtimeType &&
            other is _$ValidationErrorImpl &&
            (identical(other.message, message) || other.message == message) &&
            const DeepCollectionEquality()
                .equals(other._fieldErrors, _fieldErrors));
  }

  @override
  int get hashCode => Object.hash(
      runtimeType, message, const DeepCollectionEquality().hash(_fieldErrors));

  @JsonKey(ignore: true)
  @override
  @pragma('vm:prefer-inline')
  _$$ValidationErrorImplCopyWith<_$ValidationErrorImpl> get copyWith =>
      __$$ValidationErrorImplCopyWithImpl<_$ValidationErrorImpl>(
          this, _$identity);

  @override
  @optionalTypeArgs
  TResult when<TResult extends Object?>({
    required TResult Function(String? message) unknown,
    required TResult Function(String? message) network,
    required TResult Function(String? message) unauthorized,
    required TResult Function(String? message) forbidden,
    required TResult Function(String? message) notFound,
    required TResult Function(int? statusCode, String? message) server,
    required TResult Function(String? message) database,
    required TResult Function(String? message, Map<String, String>? fieldErrors)
        validation,
    required TResult Function(String? message) parsing,
  }) {
    return validation(message, fieldErrors);
  }

  @override
  @optionalTypeArgs
  TResult? whenOrNull<TResult extends Object?>({
    TResult? Function(String? message)? unknown,
    TResult? Function(String? message)? network,
    TResult? Function(String? message)? unauthorized,
    TResult? Function(String? message)? forbidden,
    TResult? Function(String? message)? notFound,
    TResult? Function(int? statusCode, String? message)? server,
    TResult? Function(String? message)? database,
    TResult? Function(String? message, Map<String, String>? fieldErrors)?
        validation,
    TResult? Function(String? message)? parsing,
  }) {
    return validation?.call(message, fieldErrors);
  }

  @override
  @optionalTypeArgs
  TResult maybeWhen<TResult extends Object?>({
    TResult Function(String? message)? unknown,
    TResult Function(String? message)? network,
    TResult Function(String? message)? unauthorized,
    TResult Function(String? message)? forbidden,
    TResult Function(String? message)? notFound,
    TResult Function(int? statusCode, String? message)? server,
    TResult Function(String? message)? database,
    TResult Function(String? message, Map<String, String>? fieldErrors)?
        validation,
    TResult Function(String? message)? parsing,
    required TResult orElse(),
  }) {
    if (validation != null) {
      return validation(message, fieldErrors);
    }
    return orElse();
  }

  @override
  @optionalTypeArgs
  TResult map<TResult extends Object?>({
    required TResult Function(UnknownError value) unknown,
    required TResult Function(NetworkError value) network,
    required TResult Function(UnauthorizedError value) unauthorized,
    required TResult Function(ForbiddenError value) forbidden,
    required TResult Function(NotFoundError value) notFound,
    required TResult Function(ServerError value) server,
    required TResult Function(DatabaseError value) database,
    required TResult Function(ValidationError value) validation,
    required TResult Function(ParsingError value) parsing,
  }) {
    return validation(this);
  }

  @override
  @optionalTypeArgs
  TResult? mapOrNull<TResult extends Object?>({
    TResult? Function(UnknownError value)? unknown,
    TResult? Function(NetworkError value)? network,
    TResult? Function(UnauthorizedError value)? unauthorized,
    TResult? Function(ForbiddenError value)? forbidden,
    TResult? Function(NotFoundError value)? notFound,
    TResult? Function(ServerError value)? server,
    TResult? Function(DatabaseError value)? database,
    TResult? Function(ValidationError value)? validation,
    TResult? Function(ParsingError value)? parsing,
  }) {
    return validation?.call(this);
  }

  @override
  @optionalTypeArgs
  TResult maybeMap<TResult extends Object?>({
    TResult Function(UnknownError value)? unknown,
    TResult Function(NetworkError value)? network,
    TResult Function(UnauthorizedError value)? unauthorized,
    TResult Function(ForbiddenError value)? forbidden,
    TResult Function(NotFoundError value)? notFound,
    TResult Function(ServerError value)? server,
    TResult Function(DatabaseError value)? database,
    TResult Function(ValidationError value)? validation,
    TResult Function(ParsingError value)? parsing,
    required TResult orElse(),
  }) {
    if (validation != null) {
      return validation(this);
    }
    return orElse();
  }
}

abstract class ValidationError implements AppError {
  const factory ValidationError(
      {final String? message,
      final Map<String, String>? fieldErrors}) = _$ValidationErrorImpl;

  @override
  String? get message;
  Map<String, String>? get fieldErrors;
  @override
  @JsonKey(ignore: true)
  _$$ValidationErrorImplCopyWith<_$ValidationErrorImpl> get copyWith =>
      throw _privateConstructorUsedError;
}

/// @nodoc
abstract class _$$ParsingErrorImplCopyWith<$Res>
    implements $AppErrorCopyWith<$Res> {
  factory _$$ParsingErrorImplCopyWith(
          _$ParsingErrorImpl value, $Res Function(_$ParsingErrorImpl) then) =
      __$$ParsingErrorImplCopyWithImpl<$Res>;
  @override
  @useResult
  $Res call({String? message});
}

/// @nodoc
class __$$ParsingErrorImplCopyWithImpl<$Res>
    extends _$AppErrorCopyWithImpl<$Res, _$ParsingErrorImpl>
    implements _$$ParsingErrorImplCopyWith<$Res> {
  __$$ParsingErrorImplCopyWithImpl(
      _$ParsingErrorImpl _value, $Res Function(_$ParsingErrorImpl) _then)
      : super(_value, _then);

  @pragma('vm:prefer-inline')
  @override
  $Res call({
    Object? message = freezed,
  }) {
    return _then(_$ParsingErrorImpl(
      message: freezed == message
          ? _value.message
          : message // ignore: cast_nullable_to_non_nullable
              as String?,
    ));
  }
}

/// @nodoc

class _$ParsingErrorImpl implements ParsingError {
  const _$ParsingErrorImpl({this.message});

  @override
  final String? message;

  @override
  String toString() {
    return 'AppError.parsing(message: $message)';
  }

  @override
  bool operator ==(Object other) {
    return identical(this, other) ||
        (other.runtimeType == runtimeType &&
            other is _$ParsingErrorImpl &&
            (identical(other.message, message) || other.message == message));
  }

  @override
  int get hashCode => Object.hash(runtimeType, message);

  @JsonKey(ignore: true)
  @override
  @pragma('vm:prefer-inline')
  _$$ParsingErrorImplCopyWith<_$ParsingErrorImpl> get copyWith =>
      __$$ParsingErrorImplCopyWithImpl<_$ParsingErrorImpl>(this, _$identity);

  @override
  @optionalTypeArgs
  TResult when<TResult extends Object?>({
    required TResult Function(String? message) unknown,
    required TResult Function(String? message) network,
    required TResult Function(String? message) unauthorized,
    required TResult Function(String? message) forbidden,
    required TResult Function(String? message) notFound,
    required TResult Function(int? statusCode, String? message) server,
    required TResult Function(String? message) database,
    required TResult Function(String? message, Map<String, String>? fieldErrors)
        validation,
    required TResult Function(String? message) parsing,
  }) {
    return parsing(message);
  }

  @override
  @optionalTypeArgs
  TResult? whenOrNull<TResult extends Object?>({
    TResult? Function(String? message)? unknown,
    TResult? Function(String? message)? network,
    TResult? Function(String? message)? unauthorized,
    TResult? Function(String? message)? forbidden,
    TResult? Function(String? message)? notFound,
    TResult? Function(int? statusCode, String? message)? server,
    TResult? Function(String? message)? database,
    TResult? Function(String? message, Map<String, String>? fieldErrors)?
        validation,
    TResult? Function(String? message)? parsing,
  }) {
    return parsing?.call(message);
  }

  @override
  @optionalTypeArgs
  TResult maybeWhen<TResult extends Object?>({
    TResult Function(String? message)? unknown,
    TResult Function(String? message)? network,
    TResult Function(String? message)? unauthorized,
    TResult Function(String? message)? forbidden,
    TResult Function(String? message)? notFound,
    TResult Function(int? statusCode, String? message)? server,
    TResult Function(String? message)? database,
    TResult Function(String? message, Map<String, String>? fieldErrors)?
        validation,
    TResult Function(String? message)? parsing,
    required TResult orElse(),
  }) {
    if (parsing != null) {
      return parsing(message);
    }
    return orElse();
  }

  @override
  @optionalTypeArgs
  TResult map<TResult extends Object?>({
    required TResult Function(UnknownError value) unknown,
    required TResult Function(NetworkError value) network,
    required TResult Function(UnauthorizedError value) unauthorized,
    required TResult Function(ForbiddenError value) forbidden,
    required TResult Function(NotFoundError value) notFound,
    required TResult Function(ServerError value) server,
    required TResult Function(DatabaseError value) database,
    required TResult Function(ValidationError value) validation,
    required TResult Function(ParsingError value) parsing,
  }) {
    return parsing(this);
  }

  @override
  @optionalTypeArgs
  TResult? mapOrNull<TResult extends Object?>({
    TResult? Function(UnknownError value)? unknown,
    TResult? Function(NetworkError value)? network,
    TResult? Function(UnauthorizedError value)? unauthorized,
    TResult? Function(ForbiddenError value)? forbidden,
    TResult? Function(NotFoundError value)? notFound,
    TResult? Function(ServerError value)? server,
    TResult? Function(DatabaseError value)? database,
    TResult? Function(ValidationError value)? validation,
    TResult? Function(ParsingError value)? parsing,
  }) {
    return parsing?.call(this);
  }

  @override
  @optionalTypeArgs
  TResult maybeMap<TResult extends Object?>({
    TResult Function(UnknownError value)? unknown,
    TResult Function(NetworkError value)? network,
    TResult Function(UnauthorizedError value)? unauthorized,
    TResult Function(ForbiddenError value)? forbidden,
    TResult Function(NotFoundError value)? notFound,
    TResult Function(ServerError value)? server,
    TResult Function(DatabaseError value)? database,
    TResult Function(ValidationError value)? validation,
    TResult Function(ParsingError value)? parsing,
    required TResult orElse(),
  }) {
    if (parsing != null) {
      return parsing(this);
    }
    return orElse();
  }
}

abstract class ParsingError implements AppError {
  const factory ParsingError({final String? message}) = _$ParsingErrorImpl;

  @override
  String? get message;
  @override
  @JsonKey(ignore: true)
  _$$ParsingErrorImplCopyWith<_$ParsingErrorImpl> get copyWith =>
      throw _privateConstructorUsedError;
}
