2022-01-27 14:34:29 +03:00
// coverage:ignore-file
// GENERATED CODE - DO NOT MODIFY BY HAND
2022-05-12 12:06:28 +03:00
// ignore_for_file: type=lint
2022-12-05 17:26:54 +03:00
// 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
2022-01-27 14:34:29 +03:00
part of ' models.dart ' ;
// **************************************************************************
// FreezedGenerator
// **************************************************************************
T _ $identity < T > ( T value ) = > value ;
final _privateConstructorUsedError = UnsupportedError (
2024-02-05 17:15:38 +03:00
' 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. \n Please check the documentation here for more information: https://github.com/rrousselGit/freezed#adding-getters-and-methods-to-our-models ' ) ;
2022-01-27 14:34:29 +03:00
RpcResponse _ $RpcResponseFromJson ( Map < String , dynamic > json ) {
switch ( json [ ' kind ' ] ) {
case ' success ' :
return Success . fromJson ( json ) ;
case ' signal ' :
return Signal . fromJson ( json ) ;
case ' error ' :
return RpcError . fromJson ( json ) ;
default :
throw CheckedFromJsonException (
json , ' kind ' , ' RpcResponse ' , ' Invalid union type " ${ json [ ' kind ' ] } "! ' ) ;
}
}
/// @nodoc
mixin _ $RpcResponse {
Map < String , dynamic > get body = > throw _privateConstructorUsedError ;
@ optionalTypeArgs
TResult when < TResult extends Object ? > ( {
2024-07-09 16:14:29 +03:00
required TResult Function ( Map < String , dynamic > body , List < String > flags )
success ,
2022-01-27 14:34:29 +03:00
required TResult Function ( String status , Map < String , dynamic > body ) signal ,
required TResult Function (
String status , String message , Map < String , dynamic > body )
error ,
} ) = >
throw _privateConstructorUsedError ;
@ optionalTypeArgs
TResult ? whenOrNull < TResult extends Object ? > ( {
2024-07-09 16:14:29 +03:00
TResult ? Function ( Map < String , dynamic > body , List < String > flags ) ? success ,
2022-10-19 12:15:48 +03:00
TResult ? Function ( String status , Map < String , dynamic > body ) ? signal ,
TResult ? Function ( String status , String message , Map < String , dynamic > body ) ?
2022-01-27 14:34:29 +03:00
error ,
} ) = >
throw _privateConstructorUsedError ;
@ optionalTypeArgs
TResult maybeWhen < TResult extends Object ? > ( {
2024-07-09 16:14:29 +03:00
TResult Function ( Map < String , dynamic > body , List < String > flags ) ? success ,
2022-01-27 14:34:29 +03:00
TResult Function ( String status , Map < String , dynamic > body ) ? signal ,
TResult Function ( String status , String message , Map < String , dynamic > body ) ?
error ,
required TResult orElse ( ) ,
} ) = >
throw _privateConstructorUsedError ;
@ optionalTypeArgs
TResult map < TResult extends Object ? > ( {
required TResult Function ( Success value ) success ,
required TResult Function ( Signal value ) signal ,
required TResult Function ( RpcError value ) error ,
} ) = >
throw _privateConstructorUsedError ;
@ optionalTypeArgs
TResult ? mapOrNull < TResult extends Object ? > ( {
2022-10-19 12:15:48 +03:00
TResult ? Function ( Success value ) ? success ,
TResult ? Function ( Signal value ) ? signal ,
TResult ? Function ( RpcError value ) ? error ,
2022-01-27 14:34:29 +03:00
} ) = >
throw _privateConstructorUsedError ;
@ optionalTypeArgs
TResult maybeMap < TResult extends Object ? > ( {
TResult Function ( Success value ) ? success ,
TResult Function ( Signal value ) ? signal ,
TResult Function ( RpcError value ) ? error ,
required TResult orElse ( ) ,
} ) = >
throw _privateConstructorUsedError ;
Map < String , dynamic > toJson ( ) = > throw _privateConstructorUsedError ;
@ JsonKey ( ignore: true )
$RpcResponseCopyWith < RpcResponse > get copyWith = >
throw _privateConstructorUsedError ;
}
/// @nodoc
abstract class $RpcResponseCopyWith < $Res > {
factory $RpcResponseCopyWith (
RpcResponse value , $Res Function ( RpcResponse ) then ) =
2022-10-19 12:15:48 +03:00
_ $RpcResponseCopyWithImpl < $Res , RpcResponse > ;
@ useResult
2022-01-27 14:34:29 +03:00
$Res call ( { Map < String , dynamic > body } ) ;
}
/// @nodoc
2022-10-19 12:15:48 +03:00
class _ $RpcResponseCopyWithImpl < $Res , $Val extends RpcResponse >
implements $RpcResponseCopyWith < $Res > {
2022-01-27 14:34:29 +03:00
_ $RpcResponseCopyWithImpl ( this . _value , this . _then ) ;
// ignore: unused_field
2022-10-19 12:15:48 +03:00
final $Val _value ;
// ignore: unused_field
final $Res Function ( $Val ) _then ;
2022-01-27 14:34:29 +03:00
2022-10-19 12:15:48 +03:00
@ pragma ( ' vm:prefer-inline ' )
2022-01-27 14:34:29 +03:00
@ override
$Res call ( {
2022-10-19 12:15:48 +03:00
Object ? body = null ,
2022-01-27 14:34:29 +03:00
} ) {
return _then ( _value . copyWith (
2022-10-19 12:15:48 +03:00
body: null = = body
2022-01-27 14:34:29 +03:00
? _value . body
: body // ignore: cast_nullable_to_non_nullable
as Map < String , dynamic > ,
2022-10-19 12:15:48 +03:00
) as $Val ) ;
2022-01-27 14:34:29 +03:00
}
}
/// @nodoc
2023-11-15 10:56:52 +03:00
abstract class _ $ $SuccessImplCopyWith < $Res >
implements $RpcResponseCopyWith < $Res > {
factory _ $ $SuccessImplCopyWith (
_ $SuccessImpl value , $Res Function ( _ $SuccessImpl ) then ) =
__ $ $SuccessImplCopyWithImpl < $Res > ;
2022-01-27 14:34:29 +03:00
@ override
2022-10-19 12:15:48 +03:00
@ useResult
2024-07-09 16:14:29 +03:00
$Res call ( { Map < String , dynamic > body , List < String > flags } ) ;
2022-01-27 14:34:29 +03:00
}
/// @nodoc
2023-11-15 10:56:52 +03:00
class __ $ $SuccessImplCopyWithImpl < $Res >
extends _ $RpcResponseCopyWithImpl < $Res , _ $SuccessImpl >
implements _ $ $SuccessImplCopyWith < $Res > {
__ $ $SuccessImplCopyWithImpl (
_ $SuccessImpl _value , $Res Function ( _ $SuccessImpl ) _then )
2022-10-19 12:15:48 +03:00
: super ( _value , _then ) ;
2022-01-27 14:34:29 +03:00
2022-10-19 12:15:48 +03:00
@ pragma ( ' vm:prefer-inline ' )
2022-01-27 14:34:29 +03:00
@ override
$Res call ( {
2022-10-19 12:15:48 +03:00
Object ? body = null ,
2024-07-09 16:14:29 +03:00
Object ? flags = null ,
2022-01-27 14:34:29 +03:00
} ) {
2023-11-15 10:56:52 +03:00
return _then ( _ $SuccessImpl (
2022-10-19 12:15:48 +03:00
null = = body
2022-05-12 12:06:28 +03:00
? _value . _body
2022-01-27 14:34:29 +03:00
: body // ignore: cast_nullable_to_non_nullable
as Map < String , dynamic > ,
2024-07-09 16:14:29 +03:00
null = = flags
? _value . _flags
: flags // ignore: cast_nullable_to_non_nullable
as List < String > ,
2022-01-27 14:34:29 +03:00
) ) ;
}
}
/// @nodoc
@ JsonSerializable ( )
2023-11-15 10:56:52 +03:00
class _ $SuccessImpl implements Success {
2024-07-09 16:14:29 +03:00
_ $SuccessImpl ( final Map < String , dynamic > body , final List < String > flags ,
{ final String ? $type } )
2022-05-12 12:06:28 +03:00
: _body = body ,
2024-07-09 16:14:29 +03:00
_flags = flags ,
2022-05-12 12:06:28 +03:00
$type = $type ? ? ' success ' ;
2022-01-27 14:34:29 +03:00
2023-11-15 10:56:52 +03:00
factory _ $SuccessImpl . fromJson ( Map < String , dynamic > json ) = >
_ $ $SuccessImplFromJson ( json ) ;
2022-01-27 14:34:29 +03:00
2022-05-12 12:06:28 +03:00
final Map < String , dynamic > _body ;
2022-01-27 14:34:29 +03:00
@ override
2022-05-12 12:06:28 +03:00
Map < String , dynamic > get body {
2022-12-05 17:26:54 +03:00
if ( _body is EqualUnmodifiableMapView ) return _body ;
2022-05-12 12:06:28 +03:00
// ignore: implicit_dynamic_type
return EqualUnmodifiableMapView ( _body ) ;
}
2022-01-27 14:34:29 +03:00
2024-07-09 16:14:29 +03:00
final List < String > _flags ;
@ override
List < String > get flags {
if ( _flags is EqualUnmodifiableListView ) return _flags ;
// ignore: implicit_dynamic_type
return EqualUnmodifiableListView ( _flags ) ;
}
2022-01-27 14:34:29 +03:00
@ JsonKey ( name: ' kind ' )
final String $type ;
@ override
String toString ( ) {
2024-07-09 16:14:29 +03:00
return ' RpcResponse.success(body: $ body , flags: $ flags ) ' ;
2022-01-27 14:34:29 +03:00
}
@ override
2024-02-02 15:52:22 +03:00
bool operator = = ( Object other ) {
2022-01-27 14:34:29 +03:00
return identical ( this , other ) | |
( other . runtimeType = = runtimeType & &
2023-11-15 10:56:52 +03:00
other is _ $SuccessImpl & &
2024-07-09 16:14:29 +03:00
const DeepCollectionEquality ( ) . equals ( other . _body , _body ) & &
const DeepCollectionEquality ( ) . equals ( other . _flags , _flags ) ) ;
2022-01-27 14:34:29 +03:00
}
2022-05-12 12:06:28 +03:00
@ JsonKey ( ignore: true )
2022-01-27 14:34:29 +03:00
@ override
2024-07-09 16:14:29 +03:00
int get hashCode = > Object . hash (
runtimeType ,
const DeepCollectionEquality ( ) . hash ( _body ) ,
const DeepCollectionEquality ( ) . hash ( _flags ) ) ;
2022-01-27 14:34:29 +03:00
@ JsonKey ( ignore: true )
@ override
2022-10-19 12:15:48 +03:00
@ pragma ( ' vm:prefer-inline ' )
2023-11-15 10:56:52 +03:00
_ $ $SuccessImplCopyWith < _ $SuccessImpl > get copyWith = >
__ $ $SuccessImplCopyWithImpl < _ $SuccessImpl > ( this , _ $identity ) ;
2022-01-27 14:34:29 +03:00
@ override
@ optionalTypeArgs
TResult when < TResult extends Object ? > ( {
2024-07-09 16:14:29 +03:00
required TResult Function ( Map < String , dynamic > body , List < String > flags )
success ,
2022-01-27 14:34:29 +03:00
required TResult Function ( String status , Map < String , dynamic > body ) signal ,
required TResult Function (
String status , String message , Map < String , dynamic > body )
error ,
} ) {
2024-07-09 16:14:29 +03:00
return success ( body , flags ) ;
2022-01-27 14:34:29 +03:00
}
@ override
@ optionalTypeArgs
TResult ? whenOrNull < TResult extends Object ? > ( {
2024-07-09 16:14:29 +03:00
TResult ? Function ( Map < String , dynamic > body , List < String > flags ) ? success ,
2022-10-19 12:15:48 +03:00
TResult ? Function ( String status , Map < String , dynamic > body ) ? signal ,
TResult ? Function ( String status , String message , Map < String , dynamic > body ) ?
2022-01-27 14:34:29 +03:00
error ,
} ) {
2024-07-09 16:14:29 +03:00
return success ? . call ( body , flags ) ;
2022-01-27 14:34:29 +03:00
}
@ override
@ optionalTypeArgs
TResult maybeWhen < TResult extends Object ? > ( {
2024-07-09 16:14:29 +03:00
TResult Function ( Map < String , dynamic > body , List < String > flags ) ? success ,
2022-01-27 14:34:29 +03:00
TResult Function ( String status , Map < String , dynamic > body ) ? signal ,
TResult Function ( String status , String message , Map < String , dynamic > body ) ?
error ,
required TResult orElse ( ) ,
} ) {
if ( success ! = null ) {
2024-07-09 16:14:29 +03:00
return success ( body , flags ) ;
2022-01-27 14:34:29 +03:00
}
return orElse ( ) ;
}
@ override
@ optionalTypeArgs
TResult map < TResult extends Object ? > ( {
required TResult Function ( Success value ) success ,
required TResult Function ( Signal value ) signal ,
required TResult Function ( RpcError value ) error ,
} ) {
return success ( this ) ;
}
@ override
@ optionalTypeArgs
TResult ? mapOrNull < TResult extends Object ? > ( {
2022-10-19 12:15:48 +03:00
TResult ? Function ( Success value ) ? success ,
TResult ? Function ( Signal value ) ? signal ,
TResult ? Function ( RpcError value ) ? error ,
2022-01-27 14:34:29 +03:00
} ) {
return success ? . call ( this ) ;
}
@ override
@ optionalTypeArgs
TResult maybeMap < TResult extends Object ? > ( {
TResult Function ( Success value ) ? success ,
TResult Function ( Signal value ) ? signal ,
TResult Function ( RpcError value ) ? error ,
required TResult orElse ( ) ,
} ) {
if ( success ! = null ) {
return success ( this ) ;
}
return orElse ( ) ;
}
@ override
Map < String , dynamic > toJson ( ) {
2023-11-15 10:56:52 +03:00
return _ $ $SuccessImplToJson (
2022-07-21 17:38:45 +03:00
this ,
) ;
2022-01-27 14:34:29 +03:00
}
}
abstract class Success implements RpcResponse {
2024-07-09 16:14:29 +03:00
factory Success ( final Map < String , dynamic > body , final List < String > flags ) =
_ $SuccessImpl ;
2022-01-27 14:34:29 +03:00
2023-11-15 10:56:52 +03:00
factory Success . fromJson ( Map < String , dynamic > json ) = _ $SuccessImpl . fromJson ;
2022-01-27 14:34:29 +03:00
@ override
2022-07-07 11:29:42 +03:00
Map < String , dynamic > get body ;
2024-07-09 16:14:29 +03:00
List < String > get flags ;
2022-01-27 14:34:29 +03:00
@ override
@ JsonKey ( ignore: true )
2023-11-15 10:56:52 +03:00
_ $ $SuccessImplCopyWith < _ $SuccessImpl > get copyWith = >
2022-05-12 12:06:28 +03:00
throw _privateConstructorUsedError ;
2022-01-27 14:34:29 +03:00
}
/// @nodoc
2023-11-15 10:56:52 +03:00
abstract class _ $ $SignalImplCopyWith < $Res >
implements $RpcResponseCopyWith < $Res > {
factory _ $ $SignalImplCopyWith (
_ $SignalImpl value , $Res Function ( _ $SignalImpl ) then ) =
__ $ $SignalImplCopyWithImpl < $Res > ;
2022-01-27 14:34:29 +03:00
@ override
2022-10-19 12:15:48 +03:00
@ useResult
2022-01-27 14:34:29 +03:00
$Res call ( { String status , Map < String , dynamic > body } ) ;
}
/// @nodoc
2023-11-15 10:56:52 +03:00
class __ $ $SignalImplCopyWithImpl < $Res >
extends _ $RpcResponseCopyWithImpl < $Res , _ $SignalImpl >
implements _ $ $SignalImplCopyWith < $Res > {
__ $ $SignalImplCopyWithImpl (
_ $SignalImpl _value , $Res Function ( _ $SignalImpl ) _then )
2022-10-19 12:15:48 +03:00
: super ( _value , _then ) ;
2022-01-27 14:34:29 +03:00
2022-10-19 12:15:48 +03:00
@ pragma ( ' vm:prefer-inline ' )
2022-01-27 14:34:29 +03:00
@ override
$Res call ( {
2022-10-19 12:15:48 +03:00
Object ? status = null ,
Object ? body = null ,
2022-01-27 14:34:29 +03:00
} ) {
2023-11-15 10:56:52 +03:00
return _then ( _ $SignalImpl (
2022-10-19 12:15:48 +03:00
null = = status
2022-01-27 14:34:29 +03:00
? _value . status
: status // ignore: cast_nullable_to_non_nullable
as String ,
2022-10-19 12:15:48 +03:00
null = = body
2022-05-12 12:06:28 +03:00
? _value . _body
2022-01-27 14:34:29 +03:00
: body // ignore: cast_nullable_to_non_nullable
as Map < String , dynamic > ,
) ) ;
}
}
/// @nodoc
@ JsonSerializable ( )
2023-11-15 10:56:52 +03:00
class _ $SignalImpl implements Signal {
_ $SignalImpl ( this . status , final Map < String , dynamic > body ,
{ final String ? $type } )
2022-05-12 12:06:28 +03:00
: _body = body ,
$type = $type ? ? ' signal ' ;
2022-01-27 14:34:29 +03:00
2023-11-15 10:56:52 +03:00
factory _ $SignalImpl . fromJson ( Map < String , dynamic > json ) = >
_ $ $SignalImplFromJson ( json ) ;
2022-01-27 14:34:29 +03:00
@ override
final String status ;
2022-05-12 12:06:28 +03:00
final Map < String , dynamic > _body ;
2022-01-27 14:34:29 +03:00
@ override
2022-05-12 12:06:28 +03:00
Map < String , dynamic > get body {
2022-12-05 17:26:54 +03:00
if ( _body is EqualUnmodifiableMapView ) return _body ;
2022-05-12 12:06:28 +03:00
// ignore: implicit_dynamic_type
return EqualUnmodifiableMapView ( _body ) ;
}
2022-01-27 14:34:29 +03:00
@ JsonKey ( name: ' kind ' )
final String $type ;
@ override
String toString ( ) {
return ' RpcResponse.signal(status: $ status , body: $ body ) ' ;
}
@ override
2024-02-02 15:52:22 +03:00
bool operator = = ( Object other ) {
2022-01-27 14:34:29 +03:00
return identical ( this , other ) | |
( other . runtimeType = = runtimeType & &
2023-11-15 10:56:52 +03:00
other is _ $SignalImpl & &
2022-10-19 12:15:48 +03:00
( identical ( other . status , status ) | | other . status = = status ) & &
2022-05-12 12:06:28 +03:00
const DeepCollectionEquality ( ) . equals ( other . _body , _body ) ) ;
2022-01-27 14:34:29 +03:00
}
2022-05-12 12:06:28 +03:00
@ JsonKey ( ignore: true )
2022-01-27 14:34:29 +03:00
@ override
int get hashCode = > Object . hash (
2022-10-19 12:15:48 +03:00
runtimeType , status , const DeepCollectionEquality ( ) . hash ( _body ) ) ;
2022-01-27 14:34:29 +03:00
@ JsonKey ( ignore: true )
@ override
2022-10-19 12:15:48 +03:00
@ pragma ( ' vm:prefer-inline ' )
2023-11-15 10:56:52 +03:00
_ $ $SignalImplCopyWith < _ $SignalImpl > get copyWith = >
__ $ $SignalImplCopyWithImpl < _ $SignalImpl > ( this , _ $identity ) ;
2022-01-27 14:34:29 +03:00
@ override
@ optionalTypeArgs
TResult when < TResult extends Object ? > ( {
2024-07-09 16:14:29 +03:00
required TResult Function ( Map < String , dynamic > body , List < String > flags )
success ,
2022-01-27 14:34:29 +03:00
required TResult Function ( String status , Map < String , dynamic > body ) signal ,
required TResult Function (
String status , String message , Map < String , dynamic > body )
error ,
} ) {
return signal ( status , body ) ;
}
@ override
@ optionalTypeArgs
TResult ? whenOrNull < TResult extends Object ? > ( {
2024-07-09 16:14:29 +03:00
TResult ? Function ( Map < String , dynamic > body , List < String > flags ) ? success ,
2022-10-19 12:15:48 +03:00
TResult ? Function ( String status , Map < String , dynamic > body ) ? signal ,
TResult ? Function ( String status , String message , Map < String , dynamic > body ) ?
2022-01-27 14:34:29 +03:00
error ,
} ) {
return signal ? . call ( status , body ) ;
}
@ override
@ optionalTypeArgs
TResult maybeWhen < TResult extends Object ? > ( {
2024-07-09 16:14:29 +03:00
TResult Function ( Map < String , dynamic > body , List < String > flags ) ? success ,
2022-01-27 14:34:29 +03:00
TResult Function ( String status , Map < String , dynamic > body ) ? signal ,
TResult Function ( String status , String message , Map < String , dynamic > body ) ?
error ,
required TResult orElse ( ) ,
} ) {
if ( signal ! = null ) {
return signal ( status , body ) ;
}
return orElse ( ) ;
}
@ override
@ optionalTypeArgs
TResult map < TResult extends Object ? > ( {
required TResult Function ( Success value ) success ,
required TResult Function ( Signal value ) signal ,
required TResult Function ( RpcError value ) error ,
} ) {
return signal ( this ) ;
}
@ override
@ optionalTypeArgs
TResult ? mapOrNull < TResult extends Object ? > ( {
2022-10-19 12:15:48 +03:00
TResult ? Function ( Success value ) ? success ,
TResult ? Function ( Signal value ) ? signal ,
TResult ? Function ( RpcError value ) ? error ,
2022-01-27 14:34:29 +03:00
} ) {
return signal ? . call ( this ) ;
}
@ override
@ optionalTypeArgs
TResult maybeMap < TResult extends Object ? > ( {
TResult Function ( Success value ) ? success ,
TResult Function ( Signal value ) ? signal ,
TResult Function ( RpcError value ) ? error ,
required TResult orElse ( ) ,
} ) {
if ( signal ! = null ) {
return signal ( this ) ;
}
return orElse ( ) ;
}
@ override
Map < String , dynamic > toJson ( ) {
2023-11-15 10:56:52 +03:00
return _ $ $SignalImplToJson (
2022-07-21 17:38:45 +03:00
this ,
) ;
2022-01-27 14:34:29 +03:00
}
}
abstract class Signal implements RpcResponse {
2022-05-12 12:06:28 +03:00
factory Signal ( final String status , final Map < String , dynamic > body ) =
2023-11-15 10:56:52 +03:00
_ $SignalImpl ;
2022-01-27 14:34:29 +03:00
2023-11-15 10:56:52 +03:00
factory Signal . fromJson ( Map < String , dynamic > json ) = _ $SignalImpl . fromJson ;
2022-01-27 14:34:29 +03:00
2022-07-07 11:29:42 +03:00
String get status ;
2022-01-27 14:34:29 +03:00
@ override
2022-07-07 11:29:42 +03:00
Map < String , dynamic > get body ;
2022-01-27 14:34:29 +03:00
@ override
@ JsonKey ( ignore: true )
2023-11-15 10:56:52 +03:00
_ $ $SignalImplCopyWith < _ $SignalImpl > get copyWith = >
2022-05-12 12:06:28 +03:00
throw _privateConstructorUsedError ;
2022-01-27 14:34:29 +03:00
}
/// @nodoc
2023-11-15 10:56:52 +03:00
abstract class _ $ $RpcErrorImplCopyWith < $Res >
implements $RpcResponseCopyWith < $Res > {
factory _ $ $RpcErrorImplCopyWith (
_ $RpcErrorImpl value , $Res Function ( _ $RpcErrorImpl ) then ) =
__ $ $RpcErrorImplCopyWithImpl < $Res > ;
2022-01-27 14:34:29 +03:00
@ override
2022-10-19 12:15:48 +03:00
@ useResult
2022-01-27 14:34:29 +03:00
$Res call ( { String status , String message , Map < String , dynamic > body } ) ;
}
/// @nodoc
2023-11-15 10:56:52 +03:00
class __ $ $RpcErrorImplCopyWithImpl < $Res >
extends _ $RpcResponseCopyWithImpl < $Res , _ $RpcErrorImpl >
implements _ $ $RpcErrorImplCopyWith < $Res > {
__ $ $RpcErrorImplCopyWithImpl (
_ $RpcErrorImpl _value , $Res Function ( _ $RpcErrorImpl ) _then )
2022-10-19 12:15:48 +03:00
: super ( _value , _then ) ;
2022-01-27 14:34:29 +03:00
2022-10-19 12:15:48 +03:00
@ pragma ( ' vm:prefer-inline ' )
2022-01-27 14:34:29 +03:00
@ override
$Res call ( {
2022-10-19 12:15:48 +03:00
Object ? status = null ,
Object ? message = null ,
Object ? body = null ,
2022-01-27 14:34:29 +03:00
} ) {
2023-11-15 10:56:52 +03:00
return _then ( _ $RpcErrorImpl (
2022-10-19 12:15:48 +03:00
null = = status
2022-01-27 14:34:29 +03:00
? _value . status
: status // ignore: cast_nullable_to_non_nullable
as String ,
2022-10-19 12:15:48 +03:00
null = = message
2022-01-27 14:34:29 +03:00
? _value . message
: message // ignore: cast_nullable_to_non_nullable
as String ,
2022-10-19 12:15:48 +03:00
null = = body
2022-05-12 12:06:28 +03:00
? _value . _body
2022-01-27 14:34:29 +03:00
: body // ignore: cast_nullable_to_non_nullable
as Map < String , dynamic > ,
) ) ;
}
}
/// @nodoc
@ JsonSerializable ( )
2023-11-15 10:56:52 +03:00
class _ $RpcErrorImpl implements RpcError {
_ $RpcErrorImpl ( this . status , this . message , final Map < String , dynamic > body ,
2022-05-12 12:06:28 +03:00
{ final String ? $type } )
: _body = body ,
$type = $type ? ? ' error ' ;
2022-01-27 14:34:29 +03:00
2023-11-15 10:56:52 +03:00
factory _ $RpcErrorImpl . fromJson ( Map < String , dynamic > json ) = >
_ $ $RpcErrorImplFromJson ( json ) ;
2022-01-27 14:34:29 +03:00
@ override
final String status ;
@ override
final String message ;
2022-05-12 12:06:28 +03:00
final Map < String , dynamic > _body ;
2022-01-27 14:34:29 +03:00
@ override
2022-05-12 12:06:28 +03:00
Map < String , dynamic > get body {
2022-12-05 17:26:54 +03:00
if ( _body is EqualUnmodifiableMapView ) return _body ;
2022-05-12 12:06:28 +03:00
// ignore: implicit_dynamic_type
return EqualUnmodifiableMapView ( _body ) ;
}
2022-01-27 14:34:29 +03:00
@ JsonKey ( name: ' kind ' )
final String $type ;
@ override
String toString ( ) {
return ' RpcResponse.error(status: $ status , message: $ message , body: $ body ) ' ;
}
@ override
2024-02-02 15:52:22 +03:00
bool operator = = ( Object other ) {
2022-01-27 14:34:29 +03:00
return identical ( this , other ) | |
( other . runtimeType = = runtimeType & &
2023-11-15 10:56:52 +03:00
other is _ $RpcErrorImpl & &
2022-10-19 12:15:48 +03:00
( identical ( other . status , status ) | | other . status = = status ) & &
( identical ( other . message , message ) | | other . message = = message ) & &
2022-05-12 12:06:28 +03:00
const DeepCollectionEquality ( ) . equals ( other . _body , _body ) ) ;
2022-01-27 14:34:29 +03:00
}
2022-05-12 12:06:28 +03:00
@ JsonKey ( ignore: true )
2022-01-27 14:34:29 +03:00
@ override
int get hashCode = > Object . hash (
2022-10-19 12:15:48 +03:00
runtimeType , status , message , const DeepCollectionEquality ( ) . hash ( _body ) ) ;
2022-01-27 14:34:29 +03:00
@ JsonKey ( ignore: true )
@ override
2022-10-19 12:15:48 +03:00
@ pragma ( ' vm:prefer-inline ' )
2023-11-15 10:56:52 +03:00
_ $ $RpcErrorImplCopyWith < _ $RpcErrorImpl > get copyWith = >
__ $ $RpcErrorImplCopyWithImpl < _ $RpcErrorImpl > ( this , _ $identity ) ;
2022-01-27 14:34:29 +03:00
@ override
@ optionalTypeArgs
TResult when < TResult extends Object ? > ( {
2024-07-09 16:14:29 +03:00
required TResult Function ( Map < String , dynamic > body , List < String > flags )
success ,
2022-01-27 14:34:29 +03:00
required TResult Function ( String status , Map < String , dynamic > body ) signal ,
required TResult Function (
String status , String message , Map < String , dynamic > body )
error ,
} ) {
return error ( status , message , body ) ;
}
@ override
@ optionalTypeArgs
TResult ? whenOrNull < TResult extends Object ? > ( {
2024-07-09 16:14:29 +03:00
TResult ? Function ( Map < String , dynamic > body , List < String > flags ) ? success ,
2022-10-19 12:15:48 +03:00
TResult ? Function ( String status , Map < String , dynamic > body ) ? signal ,
TResult ? Function ( String status , String message , Map < String , dynamic > body ) ?
2022-01-27 14:34:29 +03:00
error ,
} ) {
return error ? . call ( status , message , body ) ;
}
@ override
@ optionalTypeArgs
TResult maybeWhen < TResult extends Object ? > ( {
2024-07-09 16:14:29 +03:00
TResult Function ( Map < String , dynamic > body , List < String > flags ) ? success ,
2022-01-27 14:34:29 +03:00
TResult Function ( String status , Map < String , dynamic > body ) ? signal ,
TResult Function ( String status , String message , Map < String , dynamic > body ) ?
error ,
required TResult orElse ( ) ,
} ) {
if ( error ! = null ) {
return error ( status , message , body ) ;
}
return orElse ( ) ;
}
@ override
@ optionalTypeArgs
TResult map < TResult extends Object ? > ( {
required TResult Function ( Success value ) success ,
required TResult Function ( Signal value ) signal ,
required TResult Function ( RpcError value ) error ,
} ) {
return error ( this ) ;
}
@ override
@ optionalTypeArgs
TResult ? mapOrNull < TResult extends Object ? > ( {
2022-10-19 12:15:48 +03:00
TResult ? Function ( Success value ) ? success ,
TResult ? Function ( Signal value ) ? signal ,
TResult ? Function ( RpcError value ) ? error ,
2022-01-27 14:34:29 +03:00
} ) {
return error ? . call ( this ) ;
}
@ override
@ optionalTypeArgs
TResult maybeMap < TResult extends Object ? > ( {
TResult Function ( Success value ) ? success ,
TResult Function ( Signal value ) ? signal ,
TResult Function ( RpcError value ) ? error ,
required TResult orElse ( ) ,
} ) {
if ( error ! = null ) {
return error ( this ) ;
}
return orElse ( ) ;
}
@ override
Map < String , dynamic > toJson ( ) {
2023-11-15 10:56:52 +03:00
return _ $ $RpcErrorImplToJson (
2022-07-21 17:38:45 +03:00
this ,
) ;
2022-01-27 14:34:29 +03:00
}
}
abstract class RpcError implements RpcResponse {
2022-05-12 12:06:28 +03:00
factory RpcError ( final String status , final String message ,
2023-11-15 10:56:52 +03:00
final Map < String , dynamic > body ) = _ $RpcErrorImpl ;
2022-01-27 14:34:29 +03:00
2023-11-15 10:56:52 +03:00
factory RpcError . fromJson ( Map < String , dynamic > json ) =
_ $RpcErrorImpl . fromJson ;
2022-01-27 14:34:29 +03:00
2022-07-07 11:29:42 +03:00
String get status ;
String get message ;
2022-01-27 14:34:29 +03:00
@ override
2022-07-07 11:29:42 +03:00
Map < String , dynamic > get body ;
2022-01-27 14:34:29 +03:00
@ override
@ JsonKey ( ignore: true )
2023-11-15 10:56:52 +03:00
_ $ $RpcErrorImplCopyWith < _ $RpcErrorImpl > get copyWith = >
2022-01-27 14:34:29 +03:00
throw _privateConstructorUsedError ;
}
2022-03-16 16:55:21 +03:00
RpcState _ $RpcStateFromJson ( Map < String , dynamic > json ) {
return _RpcState . fromJson ( json ) ;
}
2022-01-27 14:34:29 +03:00
/// @nodoc
mixin _ $RpcState {
String get version = > throw _privateConstructorUsedError ;
2022-03-16 16:55:21 +03:00
bool get isAdmin = > throw _privateConstructorUsedError ;
2022-01-27 14:34:29 +03:00
2022-03-16 16:55:21 +03:00
Map < String , dynamic > toJson ( ) = > throw _privateConstructorUsedError ;
2022-01-27 14:34:29 +03:00
@ JsonKey ( ignore: true )
$RpcStateCopyWith < RpcState > get copyWith = >
throw _privateConstructorUsedError ;
}
/// @nodoc
abstract class $RpcStateCopyWith < $Res > {
factory $RpcStateCopyWith ( RpcState value , $Res Function ( RpcState ) then ) =
2022-10-19 12:15:48 +03:00
_ $RpcStateCopyWithImpl < $Res , RpcState > ;
@ useResult
2022-03-16 16:55:21 +03:00
$Res call ( { String version , bool isAdmin } ) ;
2022-01-27 14:34:29 +03:00
}
/// @nodoc
2022-10-19 12:15:48 +03:00
class _ $RpcStateCopyWithImpl < $Res , $Val extends RpcState >
implements $RpcStateCopyWith < $Res > {
2022-01-27 14:34:29 +03:00
_ $RpcStateCopyWithImpl ( this . _value , this . _then ) ;
// ignore: unused_field
2022-10-19 12:15:48 +03:00
final $Val _value ;
// ignore: unused_field
final $Res Function ( $Val ) _then ;
2022-01-27 14:34:29 +03:00
2022-10-19 12:15:48 +03:00
@ pragma ( ' vm:prefer-inline ' )
2022-01-27 14:34:29 +03:00
@ override
$Res call ( {
2022-10-19 12:15:48 +03:00
Object ? version = null ,
Object ? isAdmin = null ,
2022-01-27 14:34:29 +03:00
} ) {
return _then ( _value . copyWith (
2022-10-19 12:15:48 +03:00
version: null = = version
2022-01-27 14:34:29 +03:00
? _value . version
: version // ignore: cast_nullable_to_non_nullable
as String ,
2022-10-19 12:15:48 +03:00
isAdmin: null = = isAdmin
2022-03-16 16:55:21 +03:00
? _value . isAdmin
: isAdmin // ignore: cast_nullable_to_non_nullable
as bool ,
2022-10-19 12:15:48 +03:00
) as $Val ) ;
2022-01-27 14:34:29 +03:00
}
}
/// @nodoc
2023-11-15 10:56:52 +03:00
abstract class _ $ $RpcStateImplCopyWith < $Res >
implements $RpcStateCopyWith < $Res > {
factory _ $ $RpcStateImplCopyWith (
_ $RpcStateImpl value , $Res Function ( _ $RpcStateImpl ) then ) =
__ $ $RpcStateImplCopyWithImpl < $Res > ;
2022-01-27 14:34:29 +03:00
@ override
2022-10-19 12:15:48 +03:00
@ useResult
2022-03-16 16:55:21 +03:00
$Res call ( { String version , bool isAdmin } ) ;
2022-01-27 14:34:29 +03:00
}
/// @nodoc
2023-11-15 10:56:52 +03:00
class __ $ $RpcStateImplCopyWithImpl < $Res >
extends _ $RpcStateCopyWithImpl < $Res , _ $RpcStateImpl >
implements _ $ $RpcStateImplCopyWith < $Res > {
__ $ $RpcStateImplCopyWithImpl (
_ $RpcStateImpl _value , $Res Function ( _ $RpcStateImpl ) _then )
2022-10-19 12:15:48 +03:00
: super ( _value , _then ) ;
2022-01-27 14:34:29 +03:00
2022-10-19 12:15:48 +03:00
@ pragma ( ' vm:prefer-inline ' )
2022-01-27 14:34:29 +03:00
@ override
$Res call ( {
2022-10-19 12:15:48 +03:00
Object ? version = null ,
Object ? isAdmin = null ,
2022-01-27 14:34:29 +03:00
} ) {
2023-11-15 10:56:52 +03:00
return _then ( _ $RpcStateImpl (
2022-10-19 12:15:48 +03:00
null = = version
2022-01-27 14:34:29 +03:00
? _value . version
: version // ignore: cast_nullable_to_non_nullable
as String ,
2022-10-19 12:15:48 +03:00
null = = isAdmin
2022-03-16 16:55:21 +03:00
? _value . isAdmin
: isAdmin // ignore: cast_nullable_to_non_nullable
as bool ,
2022-01-27 14:34:29 +03:00
) ) ;
}
}
/// @nodoc
2022-03-16 16:55:21 +03:00
@ JsonSerializable ( )
2023-11-15 10:56:52 +03:00
class _ $RpcStateImpl implements _RpcState {
const _ $RpcStateImpl ( this . version , this . isAdmin ) ;
2022-03-16 16:55:21 +03:00
2023-11-15 10:56:52 +03:00
factory _ $RpcStateImpl . fromJson ( Map < String , dynamic > json ) = >
_ $ $RpcStateImplFromJson ( json ) ;
2022-01-27 14:34:29 +03:00
@ override
final String version ;
2022-03-16 16:55:21 +03:00
@ override
final bool isAdmin ;
2022-01-27 14:34:29 +03:00
@ override
String toString ( ) {
2022-03-16 16:55:21 +03:00
return ' RpcState(version: $ version , isAdmin: $ isAdmin ) ' ;
2022-01-27 14:34:29 +03:00
}
@ override
2024-02-02 15:52:22 +03:00
bool operator = = ( Object other ) {
2022-01-27 14:34:29 +03:00
return identical ( this , other ) | |
( other . runtimeType = = runtimeType & &
2023-11-15 10:56:52 +03:00
other is _ $RpcStateImpl & &
2022-10-19 12:15:48 +03:00
( identical ( other . version , version ) | | other . version = = version ) & &
( identical ( other . isAdmin , isAdmin ) | | other . isAdmin = = isAdmin ) ) ;
2022-01-27 14:34:29 +03:00
}
2022-05-12 12:06:28 +03:00
@ JsonKey ( ignore: true )
2022-01-27 14:34:29 +03:00
@ override
2022-10-19 12:15:48 +03:00
int get hashCode = > Object . hash ( runtimeType , version , isAdmin ) ;
2022-01-27 14:34:29 +03:00
@ JsonKey ( ignore: true )
@ override
2022-10-19 12:15:48 +03:00
@ pragma ( ' vm:prefer-inline ' )
2023-11-15 10:56:52 +03:00
_ $ $RpcStateImplCopyWith < _ $RpcStateImpl > get copyWith = >
__ $ $RpcStateImplCopyWithImpl < _ $RpcStateImpl > ( this , _ $identity ) ;
2022-03-16 16:55:21 +03:00
@ override
Map < String , dynamic > toJson ( ) {
2023-11-15 10:56:52 +03:00
return _ $ $RpcStateImplToJson (
2022-07-21 17:38:45 +03:00
this ,
) ;
2022-03-16 16:55:21 +03:00
}
2022-01-27 14:34:29 +03:00
}
abstract class _RpcState implements RpcState {
2022-05-12 12:06:28 +03:00
const factory _RpcState ( final String version , final bool isAdmin ) =
2023-11-15 10:56:52 +03:00
_ $RpcStateImpl ;
2022-03-16 16:55:21 +03:00
2023-11-15 10:56:52 +03:00
factory _RpcState . fromJson ( Map < String , dynamic > json ) =
_ $RpcStateImpl . fromJson ;
2022-01-27 14:34:29 +03:00
@ override
2022-07-07 11:29:42 +03:00
String get version ;
2022-01-27 14:34:29 +03:00
@ override
2022-07-07 11:29:42 +03:00
bool get isAdmin ;
2022-03-16 16:55:21 +03:00
@ override
2022-01-27 14:34:29 +03:00
@ JsonKey ( ignore: true )
2023-11-15 10:56:52 +03:00
_ $ $RpcStateImplCopyWith < _ $RpcStateImpl > get copyWith = >
2022-01-27 14:34:29 +03:00
throw _privateConstructorUsedError ;
}