// GENERATED CODE - DO NOT MODIFY BY HAND // coverage:ignore-file // ignore_for_file: type=lint, type=warning, deprecated_member_use, deprecated_member_use_from_same_package // 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 'api_failure.dart'; // ************************************************************************** // FreezedGenerator // ************************************************************************** // GENERATED CODE - DO NOT MODIFY BY HAND // dart format off T _$identity(T value) => value; /// @nodoc mixin _$ApiFailure { @override bool operator ==(Object other) { return identical(this, other) || (other.runtimeType == runtimeType&&other is ApiFailure); } @override int get hashCode => runtimeType.hashCode; @override String toString() { return 'ApiFailure()'; } } /// @nodoc class $ApiFailureCopyWith<$Res> { $ApiFailureCopyWith(ApiFailure _, $Res Function(ApiFailure) __); } /// Adds pattern-matching-related methods to [ApiFailure]. extension ApiFailurePatterns on ApiFailure { /// A variant of `map` that fallback to returning `orElse`. /// /// It is equivalent to doing: /// ```dart /// switch (sealedClass) { /// case final Subclass value: /// return ...; /// case _: /// return orElse(); /// } /// ``` @optionalTypeArgs TResult maybeMap({TResult Function( _ServerError value)? serverError,TResult Function( _UnexpectedError value)? unexpectedError,TResult Function( _ConnectionError value)? connectionError,TResult Function( _InternalServerError value)? internalServerError,TResult Function( _Unauthorized value)? unauthorized,TResult Function( _BadRequest value)? badRequest,TResult Function( _NotFound value)? notFound,TResult Function( _ConnectionTimeout value)? connectionTimeout,required TResult orElse(),}){ final _that = this; switch (_that) { case _ServerError() when serverError != null: return serverError(_that);case _UnexpectedError() when unexpectedError != null: return unexpectedError(_that);case _ConnectionError() when connectionError != null: return connectionError(_that);case _InternalServerError() when internalServerError != null: return internalServerError(_that);case _Unauthorized() when unauthorized != null: return unauthorized(_that);case _BadRequest() when badRequest != null: return badRequest(_that);case _NotFound() when notFound != null: return notFound(_that);case _ConnectionTimeout() when connectionTimeout != null: return connectionTimeout(_that);case _: return orElse(); } } /// A `switch`-like method, using callbacks. /// /// Callbacks receives the raw object, upcasted. /// It is equivalent to doing: /// ```dart /// switch (sealedClass) { /// case final Subclass value: /// return ...; /// case final Subclass2 value: /// return ...; /// } /// ``` @optionalTypeArgs TResult map({required TResult Function( _ServerError value) serverError,required TResult Function( _UnexpectedError value) unexpectedError,required TResult Function( _ConnectionError value) connectionError,required TResult Function( _InternalServerError value) internalServerError,required TResult Function( _Unauthorized value) unauthorized,required TResult Function( _BadRequest value) badRequest,required TResult Function( _NotFound value) notFound,required TResult Function( _ConnectionTimeout value) connectionTimeout,}){ final _that = this; switch (_that) { case _ServerError(): return serverError(_that);case _UnexpectedError(): return unexpectedError(_that);case _ConnectionError(): return connectionError(_that);case _InternalServerError(): return internalServerError(_that);case _Unauthorized(): return unauthorized(_that);case _BadRequest(): return badRequest(_that);case _NotFound(): return notFound(_that);case _ConnectionTimeout(): return connectionTimeout(_that);} } /// A variant of `map` that fallback to returning `null`. /// /// It is equivalent to doing: /// ```dart /// switch (sealedClass) { /// case final Subclass value: /// return ...; /// case _: /// return null; /// } /// ``` @optionalTypeArgs TResult? mapOrNull({TResult? Function( _ServerError value)? serverError,TResult? Function( _UnexpectedError value)? unexpectedError,TResult? Function( _ConnectionError value)? connectionError,TResult? Function( _InternalServerError value)? internalServerError,TResult? Function( _Unauthorized value)? unauthorized,TResult? Function( _BadRequest value)? badRequest,TResult? Function( _NotFound value)? notFound,TResult? Function( _ConnectionTimeout value)? connectionTimeout,}){ final _that = this; switch (_that) { case _ServerError() when serverError != null: return serverError(_that);case _UnexpectedError() when unexpectedError != null: return unexpectedError(_that);case _ConnectionError() when connectionError != null: return connectionError(_that);case _InternalServerError() when internalServerError != null: return internalServerError(_that);case _Unauthorized() when unauthorized != null: return unauthorized(_that);case _BadRequest() when badRequest != null: return badRequest(_that);case _NotFound() when notFound != null: return notFound(_that);case _ConnectionTimeout() when connectionTimeout != null: return connectionTimeout(_that);case _: return null; } } /// A variant of `when` that fallback to an `orElse` callback. /// /// It is equivalent to doing: /// ```dart /// switch (sealedClass) { /// case Subclass(:final field): /// return ...; /// case _: /// return orElse(); /// } /// ``` @optionalTypeArgs TResult maybeWhen({TResult Function( int statusCode, Object errorMessage)? serverError,TResult Function( Object errorMessage, StackTrace stackTrace)? unexpectedError,TResult Function()? connectionError,TResult Function()? internalServerError,TResult Function( String? message)? unauthorized,TResult Function( String? message)? badRequest,TResult Function( String? message)? notFound,TResult Function()? connectionTimeout,required TResult orElse(),}) {final _that = this; switch (_that) { case _ServerError() when serverError != null: return serverError(_that.statusCode,_that.errorMessage);case _UnexpectedError() when unexpectedError != null: return unexpectedError(_that.errorMessage,_that.stackTrace);case _ConnectionError() when connectionError != null: return connectionError();case _InternalServerError() when internalServerError != null: return internalServerError();case _Unauthorized() when unauthorized != null: return unauthorized(_that.message);case _BadRequest() when badRequest != null: return badRequest(_that.message);case _NotFound() when notFound != null: return notFound(_that.message);case _ConnectionTimeout() when connectionTimeout != null: return connectionTimeout();case _: return orElse(); } } /// A `switch`-like method, using callbacks. /// /// As opposed to `map`, this offers destructuring. /// It is equivalent to doing: /// ```dart /// switch (sealedClass) { /// case Subclass(:final field): /// return ...; /// case Subclass2(:final field2): /// return ...; /// } /// ``` @optionalTypeArgs TResult when({required TResult Function( int statusCode, Object errorMessage) serverError,required TResult Function( Object errorMessage, StackTrace stackTrace) unexpectedError,required TResult Function() connectionError,required TResult Function() internalServerError,required TResult Function( String? message) unauthorized,required TResult Function( String? message) badRequest,required TResult Function( String? message) notFound,required TResult Function() connectionTimeout,}) {final _that = this; switch (_that) { case _ServerError(): return serverError(_that.statusCode,_that.errorMessage);case _UnexpectedError(): return unexpectedError(_that.errorMessage,_that.stackTrace);case _ConnectionError(): return connectionError();case _InternalServerError(): return internalServerError();case _Unauthorized(): return unauthorized(_that.message);case _BadRequest(): return badRequest(_that.message);case _NotFound(): return notFound(_that.message);case _ConnectionTimeout(): return connectionTimeout();} } /// A variant of `when` that fallback to returning `null` /// /// It is equivalent to doing: /// ```dart /// switch (sealedClass) { /// case Subclass(:final field): /// return ...; /// case _: /// return null; /// } /// ``` @optionalTypeArgs TResult? whenOrNull({TResult? Function( int statusCode, Object errorMessage)? serverError,TResult? Function( Object errorMessage, StackTrace stackTrace)? unexpectedError,TResult? Function()? connectionError,TResult? Function()? internalServerError,TResult? Function( String? message)? unauthorized,TResult? Function( String? message)? badRequest,TResult? Function( String? message)? notFound,TResult? Function()? connectionTimeout,}) {final _that = this; switch (_that) { case _ServerError() when serverError != null: return serverError(_that.statusCode,_that.errorMessage);case _UnexpectedError() when unexpectedError != null: return unexpectedError(_that.errorMessage,_that.stackTrace);case _ConnectionError() when connectionError != null: return connectionError();case _InternalServerError() when internalServerError != null: return internalServerError();case _Unauthorized() when unauthorized != null: return unauthorized(_that.message);case _BadRequest() when badRequest != null: return badRequest(_that.message);case _NotFound() when notFound != null: return notFound(_that.message);case _ConnectionTimeout() when connectionTimeout != null: return connectionTimeout();case _: return null; } } } /// @nodoc class _ServerError extends ApiFailure { const _ServerError({required this.statusCode, required this.errorMessage}): super._(); final int statusCode; final Object errorMessage; /// Create a copy of ApiFailure /// with the given fields replaced by the non-null parameter values. @JsonKey(includeFromJson: false, includeToJson: false) @pragma('vm:prefer-inline') _$ServerErrorCopyWith<_ServerError> get copyWith => __$ServerErrorCopyWithImpl<_ServerError>(this, _$identity); @override bool operator ==(Object other) { return identical(this, other) || (other.runtimeType == runtimeType&&other is _ServerError&&(identical(other.statusCode, statusCode) || other.statusCode == statusCode)&&const DeepCollectionEquality().equals(other.errorMessage, errorMessage)); } @override int get hashCode { return Object.hash(runtimeType,statusCode,const DeepCollectionEquality().hash(errorMessage)); } @override String toString() { return 'ApiFailure.serverError(statusCode: $statusCode, errorMessage: $errorMessage)'; } } /// @nodoc abstract mixin class _$ServerErrorCopyWith<$Res> implements $ApiFailureCopyWith<$Res> { factory _$ServerErrorCopyWith(_ServerError value, $Res Function(_ServerError) _then) = __$ServerErrorCopyWithImpl; @useResult $Res call({ int statusCode, Object errorMessage }); } /// @nodoc class __$ServerErrorCopyWithImpl<$Res> implements _$ServerErrorCopyWith<$Res> { __$ServerErrorCopyWithImpl(this._self, this._then); final _ServerError _self; final $Res Function(_ServerError) _then; /// Create a copy of ApiFailure /// with the given fields replaced by the non-null parameter values. @pragma('vm:prefer-inline') $Res call({Object? statusCode = null,Object? errorMessage = null,}) { return _then(_ServerError( statusCode: null == statusCode ? _self.statusCode : statusCode // ignore: cast_nullable_to_non_nullable as int,errorMessage: null == errorMessage ? _self.errorMessage : errorMessage , )); } } /// @nodoc class _UnexpectedError extends ApiFailure { const _UnexpectedError({required this.errorMessage, required this.stackTrace}): super._(); final Object errorMessage; final StackTrace stackTrace; /// Create a copy of ApiFailure /// with the given fields replaced by the non-null parameter values. @JsonKey(includeFromJson: false, includeToJson: false) @pragma('vm:prefer-inline') _$UnexpectedErrorCopyWith<_UnexpectedError> get copyWith => __$UnexpectedErrorCopyWithImpl<_UnexpectedError>(this, _$identity); @override bool operator ==(Object other) { return identical(this, other) || (other.runtimeType == runtimeType&&other is _UnexpectedError&&const DeepCollectionEquality().equals(other.errorMessage, errorMessage)&&(identical(other.stackTrace, stackTrace) || other.stackTrace == stackTrace)); } @override int get hashCode { return Object.hash(runtimeType,const DeepCollectionEquality().hash(errorMessage),stackTrace); } @override String toString() { return 'ApiFailure.unexpectedError(errorMessage: $errorMessage, stackTrace: $stackTrace)'; } } /// @nodoc abstract mixin class _$UnexpectedErrorCopyWith<$Res> implements $ApiFailureCopyWith<$Res> { factory _$UnexpectedErrorCopyWith(_UnexpectedError value, $Res Function(_UnexpectedError) _then) = __$UnexpectedErrorCopyWithImpl; @useResult $Res call({ Object errorMessage, StackTrace stackTrace }); } /// @nodoc class __$UnexpectedErrorCopyWithImpl<$Res> implements _$UnexpectedErrorCopyWith<$Res> { __$UnexpectedErrorCopyWithImpl(this._self, this._then); final _UnexpectedError _self; final $Res Function(_UnexpectedError) _then; /// Create a copy of ApiFailure /// with the given fields replaced by the non-null parameter values. @pragma('vm:prefer-inline') $Res call({Object? errorMessage = null,Object? stackTrace = null,}) { return _then(_UnexpectedError( errorMessage: null == errorMessage ? _self.errorMessage : errorMessage ,stackTrace: null == stackTrace ? _self.stackTrace : stackTrace // ignore: cast_nullable_to_non_nullable as StackTrace, )); } } /// @nodoc class _ConnectionError extends ApiFailure { const _ConnectionError(): super._(); @override bool operator ==(Object other) { return identical(this, other) || (other.runtimeType == runtimeType&&other is _ConnectionError); } @override int get hashCode => runtimeType.hashCode; @override String toString() { return 'ApiFailure.connectionError()'; } } /// @nodoc class _InternalServerError extends ApiFailure { const _InternalServerError(): super._(); @override bool operator ==(Object other) { return identical(this, other) || (other.runtimeType == runtimeType&&other is _InternalServerError); } @override int get hashCode => runtimeType.hashCode; @override String toString() { return 'ApiFailure.internalServerError()'; } } /// @nodoc class _Unauthorized extends ApiFailure { const _Unauthorized(this.message): super._(); final String? message; /// Create a copy of ApiFailure /// with the given fields replaced by the non-null parameter values. @JsonKey(includeFromJson: false, includeToJson: false) @pragma('vm:prefer-inline') _$UnauthorizedCopyWith<_Unauthorized> get copyWith => __$UnauthorizedCopyWithImpl<_Unauthorized>(this, _$identity); @override bool operator ==(Object other) { return identical(this, other) || (other.runtimeType == runtimeType&&other is _Unauthorized&&(identical(other.message, message) || other.message == message)); } @override int get hashCode { return Object.hash(runtimeType,message); } @override String toString() { return 'ApiFailure.unauthorized(message: $message)'; } } /// @nodoc abstract mixin class _$UnauthorizedCopyWith<$Res> implements $ApiFailureCopyWith<$Res> { factory _$UnauthorizedCopyWith(_Unauthorized value, $Res Function(_Unauthorized) _then) = __$UnauthorizedCopyWithImpl; @useResult $Res call({ String? message }); } /// @nodoc class __$UnauthorizedCopyWithImpl<$Res> implements _$UnauthorizedCopyWith<$Res> { __$UnauthorizedCopyWithImpl(this._self, this._then); final _Unauthorized _self; final $Res Function(_Unauthorized) _then; /// Create a copy of ApiFailure /// with the given fields replaced by the non-null parameter values. @pragma('vm:prefer-inline') $Res call({Object? message = freezed,}) { return _then(_Unauthorized( freezed == message ? _self.message : message // ignore: cast_nullable_to_non_nullable as String?, )); } } /// @nodoc class _BadRequest extends ApiFailure { const _BadRequest(this.message): super._(); final String? message; /// Create a copy of ApiFailure /// with the given fields replaced by the non-null parameter values. @JsonKey(includeFromJson: false, includeToJson: false) @pragma('vm:prefer-inline') _$BadRequestCopyWith<_BadRequest> get copyWith => __$BadRequestCopyWithImpl<_BadRequest>(this, _$identity); @override bool operator ==(Object other) { return identical(this, other) || (other.runtimeType == runtimeType&&other is _BadRequest&&(identical(other.message, message) || other.message == message)); } @override int get hashCode { return Object.hash(runtimeType,message); } @override String toString() { return 'ApiFailure.badRequest(message: $message)'; } } /// @nodoc abstract mixin class _$BadRequestCopyWith<$Res> implements $ApiFailureCopyWith<$Res> { factory _$BadRequestCopyWith(_BadRequest value, $Res Function(_BadRequest) _then) = __$BadRequestCopyWithImpl; @useResult $Res call({ String? message }); } /// @nodoc class __$BadRequestCopyWithImpl<$Res> implements _$BadRequestCopyWith<$Res> { __$BadRequestCopyWithImpl(this._self, this._then); final _BadRequest _self; final $Res Function(_BadRequest) _then; /// Create a copy of ApiFailure /// with the given fields replaced by the non-null parameter values. @pragma('vm:prefer-inline') $Res call({Object? message = freezed,}) { return _then(_BadRequest( freezed == message ? _self.message : message // ignore: cast_nullable_to_non_nullable as String?, )); } } /// @nodoc class _NotFound extends ApiFailure { const _NotFound(this.message): super._(); final String? message; /// Create a copy of ApiFailure /// with the given fields replaced by the non-null parameter values. @JsonKey(includeFromJson: false, includeToJson: false) @pragma('vm:prefer-inline') _$NotFoundCopyWith<_NotFound> get copyWith => __$NotFoundCopyWithImpl<_NotFound>(this, _$identity); @override bool operator ==(Object other) { return identical(this, other) || (other.runtimeType == runtimeType&&other is _NotFound&&(identical(other.message, message) || other.message == message)); } @override int get hashCode { return Object.hash(runtimeType,message); } @override String toString() { return 'ApiFailure.notFound(message: $message)'; } } /// @nodoc abstract mixin class _$NotFoundCopyWith<$Res> implements $ApiFailureCopyWith<$Res> { factory _$NotFoundCopyWith(_NotFound value, $Res Function(_NotFound) _then) = __$NotFoundCopyWithImpl; @useResult $Res call({ String? message }); } /// @nodoc class __$NotFoundCopyWithImpl<$Res> implements _$NotFoundCopyWith<$Res> { __$NotFoundCopyWithImpl(this._self, this._then); final _NotFound _self; final $Res Function(_NotFound) _then; /// Create a copy of ApiFailure /// with the given fields replaced by the non-null parameter values. @pragma('vm:prefer-inline') $Res call({Object? message = freezed,}) { return _then(_NotFound( freezed == message ? _self.message : message // ignore: cast_nullable_to_non_nullable as String?, )); } } /// @nodoc class _ConnectionTimeout extends ApiFailure { const _ConnectionTimeout(): super._(); @override bool operator ==(Object other) { return identical(this, other) || (other.runtimeType == runtimeType&&other is _ConnectionTimeout); } @override int get hashCode => runtimeType.hashCode; @override String toString() { return 'ApiFailure.connectionTimeout()'; } } // dart format on