Files
sm-emby-share/lib/core/contracts/auth.freezed.dart
T
2026-07-14 11:11:36 +08:00

1120 lines
38 KiB
Dart
Generated

// GENERATED CODE - DO NOT MODIFY BY HAND
// coverage:ignore-file
// 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 'auth.dart';
// **************************************************************************
// FreezedGenerator
// **************************************************************************
// dart format off
T _$identity<T>(T value) => value;
/// @nodoc
mixin _$AuthByNameReq {
String get serverId; String get username; String get password;
/// Create a copy of AuthByNameReq
/// with the given fields replaced by the non-null parameter values.
@JsonKey(includeFromJson: false, includeToJson: false)
@pragma('vm:prefer-inline')
$AuthByNameReqCopyWith<AuthByNameReq> get copyWith => _$AuthByNameReqCopyWithImpl<AuthByNameReq>(this as AuthByNameReq, _$identity);
/// Serializes this AuthByNameReq to a JSON map.
Map<String, dynamic> toJson();
@override
bool operator ==(Object other) {
return identical(this, other) || (other.runtimeType == runtimeType&&other is AuthByNameReq&&(identical(other.serverId, serverId) || other.serverId == serverId)&&(identical(other.username, username) || other.username == username)&&(identical(other.password, password) || other.password == password));
}
@JsonKey(includeFromJson: false, includeToJson: false)
@override
int get hashCode => Object.hash(runtimeType,serverId,username,password);
@override
String toString() {
return 'AuthByNameReq(serverId: $serverId, username: $username, password: $password)';
}
}
/// @nodoc
abstract mixin class $AuthByNameReqCopyWith<$Res> {
factory $AuthByNameReqCopyWith(AuthByNameReq value, $Res Function(AuthByNameReq) _then) = _$AuthByNameReqCopyWithImpl;
@useResult
$Res call({
String serverId, String username, String password
});
}
/// @nodoc
class _$AuthByNameReqCopyWithImpl<$Res>
implements $AuthByNameReqCopyWith<$Res> {
_$AuthByNameReqCopyWithImpl(this._self, this._then);
final AuthByNameReq _self;
final $Res Function(AuthByNameReq) _then;
/// Create a copy of AuthByNameReq
/// with the given fields replaced by the non-null parameter values.
@pragma('vm:prefer-inline') @override $Res call({Object? serverId = null,Object? username = null,Object? password = null,}) {
return _then(_self.copyWith(
serverId: null == serverId ? _self.serverId : serverId // ignore: cast_nullable_to_non_nullable
as String,username: null == username ? _self.username : username // ignore: cast_nullable_to_non_nullable
as String,password: null == password ? _self.password : password // ignore: cast_nullable_to_non_nullable
as String,
));
}
}
/// Adds pattern-matching-related methods to [AuthByNameReq].
extension AuthByNameReqPatterns on AuthByNameReq {
/// 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 extends Object?>(TResult Function( _AuthByNameReq value)? $default,{required TResult orElse(),}){
final _that = this;
switch (_that) {
case _AuthByNameReq() when $default != null:
return $default(_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<TResult extends Object?>(TResult Function( _AuthByNameReq value) $default,){
final _that = this;
switch (_that) {
case _AuthByNameReq():
return $default(_that);case _:
throw StateError('Unexpected subclass');
}
}
/// 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 extends Object?>(TResult? Function( _AuthByNameReq value)? $default,){
final _that = this;
switch (_that) {
case _AuthByNameReq() when $default != null:
return $default(_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 extends Object?>(TResult Function( String serverId, String username, String password)? $default,{required TResult orElse(),}) {final _that = this;
switch (_that) {
case _AuthByNameReq() when $default != null:
return $default(_that.serverId,_that.username,_that.password);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<TResult extends Object?>(TResult Function( String serverId, String username, String password) $default,) {final _that = this;
switch (_that) {
case _AuthByNameReq():
return $default(_that.serverId,_that.username,_that.password);case _:
throw StateError('Unexpected subclass');
}
}
/// 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 extends Object?>(TResult? Function( String serverId, String username, String password)? $default,) {final _that = this;
switch (_that) {
case _AuthByNameReq() when $default != null:
return $default(_that.serverId,_that.username,_that.password);case _:
return null;
}
}
}
/// @nodoc
@JsonSerializable()
class _AuthByNameReq implements AuthByNameReq {
const _AuthByNameReq({required this.serverId, required this.username, required this.password});
factory _AuthByNameReq.fromJson(Map<String, dynamic> json) => _$AuthByNameReqFromJson(json);
@override final String serverId;
@override final String username;
@override final String password;
/// Create a copy of AuthByNameReq
/// with the given fields replaced by the non-null parameter values.
@override @JsonKey(includeFromJson: false, includeToJson: false)
@pragma('vm:prefer-inline')
_$AuthByNameReqCopyWith<_AuthByNameReq> get copyWith => __$AuthByNameReqCopyWithImpl<_AuthByNameReq>(this, _$identity);
@override
Map<String, dynamic> toJson() {
return _$AuthByNameReqToJson(this, );
}
@override
bool operator ==(Object other) {
return identical(this, other) || (other.runtimeType == runtimeType&&other is _AuthByNameReq&&(identical(other.serverId, serverId) || other.serverId == serverId)&&(identical(other.username, username) || other.username == username)&&(identical(other.password, password) || other.password == password));
}
@JsonKey(includeFromJson: false, includeToJson: false)
@override
int get hashCode => Object.hash(runtimeType,serverId,username,password);
@override
String toString() {
return 'AuthByNameReq(serverId: $serverId, username: $username, password: $password)';
}
}
/// @nodoc
abstract mixin class _$AuthByNameReqCopyWith<$Res> implements $AuthByNameReqCopyWith<$Res> {
factory _$AuthByNameReqCopyWith(_AuthByNameReq value, $Res Function(_AuthByNameReq) _then) = __$AuthByNameReqCopyWithImpl;
@override @useResult
$Res call({
String serverId, String username, String password
});
}
/// @nodoc
class __$AuthByNameReqCopyWithImpl<$Res>
implements _$AuthByNameReqCopyWith<$Res> {
__$AuthByNameReqCopyWithImpl(this._self, this._then);
final _AuthByNameReq _self;
final $Res Function(_AuthByNameReq) _then;
/// Create a copy of AuthByNameReq
/// with the given fields replaced by the non-null parameter values.
@override @pragma('vm:prefer-inline') $Res call({Object? serverId = null,Object? username = null,Object? password = null,}) {
return _then(_AuthByNameReq(
serverId: null == serverId ? _self.serverId : serverId // ignore: cast_nullable_to_non_nullable
as String,username: null == username ? _self.username : username // ignore: cast_nullable_to_non_nullable
as String,password: null == password ? _self.password : password // ignore: cast_nullable_to_non_nullable
as String,
));
}
}
/// @nodoc
mixin _$SessionData {
String get serverId; String get token; String get userId; String get userName;@JsonKey(includeIfNull: false) String? get password; String get createdAt;
/// Create a copy of SessionData
/// with the given fields replaced by the non-null parameter values.
@JsonKey(includeFromJson: false, includeToJson: false)
@pragma('vm:prefer-inline')
$SessionDataCopyWith<SessionData> get copyWith => _$SessionDataCopyWithImpl<SessionData>(this as SessionData, _$identity);
/// Serializes this SessionData to a JSON map.
Map<String, dynamic> toJson();
@override
bool operator ==(Object other) {
return identical(this, other) || (other.runtimeType == runtimeType&&other is SessionData&&(identical(other.serverId, serverId) || other.serverId == serverId)&&(identical(other.token, token) || other.token == token)&&(identical(other.userId, userId) || other.userId == userId)&&(identical(other.userName, userName) || other.userName == userName)&&(identical(other.password, password) || other.password == password)&&(identical(other.createdAt, createdAt) || other.createdAt == createdAt));
}
@JsonKey(includeFromJson: false, includeToJson: false)
@override
int get hashCode => Object.hash(runtimeType,serverId,token,userId,userName,password,createdAt);
@override
String toString() {
return 'SessionData(serverId: $serverId, token: $token, userId: $userId, userName: $userName, password: $password, createdAt: $createdAt)';
}
}
/// @nodoc
abstract mixin class $SessionDataCopyWith<$Res> {
factory $SessionDataCopyWith(SessionData value, $Res Function(SessionData) _then) = _$SessionDataCopyWithImpl;
@useResult
$Res call({
String serverId, String token, String userId, String userName,@JsonKey(includeIfNull: false) String? password, String createdAt
});
}
/// @nodoc
class _$SessionDataCopyWithImpl<$Res>
implements $SessionDataCopyWith<$Res> {
_$SessionDataCopyWithImpl(this._self, this._then);
final SessionData _self;
final $Res Function(SessionData) _then;
/// Create a copy of SessionData
/// with the given fields replaced by the non-null parameter values.
@pragma('vm:prefer-inline') @override $Res call({Object? serverId = null,Object? token = null,Object? userId = null,Object? userName = null,Object? password = freezed,Object? createdAt = null,}) {
return _then(_self.copyWith(
serverId: null == serverId ? _self.serverId : serverId // ignore: cast_nullable_to_non_nullable
as String,token: null == token ? _self.token : token // ignore: cast_nullable_to_non_nullable
as String,userId: null == userId ? _self.userId : userId // ignore: cast_nullable_to_non_nullable
as String,userName: null == userName ? _self.userName : userName // ignore: cast_nullable_to_non_nullable
as String,password: freezed == password ? _self.password : password // ignore: cast_nullable_to_non_nullable
as String?,createdAt: null == createdAt ? _self.createdAt : createdAt // ignore: cast_nullable_to_non_nullable
as String,
));
}
}
/// Adds pattern-matching-related methods to [SessionData].
extension SessionDataPatterns on SessionData {
/// 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 extends Object?>(TResult Function( _SessionData value)? $default,{required TResult orElse(),}){
final _that = this;
switch (_that) {
case _SessionData() when $default != null:
return $default(_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<TResult extends Object?>(TResult Function( _SessionData value) $default,){
final _that = this;
switch (_that) {
case _SessionData():
return $default(_that);case _:
throw StateError('Unexpected subclass');
}
}
/// 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 extends Object?>(TResult? Function( _SessionData value)? $default,){
final _that = this;
switch (_that) {
case _SessionData() when $default != null:
return $default(_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 extends Object?>(TResult Function( String serverId, String token, String userId, String userName, @JsonKey(includeIfNull: false) String? password, String createdAt)? $default,{required TResult orElse(),}) {final _that = this;
switch (_that) {
case _SessionData() when $default != null:
return $default(_that.serverId,_that.token,_that.userId,_that.userName,_that.password,_that.createdAt);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<TResult extends Object?>(TResult Function( String serverId, String token, String userId, String userName, @JsonKey(includeIfNull: false) String? password, String createdAt) $default,) {final _that = this;
switch (_that) {
case _SessionData():
return $default(_that.serverId,_that.token,_that.userId,_that.userName,_that.password,_that.createdAt);case _:
throw StateError('Unexpected subclass');
}
}
/// 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 extends Object?>(TResult? Function( String serverId, String token, String userId, String userName, @JsonKey(includeIfNull: false) String? password, String createdAt)? $default,) {final _that = this;
switch (_that) {
case _SessionData() when $default != null:
return $default(_that.serverId,_that.token,_that.userId,_that.userName,_that.password,_that.createdAt);case _:
return null;
}
}
}
/// @nodoc
@JsonSerializable()
class _SessionData implements SessionData {
const _SessionData({required this.serverId, required this.token, required this.userId, required this.userName, @JsonKey(includeIfNull: false) this.password, required this.createdAt});
factory _SessionData.fromJson(Map<String, dynamic> json) => _$SessionDataFromJson(json);
@override final String serverId;
@override final String token;
@override final String userId;
@override final String userName;
@override@JsonKey(includeIfNull: false) final String? password;
@override final String createdAt;
/// Create a copy of SessionData
/// with the given fields replaced by the non-null parameter values.
@override @JsonKey(includeFromJson: false, includeToJson: false)
@pragma('vm:prefer-inline')
_$SessionDataCopyWith<_SessionData> get copyWith => __$SessionDataCopyWithImpl<_SessionData>(this, _$identity);
@override
Map<String, dynamic> toJson() {
return _$SessionDataToJson(this, );
}
@override
bool operator ==(Object other) {
return identical(this, other) || (other.runtimeType == runtimeType&&other is _SessionData&&(identical(other.serverId, serverId) || other.serverId == serverId)&&(identical(other.token, token) || other.token == token)&&(identical(other.userId, userId) || other.userId == userId)&&(identical(other.userName, userName) || other.userName == userName)&&(identical(other.password, password) || other.password == password)&&(identical(other.createdAt, createdAt) || other.createdAt == createdAt));
}
@JsonKey(includeFromJson: false, includeToJson: false)
@override
int get hashCode => Object.hash(runtimeType,serverId,token,userId,userName,password,createdAt);
@override
String toString() {
return 'SessionData(serverId: $serverId, token: $token, userId: $userId, userName: $userName, password: $password, createdAt: $createdAt)';
}
}
/// @nodoc
abstract mixin class _$SessionDataCopyWith<$Res> implements $SessionDataCopyWith<$Res> {
factory _$SessionDataCopyWith(_SessionData value, $Res Function(_SessionData) _then) = __$SessionDataCopyWithImpl;
@override @useResult
$Res call({
String serverId, String token, String userId, String userName,@JsonKey(includeIfNull: false) String? password, String createdAt
});
}
/// @nodoc
class __$SessionDataCopyWithImpl<$Res>
implements _$SessionDataCopyWith<$Res> {
__$SessionDataCopyWithImpl(this._self, this._then);
final _SessionData _self;
final $Res Function(_SessionData) _then;
/// Create a copy of SessionData
/// with the given fields replaced by the non-null parameter values.
@override @pragma('vm:prefer-inline') $Res call({Object? serverId = null,Object? token = null,Object? userId = null,Object? userName = null,Object? password = freezed,Object? createdAt = null,}) {
return _then(_SessionData(
serverId: null == serverId ? _self.serverId : serverId // ignore: cast_nullable_to_non_nullable
as String,token: null == token ? _self.token : token // ignore: cast_nullable_to_non_nullable
as String,userId: null == userId ? _self.userId : userId // ignore: cast_nullable_to_non_nullable
as String,userName: null == userName ? _self.userName : userName // ignore: cast_nullable_to_non_nullable
as String,password: freezed == password ? _self.password : password // ignore: cast_nullable_to_non_nullable
as String?,createdAt: null == createdAt ? _self.createdAt : createdAt // ignore: cast_nullable_to_non_nullable
as String,
));
}
}
/// @nodoc
mixin _$AuthedSession {
String get serverId; String get serverName; String get serverUrl; String get token; String get userId; String get userName;@JsonKey(includeIfNull: false) String? get password; bool get isActive;
/// Create a copy of AuthedSession
/// with the given fields replaced by the non-null parameter values.
@JsonKey(includeFromJson: false, includeToJson: false)
@pragma('vm:prefer-inline')
$AuthedSessionCopyWith<AuthedSession> get copyWith => _$AuthedSessionCopyWithImpl<AuthedSession>(this as AuthedSession, _$identity);
/// Serializes this AuthedSession to a JSON map.
Map<String, dynamic> toJson();
@override
bool operator ==(Object other) {
return identical(this, other) || (other.runtimeType == runtimeType&&other is AuthedSession&&(identical(other.serverId, serverId) || other.serverId == serverId)&&(identical(other.serverName, serverName) || other.serverName == serverName)&&(identical(other.serverUrl, serverUrl) || other.serverUrl == serverUrl)&&(identical(other.token, token) || other.token == token)&&(identical(other.userId, userId) || other.userId == userId)&&(identical(other.userName, userName) || other.userName == userName)&&(identical(other.password, password) || other.password == password)&&(identical(other.isActive, isActive) || other.isActive == isActive));
}
@JsonKey(includeFromJson: false, includeToJson: false)
@override
int get hashCode => Object.hash(runtimeType,serverId,serverName,serverUrl,token,userId,userName,password,isActive);
@override
String toString() {
return 'AuthedSession(serverId: $serverId, serverName: $serverName, serverUrl: $serverUrl, token: $token, userId: $userId, userName: $userName, password: $password, isActive: $isActive)';
}
}
/// @nodoc
abstract mixin class $AuthedSessionCopyWith<$Res> {
factory $AuthedSessionCopyWith(AuthedSession value, $Res Function(AuthedSession) _then) = _$AuthedSessionCopyWithImpl;
@useResult
$Res call({
String serverId, String serverName, String serverUrl, String token, String userId, String userName,@JsonKey(includeIfNull: false) String? password, bool isActive
});
}
/// @nodoc
class _$AuthedSessionCopyWithImpl<$Res>
implements $AuthedSessionCopyWith<$Res> {
_$AuthedSessionCopyWithImpl(this._self, this._then);
final AuthedSession _self;
final $Res Function(AuthedSession) _then;
/// Create a copy of AuthedSession
/// with the given fields replaced by the non-null parameter values.
@pragma('vm:prefer-inline') @override $Res call({Object? serverId = null,Object? serverName = null,Object? serverUrl = null,Object? token = null,Object? userId = null,Object? userName = null,Object? password = freezed,Object? isActive = null,}) {
return _then(_self.copyWith(
serverId: null == serverId ? _self.serverId : serverId // ignore: cast_nullable_to_non_nullable
as String,serverName: null == serverName ? _self.serverName : serverName // ignore: cast_nullable_to_non_nullable
as String,serverUrl: null == serverUrl ? _self.serverUrl : serverUrl // ignore: cast_nullable_to_non_nullable
as String,token: null == token ? _self.token : token // ignore: cast_nullable_to_non_nullable
as String,userId: null == userId ? _self.userId : userId // ignore: cast_nullable_to_non_nullable
as String,userName: null == userName ? _self.userName : userName // ignore: cast_nullable_to_non_nullable
as String,password: freezed == password ? _self.password : password // ignore: cast_nullable_to_non_nullable
as String?,isActive: null == isActive ? _self.isActive : isActive // ignore: cast_nullable_to_non_nullable
as bool,
));
}
}
/// Adds pattern-matching-related methods to [AuthedSession].
extension AuthedSessionPatterns on AuthedSession {
/// 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 extends Object?>(TResult Function( _AuthedSession value)? $default,{required TResult orElse(),}){
final _that = this;
switch (_that) {
case _AuthedSession() when $default != null:
return $default(_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<TResult extends Object?>(TResult Function( _AuthedSession value) $default,){
final _that = this;
switch (_that) {
case _AuthedSession():
return $default(_that);case _:
throw StateError('Unexpected subclass');
}
}
/// 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 extends Object?>(TResult? Function( _AuthedSession value)? $default,){
final _that = this;
switch (_that) {
case _AuthedSession() when $default != null:
return $default(_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 extends Object?>(TResult Function( String serverId, String serverName, String serverUrl, String token, String userId, String userName, @JsonKey(includeIfNull: false) String? password, bool isActive)? $default,{required TResult orElse(),}) {final _that = this;
switch (_that) {
case _AuthedSession() when $default != null:
return $default(_that.serverId,_that.serverName,_that.serverUrl,_that.token,_that.userId,_that.userName,_that.password,_that.isActive);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<TResult extends Object?>(TResult Function( String serverId, String serverName, String serverUrl, String token, String userId, String userName, @JsonKey(includeIfNull: false) String? password, bool isActive) $default,) {final _that = this;
switch (_that) {
case _AuthedSession():
return $default(_that.serverId,_that.serverName,_that.serverUrl,_that.token,_that.userId,_that.userName,_that.password,_that.isActive);case _:
throw StateError('Unexpected subclass');
}
}
/// 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 extends Object?>(TResult? Function( String serverId, String serverName, String serverUrl, String token, String userId, String userName, @JsonKey(includeIfNull: false) String? password, bool isActive)? $default,) {final _that = this;
switch (_that) {
case _AuthedSession() when $default != null:
return $default(_that.serverId,_that.serverName,_that.serverUrl,_that.token,_that.userId,_that.userName,_that.password,_that.isActive);case _:
return null;
}
}
}
/// @nodoc
@JsonSerializable()
class _AuthedSession implements AuthedSession {
const _AuthedSession({required this.serverId, required this.serverName, required this.serverUrl, required this.token, required this.userId, required this.userName, @JsonKey(includeIfNull: false) this.password, required this.isActive});
factory _AuthedSession.fromJson(Map<String, dynamic> json) => _$AuthedSessionFromJson(json);
@override final String serverId;
@override final String serverName;
@override final String serverUrl;
@override final String token;
@override final String userId;
@override final String userName;
@override@JsonKey(includeIfNull: false) final String? password;
@override final bool isActive;
/// Create a copy of AuthedSession
/// with the given fields replaced by the non-null parameter values.
@override @JsonKey(includeFromJson: false, includeToJson: false)
@pragma('vm:prefer-inline')
_$AuthedSessionCopyWith<_AuthedSession> get copyWith => __$AuthedSessionCopyWithImpl<_AuthedSession>(this, _$identity);
@override
Map<String, dynamic> toJson() {
return _$AuthedSessionToJson(this, );
}
@override
bool operator ==(Object other) {
return identical(this, other) || (other.runtimeType == runtimeType&&other is _AuthedSession&&(identical(other.serverId, serverId) || other.serverId == serverId)&&(identical(other.serverName, serverName) || other.serverName == serverName)&&(identical(other.serverUrl, serverUrl) || other.serverUrl == serverUrl)&&(identical(other.token, token) || other.token == token)&&(identical(other.userId, userId) || other.userId == userId)&&(identical(other.userName, userName) || other.userName == userName)&&(identical(other.password, password) || other.password == password)&&(identical(other.isActive, isActive) || other.isActive == isActive));
}
@JsonKey(includeFromJson: false, includeToJson: false)
@override
int get hashCode => Object.hash(runtimeType,serverId,serverName,serverUrl,token,userId,userName,password,isActive);
@override
String toString() {
return 'AuthedSession(serverId: $serverId, serverName: $serverName, serverUrl: $serverUrl, token: $token, userId: $userId, userName: $userName, password: $password, isActive: $isActive)';
}
}
/// @nodoc
abstract mixin class _$AuthedSessionCopyWith<$Res> implements $AuthedSessionCopyWith<$Res> {
factory _$AuthedSessionCopyWith(_AuthedSession value, $Res Function(_AuthedSession) _then) = __$AuthedSessionCopyWithImpl;
@override @useResult
$Res call({
String serverId, String serverName, String serverUrl, String token, String userId, String userName,@JsonKey(includeIfNull: false) String? password, bool isActive
});
}
/// @nodoc
class __$AuthedSessionCopyWithImpl<$Res>
implements _$AuthedSessionCopyWith<$Res> {
__$AuthedSessionCopyWithImpl(this._self, this._then);
final _AuthedSession _self;
final $Res Function(_AuthedSession) _then;
/// Create a copy of AuthedSession
/// with the given fields replaced by the non-null parameter values.
@override @pragma('vm:prefer-inline') $Res call({Object? serverId = null,Object? serverName = null,Object? serverUrl = null,Object? token = null,Object? userId = null,Object? userName = null,Object? password = freezed,Object? isActive = null,}) {
return _then(_AuthedSession(
serverId: null == serverId ? _self.serverId : serverId // ignore: cast_nullable_to_non_nullable
as String,serverName: null == serverName ? _self.serverName : serverName // ignore: cast_nullable_to_non_nullable
as String,serverUrl: null == serverUrl ? _self.serverUrl : serverUrl // ignore: cast_nullable_to_non_nullable
as String,token: null == token ? _self.token : token // ignore: cast_nullable_to_non_nullable
as String,userId: null == userId ? _self.userId : userId // ignore: cast_nullable_to_non_nullable
as String,userName: null == userName ? _self.userName : userName // ignore: cast_nullable_to_non_nullable
as String,password: freezed == password ? _self.password : password // ignore: cast_nullable_to_non_nullable
as String?,isActive: null == isActive ? _self.isActive : isActive // ignore: cast_nullable_to_non_nullable
as bool,
));
}
}
/// @nodoc
mixin _$SessionListRes {
List<AuthedSession> get sessions;/// 与原手写实现保持一致:activeServerId 为 null 时仍序列化为 `null`,不省略。
String? get activeServerId;
/// Create a copy of SessionListRes
/// with the given fields replaced by the non-null parameter values.
@JsonKey(includeFromJson: false, includeToJson: false)
@pragma('vm:prefer-inline')
$SessionListResCopyWith<SessionListRes> get copyWith => _$SessionListResCopyWithImpl<SessionListRes>(this as SessionListRes, _$identity);
/// Serializes this SessionListRes to a JSON map.
Map<String, dynamic> toJson();
@override
bool operator ==(Object other) {
return identical(this, other) || (other.runtimeType == runtimeType&&other is SessionListRes&&const DeepCollectionEquality().equals(other.sessions, sessions)&&(identical(other.activeServerId, activeServerId) || other.activeServerId == activeServerId));
}
@JsonKey(includeFromJson: false, includeToJson: false)
@override
int get hashCode => Object.hash(runtimeType,const DeepCollectionEquality().hash(sessions),activeServerId);
@override
String toString() {
return 'SessionListRes(sessions: $sessions, activeServerId: $activeServerId)';
}
}
/// @nodoc
abstract mixin class $SessionListResCopyWith<$Res> {
factory $SessionListResCopyWith(SessionListRes value, $Res Function(SessionListRes) _then) = _$SessionListResCopyWithImpl;
@useResult
$Res call({
List<AuthedSession> sessions, String? activeServerId
});
}
/// @nodoc
class _$SessionListResCopyWithImpl<$Res>
implements $SessionListResCopyWith<$Res> {
_$SessionListResCopyWithImpl(this._self, this._then);
final SessionListRes _self;
final $Res Function(SessionListRes) _then;
/// Create a copy of SessionListRes
/// with the given fields replaced by the non-null parameter values.
@pragma('vm:prefer-inline') @override $Res call({Object? sessions = null,Object? activeServerId = freezed,}) {
return _then(_self.copyWith(
sessions: null == sessions ? _self.sessions : sessions // ignore: cast_nullable_to_non_nullable
as List<AuthedSession>,activeServerId: freezed == activeServerId ? _self.activeServerId : activeServerId // ignore: cast_nullable_to_non_nullable
as String?,
));
}
}
/// Adds pattern-matching-related methods to [SessionListRes].
extension SessionListResPatterns on SessionListRes {
/// 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 extends Object?>(TResult Function( _SessionListRes value)? $default,{required TResult orElse(),}){
final _that = this;
switch (_that) {
case _SessionListRes() when $default != null:
return $default(_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<TResult extends Object?>(TResult Function( _SessionListRes value) $default,){
final _that = this;
switch (_that) {
case _SessionListRes():
return $default(_that);case _:
throw StateError('Unexpected subclass');
}
}
/// 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 extends Object?>(TResult? Function( _SessionListRes value)? $default,){
final _that = this;
switch (_that) {
case _SessionListRes() when $default != null:
return $default(_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 extends Object?>(TResult Function( List<AuthedSession> sessions, String? activeServerId)? $default,{required TResult orElse(),}) {final _that = this;
switch (_that) {
case _SessionListRes() when $default != null:
return $default(_that.sessions,_that.activeServerId);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<TResult extends Object?>(TResult Function( List<AuthedSession> sessions, String? activeServerId) $default,) {final _that = this;
switch (_that) {
case _SessionListRes():
return $default(_that.sessions,_that.activeServerId);case _:
throw StateError('Unexpected subclass');
}
}
/// 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 extends Object?>(TResult? Function( List<AuthedSession> sessions, String? activeServerId)? $default,) {final _that = this;
switch (_that) {
case _SessionListRes() when $default != null:
return $default(_that.sessions,_that.activeServerId);case _:
return null;
}
}
}
/// @nodoc
@JsonSerializable()
class _SessionListRes implements SessionListRes {
const _SessionListRes({required final List<AuthedSession> sessions, this.activeServerId}): _sessions = sessions;
factory _SessionListRes.fromJson(Map<String, dynamic> json) => _$SessionListResFromJson(json);
final List<AuthedSession> _sessions;
@override List<AuthedSession> get sessions {
if (_sessions is EqualUnmodifiableListView) return _sessions;
// ignore: implicit_dynamic_type
return EqualUnmodifiableListView(_sessions);
}
/// 与原手写实现保持一致:activeServerId 为 null 时仍序列化为 `null`,不省略。
@override final String? activeServerId;
/// Create a copy of SessionListRes
/// with the given fields replaced by the non-null parameter values.
@override @JsonKey(includeFromJson: false, includeToJson: false)
@pragma('vm:prefer-inline')
_$SessionListResCopyWith<_SessionListRes> get copyWith => __$SessionListResCopyWithImpl<_SessionListRes>(this, _$identity);
@override
Map<String, dynamic> toJson() {
return _$SessionListResToJson(this, );
}
@override
bool operator ==(Object other) {
return identical(this, other) || (other.runtimeType == runtimeType&&other is _SessionListRes&&const DeepCollectionEquality().equals(other._sessions, _sessions)&&(identical(other.activeServerId, activeServerId) || other.activeServerId == activeServerId));
}
@JsonKey(includeFromJson: false, includeToJson: false)
@override
int get hashCode => Object.hash(runtimeType,const DeepCollectionEquality().hash(_sessions),activeServerId);
@override
String toString() {
return 'SessionListRes(sessions: $sessions, activeServerId: $activeServerId)';
}
}
/// @nodoc
abstract mixin class _$SessionListResCopyWith<$Res> implements $SessionListResCopyWith<$Res> {
factory _$SessionListResCopyWith(_SessionListRes value, $Res Function(_SessionListRes) _then) = __$SessionListResCopyWithImpl;
@override @useResult
$Res call({
List<AuthedSession> sessions, String? activeServerId
});
}
/// @nodoc
class __$SessionListResCopyWithImpl<$Res>
implements _$SessionListResCopyWith<$Res> {
__$SessionListResCopyWithImpl(this._self, this._then);
final _SessionListRes _self;
final $Res Function(_SessionListRes) _then;
/// Create a copy of SessionListRes
/// with the given fields replaced by the non-null parameter values.
@override @pragma('vm:prefer-inline') $Res call({Object? sessions = null,Object? activeServerId = freezed,}) {
return _then(_SessionListRes(
sessions: null == sessions ? _self._sessions : sessions // ignore: cast_nullable_to_non_nullable
as List<AuthedSession>,activeServerId: freezed == activeServerId ? _self.activeServerId : activeServerId // ignore: cast_nullable_to_non_nullable
as String?,
));
}
}
// dart format on