2026-02-09 18:03:55 +08:00

933 lines
36 KiB
Dart

// 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 'device.dart';
// **************************************************************************
// FreezedGenerator
// **************************************************************************
// dart format off
T _$identity<T>(T value) => value;
/// @nodoc
mixin _$DeviceType {
int get id; String get brand; String get productCode; String get name; bool get isNetworkRequired; bool get isActive; String? get createdAt;
/// Create a copy of DeviceType
/// with the given fields replaced by the non-null parameter values.
@JsonKey(includeFromJson: false, includeToJson: false)
@pragma('vm:prefer-inline')
$DeviceTypeCopyWith<DeviceType> get copyWith => _$DeviceTypeCopyWithImpl<DeviceType>(this as DeviceType, _$identity);
/// Serializes this DeviceType to a JSON map.
Map<String, dynamic> toJson();
@override
bool operator ==(Object other) {
return identical(this, other) || (other.runtimeType == runtimeType&&other is DeviceType&&(identical(other.id, id) || other.id == id)&&(identical(other.brand, brand) || other.brand == brand)&&(identical(other.productCode, productCode) || other.productCode == productCode)&&(identical(other.name, name) || other.name == name)&&(identical(other.isNetworkRequired, isNetworkRequired) || other.isNetworkRequired == isNetworkRequired)&&(identical(other.isActive, isActive) || other.isActive == isActive)&&(identical(other.createdAt, createdAt) || other.createdAt == createdAt));
}
@JsonKey(includeFromJson: false, includeToJson: false)
@override
int get hashCode => Object.hash(runtimeType,id,brand,productCode,name,isNetworkRequired,isActive,createdAt);
@override
String toString() {
return 'DeviceType(id: $id, brand: $brand, productCode: $productCode, name: $name, isNetworkRequired: $isNetworkRequired, isActive: $isActive, createdAt: $createdAt)';
}
}
/// @nodoc
abstract mixin class $DeviceTypeCopyWith<$Res> {
factory $DeviceTypeCopyWith(DeviceType value, $Res Function(DeviceType) _then) = _$DeviceTypeCopyWithImpl;
@useResult
$Res call({
int id, String brand, String productCode, String name, bool isNetworkRequired, bool isActive, String? createdAt
});
}
/// @nodoc
class _$DeviceTypeCopyWithImpl<$Res>
implements $DeviceTypeCopyWith<$Res> {
_$DeviceTypeCopyWithImpl(this._self, this._then);
final DeviceType _self;
final $Res Function(DeviceType) _then;
/// Create a copy of DeviceType
/// with the given fields replaced by the non-null parameter values.
@pragma('vm:prefer-inline') @override $Res call({Object? id = null,Object? brand = null,Object? productCode = null,Object? name = null,Object? isNetworkRequired = null,Object? isActive = null,Object? createdAt = freezed,}) {
return _then(_self.copyWith(
id: null == id ? _self.id : id // ignore: cast_nullable_to_non_nullable
as int,brand: null == brand ? _self.brand : brand // ignore: cast_nullable_to_non_nullable
as String,productCode: null == productCode ? _self.productCode : productCode // ignore: cast_nullable_to_non_nullable
as String,name: null == name ? _self.name : name // ignore: cast_nullable_to_non_nullable
as String,isNetworkRequired: null == isNetworkRequired ? _self.isNetworkRequired : isNetworkRequired // ignore: cast_nullable_to_non_nullable
as bool,isActive: null == isActive ? _self.isActive : isActive // ignore: cast_nullable_to_non_nullable
as bool,createdAt: freezed == createdAt ? _self.createdAt : createdAt // ignore: cast_nullable_to_non_nullable
as String?,
));
}
}
/// Adds pattern-matching-related methods to [DeviceType].
extension DeviceTypePatterns on DeviceType {
/// 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( _DeviceType value)? $default,{required TResult orElse(),}){
final _that = this;
switch (_that) {
case _DeviceType() 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( _DeviceType value) $default,){
final _that = this;
switch (_that) {
case _DeviceType():
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( _DeviceType value)? $default,){
final _that = this;
switch (_that) {
case _DeviceType() 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( int id, String brand, String productCode, String name, bool isNetworkRequired, bool isActive, String? createdAt)? $default,{required TResult orElse(),}) {final _that = this;
switch (_that) {
case _DeviceType() when $default != null:
return $default(_that.id,_that.brand,_that.productCode,_that.name,_that.isNetworkRequired,_that.isActive,_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( int id, String brand, String productCode, String name, bool isNetworkRequired, bool isActive, String? createdAt) $default,) {final _that = this;
switch (_that) {
case _DeviceType():
return $default(_that.id,_that.brand,_that.productCode,_that.name,_that.isNetworkRequired,_that.isActive,_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( int id, String brand, String productCode, String name, bool isNetworkRequired, bool isActive, String? createdAt)? $default,) {final _that = this;
switch (_that) {
case _DeviceType() when $default != null:
return $default(_that.id,_that.brand,_that.productCode,_that.name,_that.isNetworkRequired,_that.isActive,_that.createdAt);case _:
return null;
}
}
}
/// @nodoc
@JsonSerializable()
class _DeviceType implements DeviceType {
const _DeviceType({required this.id, required this.brand, required this.productCode, required this.name, this.isNetworkRequired = true, this.isActive = true, this.createdAt});
factory _DeviceType.fromJson(Map<String, dynamic> json) => _$DeviceTypeFromJson(json);
@override final int id;
@override final String brand;
@override final String productCode;
@override final String name;
@override@JsonKey() final bool isNetworkRequired;
@override@JsonKey() final bool isActive;
@override final String? createdAt;
/// Create a copy of DeviceType
/// with the given fields replaced by the non-null parameter values.
@override @JsonKey(includeFromJson: false, includeToJson: false)
@pragma('vm:prefer-inline')
_$DeviceTypeCopyWith<_DeviceType> get copyWith => __$DeviceTypeCopyWithImpl<_DeviceType>(this, _$identity);
@override
Map<String, dynamic> toJson() {
return _$DeviceTypeToJson(this, );
}
@override
bool operator ==(Object other) {
return identical(this, other) || (other.runtimeType == runtimeType&&other is _DeviceType&&(identical(other.id, id) || other.id == id)&&(identical(other.brand, brand) || other.brand == brand)&&(identical(other.productCode, productCode) || other.productCode == productCode)&&(identical(other.name, name) || other.name == name)&&(identical(other.isNetworkRequired, isNetworkRequired) || other.isNetworkRequired == isNetworkRequired)&&(identical(other.isActive, isActive) || other.isActive == isActive)&&(identical(other.createdAt, createdAt) || other.createdAt == createdAt));
}
@JsonKey(includeFromJson: false, includeToJson: false)
@override
int get hashCode => Object.hash(runtimeType,id,brand,productCode,name,isNetworkRequired,isActive,createdAt);
@override
String toString() {
return 'DeviceType(id: $id, brand: $brand, productCode: $productCode, name: $name, isNetworkRequired: $isNetworkRequired, isActive: $isActive, createdAt: $createdAt)';
}
}
/// @nodoc
abstract mixin class _$DeviceTypeCopyWith<$Res> implements $DeviceTypeCopyWith<$Res> {
factory _$DeviceTypeCopyWith(_DeviceType value, $Res Function(_DeviceType) _then) = __$DeviceTypeCopyWithImpl;
@override @useResult
$Res call({
int id, String brand, String productCode, String name, bool isNetworkRequired, bool isActive, String? createdAt
});
}
/// @nodoc
class __$DeviceTypeCopyWithImpl<$Res>
implements _$DeviceTypeCopyWith<$Res> {
__$DeviceTypeCopyWithImpl(this._self, this._then);
final _DeviceType _self;
final $Res Function(_DeviceType) _then;
/// Create a copy of DeviceType
/// with the given fields replaced by the non-null parameter values.
@override @pragma('vm:prefer-inline') $Res call({Object? id = null,Object? brand = null,Object? productCode = null,Object? name = null,Object? isNetworkRequired = null,Object? isActive = null,Object? createdAt = freezed,}) {
return _then(_DeviceType(
id: null == id ? _self.id : id // ignore: cast_nullable_to_non_nullable
as int,brand: null == brand ? _self.brand : brand // ignore: cast_nullable_to_non_nullable
as String,productCode: null == productCode ? _self.productCode : productCode // ignore: cast_nullable_to_non_nullable
as String,name: null == name ? _self.name : name // ignore: cast_nullable_to_non_nullable
as String,isNetworkRequired: null == isNetworkRequired ? _self.isNetworkRequired : isNetworkRequired // ignore: cast_nullable_to_non_nullable
as bool,isActive: null == isActive ? _self.isActive : isActive // ignore: cast_nullable_to_non_nullable
as bool,createdAt: freezed == createdAt ? _self.createdAt : createdAt // ignore: cast_nullable_to_non_nullable
as String?,
));
}
}
/// @nodoc
mixin _$DeviceInfo {
int get id; String get sn; DeviceType? get deviceType; DeviceType? get deviceTypeInfo; String? get macAddress; String get name; String get status; String get firmwareVersion; String? get lastOnlineAt; String? get createdAt;
/// Create a copy of DeviceInfo
/// with the given fields replaced by the non-null parameter values.
@JsonKey(includeFromJson: false, includeToJson: false)
@pragma('vm:prefer-inline')
$DeviceInfoCopyWith<DeviceInfo> get copyWith => _$DeviceInfoCopyWithImpl<DeviceInfo>(this as DeviceInfo, _$identity);
/// Serializes this DeviceInfo to a JSON map.
Map<String, dynamic> toJson();
@override
bool operator ==(Object other) {
return identical(this, other) || (other.runtimeType == runtimeType&&other is DeviceInfo&&(identical(other.id, id) || other.id == id)&&(identical(other.sn, sn) || other.sn == sn)&&(identical(other.deviceType, deviceType) || other.deviceType == deviceType)&&(identical(other.deviceTypeInfo, deviceTypeInfo) || other.deviceTypeInfo == deviceTypeInfo)&&(identical(other.macAddress, macAddress) || other.macAddress == macAddress)&&(identical(other.name, name) || other.name == name)&&(identical(other.status, status) || other.status == status)&&(identical(other.firmwareVersion, firmwareVersion) || other.firmwareVersion == firmwareVersion)&&(identical(other.lastOnlineAt, lastOnlineAt) || other.lastOnlineAt == lastOnlineAt)&&(identical(other.createdAt, createdAt) || other.createdAt == createdAt));
}
@JsonKey(includeFromJson: false, includeToJson: false)
@override
int get hashCode => Object.hash(runtimeType,id,sn,deviceType,deviceTypeInfo,macAddress,name,status,firmwareVersion,lastOnlineAt,createdAt);
@override
String toString() {
return 'DeviceInfo(id: $id, sn: $sn, deviceType: $deviceType, deviceTypeInfo: $deviceTypeInfo, macAddress: $macAddress, name: $name, status: $status, firmwareVersion: $firmwareVersion, lastOnlineAt: $lastOnlineAt, createdAt: $createdAt)';
}
}
/// @nodoc
abstract mixin class $DeviceInfoCopyWith<$Res> {
factory $DeviceInfoCopyWith(DeviceInfo value, $Res Function(DeviceInfo) _then) = _$DeviceInfoCopyWithImpl;
@useResult
$Res call({
int id, String sn, DeviceType? deviceType, DeviceType? deviceTypeInfo, String? macAddress, String name, String status, String firmwareVersion, String? lastOnlineAt, String? createdAt
});
$DeviceTypeCopyWith<$Res>? get deviceType;$DeviceTypeCopyWith<$Res>? get deviceTypeInfo;
}
/// @nodoc
class _$DeviceInfoCopyWithImpl<$Res>
implements $DeviceInfoCopyWith<$Res> {
_$DeviceInfoCopyWithImpl(this._self, this._then);
final DeviceInfo _self;
final $Res Function(DeviceInfo) _then;
/// Create a copy of DeviceInfo
/// with the given fields replaced by the non-null parameter values.
@pragma('vm:prefer-inline') @override $Res call({Object? id = null,Object? sn = null,Object? deviceType = freezed,Object? deviceTypeInfo = freezed,Object? macAddress = freezed,Object? name = null,Object? status = null,Object? firmwareVersion = null,Object? lastOnlineAt = freezed,Object? createdAt = freezed,}) {
return _then(_self.copyWith(
id: null == id ? _self.id : id // ignore: cast_nullable_to_non_nullable
as int,sn: null == sn ? _self.sn : sn // ignore: cast_nullable_to_non_nullable
as String,deviceType: freezed == deviceType ? _self.deviceType : deviceType // ignore: cast_nullable_to_non_nullable
as DeviceType?,deviceTypeInfo: freezed == deviceTypeInfo ? _self.deviceTypeInfo : deviceTypeInfo // ignore: cast_nullable_to_non_nullable
as DeviceType?,macAddress: freezed == macAddress ? _self.macAddress : macAddress // ignore: cast_nullable_to_non_nullable
as String?,name: null == name ? _self.name : name // ignore: cast_nullable_to_non_nullable
as String,status: null == status ? _self.status : status // ignore: cast_nullable_to_non_nullable
as String,firmwareVersion: null == firmwareVersion ? _self.firmwareVersion : firmwareVersion // ignore: cast_nullable_to_non_nullable
as String,lastOnlineAt: freezed == lastOnlineAt ? _self.lastOnlineAt : lastOnlineAt // ignore: cast_nullable_to_non_nullable
as String?,createdAt: freezed == createdAt ? _self.createdAt : createdAt // ignore: cast_nullable_to_non_nullable
as String?,
));
}
/// Create a copy of DeviceInfo
/// with the given fields replaced by the non-null parameter values.
@override
@pragma('vm:prefer-inline')
$DeviceTypeCopyWith<$Res>? get deviceType {
if (_self.deviceType == null) {
return null;
}
return $DeviceTypeCopyWith<$Res>(_self.deviceType!, (value) {
return _then(_self.copyWith(deviceType: value));
});
}/// Create a copy of DeviceInfo
/// with the given fields replaced by the non-null parameter values.
@override
@pragma('vm:prefer-inline')
$DeviceTypeCopyWith<$Res>? get deviceTypeInfo {
if (_self.deviceTypeInfo == null) {
return null;
}
return $DeviceTypeCopyWith<$Res>(_self.deviceTypeInfo!, (value) {
return _then(_self.copyWith(deviceTypeInfo: value));
});
}
}
/// Adds pattern-matching-related methods to [DeviceInfo].
extension DeviceInfoPatterns on DeviceInfo {
/// 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( _DeviceInfo value)? $default,{required TResult orElse(),}){
final _that = this;
switch (_that) {
case _DeviceInfo() 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( _DeviceInfo value) $default,){
final _that = this;
switch (_that) {
case _DeviceInfo():
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( _DeviceInfo value)? $default,){
final _that = this;
switch (_that) {
case _DeviceInfo() 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( int id, String sn, DeviceType? deviceType, DeviceType? deviceTypeInfo, String? macAddress, String name, String status, String firmwareVersion, String? lastOnlineAt, String? createdAt)? $default,{required TResult orElse(),}) {final _that = this;
switch (_that) {
case _DeviceInfo() when $default != null:
return $default(_that.id,_that.sn,_that.deviceType,_that.deviceTypeInfo,_that.macAddress,_that.name,_that.status,_that.firmwareVersion,_that.lastOnlineAt,_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( int id, String sn, DeviceType? deviceType, DeviceType? deviceTypeInfo, String? macAddress, String name, String status, String firmwareVersion, String? lastOnlineAt, String? createdAt) $default,) {final _that = this;
switch (_that) {
case _DeviceInfo():
return $default(_that.id,_that.sn,_that.deviceType,_that.deviceTypeInfo,_that.macAddress,_that.name,_that.status,_that.firmwareVersion,_that.lastOnlineAt,_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( int id, String sn, DeviceType? deviceType, DeviceType? deviceTypeInfo, String? macAddress, String name, String status, String firmwareVersion, String? lastOnlineAt, String? createdAt)? $default,) {final _that = this;
switch (_that) {
case _DeviceInfo() when $default != null:
return $default(_that.id,_that.sn,_that.deviceType,_that.deviceTypeInfo,_that.macAddress,_that.name,_that.status,_that.firmwareVersion,_that.lastOnlineAt,_that.createdAt);case _:
return null;
}
}
}
/// @nodoc
@JsonSerializable()
class _DeviceInfo implements DeviceInfo {
const _DeviceInfo({required this.id, required this.sn, this.deviceType, this.deviceTypeInfo, this.macAddress, this.name = '', this.status = 'in_stock', this.firmwareVersion = '', this.lastOnlineAt, this.createdAt});
factory _DeviceInfo.fromJson(Map<String, dynamic> json) => _$DeviceInfoFromJson(json);
@override final int id;
@override final String sn;
@override final DeviceType? deviceType;
@override final DeviceType? deviceTypeInfo;
@override final String? macAddress;
@override@JsonKey() final String name;
@override@JsonKey() final String status;
@override@JsonKey() final String firmwareVersion;
@override final String? lastOnlineAt;
@override final String? createdAt;
/// Create a copy of DeviceInfo
/// with the given fields replaced by the non-null parameter values.
@override @JsonKey(includeFromJson: false, includeToJson: false)
@pragma('vm:prefer-inline')
_$DeviceInfoCopyWith<_DeviceInfo> get copyWith => __$DeviceInfoCopyWithImpl<_DeviceInfo>(this, _$identity);
@override
Map<String, dynamic> toJson() {
return _$DeviceInfoToJson(this, );
}
@override
bool operator ==(Object other) {
return identical(this, other) || (other.runtimeType == runtimeType&&other is _DeviceInfo&&(identical(other.id, id) || other.id == id)&&(identical(other.sn, sn) || other.sn == sn)&&(identical(other.deviceType, deviceType) || other.deviceType == deviceType)&&(identical(other.deviceTypeInfo, deviceTypeInfo) || other.deviceTypeInfo == deviceTypeInfo)&&(identical(other.macAddress, macAddress) || other.macAddress == macAddress)&&(identical(other.name, name) || other.name == name)&&(identical(other.status, status) || other.status == status)&&(identical(other.firmwareVersion, firmwareVersion) || other.firmwareVersion == firmwareVersion)&&(identical(other.lastOnlineAt, lastOnlineAt) || other.lastOnlineAt == lastOnlineAt)&&(identical(other.createdAt, createdAt) || other.createdAt == createdAt));
}
@JsonKey(includeFromJson: false, includeToJson: false)
@override
int get hashCode => Object.hash(runtimeType,id,sn,deviceType,deviceTypeInfo,macAddress,name,status,firmwareVersion,lastOnlineAt,createdAt);
@override
String toString() {
return 'DeviceInfo(id: $id, sn: $sn, deviceType: $deviceType, deviceTypeInfo: $deviceTypeInfo, macAddress: $macAddress, name: $name, status: $status, firmwareVersion: $firmwareVersion, lastOnlineAt: $lastOnlineAt, createdAt: $createdAt)';
}
}
/// @nodoc
abstract mixin class _$DeviceInfoCopyWith<$Res> implements $DeviceInfoCopyWith<$Res> {
factory _$DeviceInfoCopyWith(_DeviceInfo value, $Res Function(_DeviceInfo) _then) = __$DeviceInfoCopyWithImpl;
@override @useResult
$Res call({
int id, String sn, DeviceType? deviceType, DeviceType? deviceTypeInfo, String? macAddress, String name, String status, String firmwareVersion, String? lastOnlineAt, String? createdAt
});
@override $DeviceTypeCopyWith<$Res>? get deviceType;@override $DeviceTypeCopyWith<$Res>? get deviceTypeInfo;
}
/// @nodoc
class __$DeviceInfoCopyWithImpl<$Res>
implements _$DeviceInfoCopyWith<$Res> {
__$DeviceInfoCopyWithImpl(this._self, this._then);
final _DeviceInfo _self;
final $Res Function(_DeviceInfo) _then;
/// Create a copy of DeviceInfo
/// with the given fields replaced by the non-null parameter values.
@override @pragma('vm:prefer-inline') $Res call({Object? id = null,Object? sn = null,Object? deviceType = freezed,Object? deviceTypeInfo = freezed,Object? macAddress = freezed,Object? name = null,Object? status = null,Object? firmwareVersion = null,Object? lastOnlineAt = freezed,Object? createdAt = freezed,}) {
return _then(_DeviceInfo(
id: null == id ? _self.id : id // ignore: cast_nullable_to_non_nullable
as int,sn: null == sn ? _self.sn : sn // ignore: cast_nullable_to_non_nullable
as String,deviceType: freezed == deviceType ? _self.deviceType : deviceType // ignore: cast_nullable_to_non_nullable
as DeviceType?,deviceTypeInfo: freezed == deviceTypeInfo ? _self.deviceTypeInfo : deviceTypeInfo // ignore: cast_nullable_to_non_nullable
as DeviceType?,macAddress: freezed == macAddress ? _self.macAddress : macAddress // ignore: cast_nullable_to_non_nullable
as String?,name: null == name ? _self.name : name // ignore: cast_nullable_to_non_nullable
as String,status: null == status ? _self.status : status // ignore: cast_nullable_to_non_nullable
as String,firmwareVersion: null == firmwareVersion ? _self.firmwareVersion : firmwareVersion // ignore: cast_nullable_to_non_nullable
as String,lastOnlineAt: freezed == lastOnlineAt ? _self.lastOnlineAt : lastOnlineAt // ignore: cast_nullable_to_non_nullable
as String?,createdAt: freezed == createdAt ? _self.createdAt : createdAt // ignore: cast_nullable_to_non_nullable
as String?,
));
}
/// Create a copy of DeviceInfo
/// with the given fields replaced by the non-null parameter values.
@override
@pragma('vm:prefer-inline')
$DeviceTypeCopyWith<$Res>? get deviceType {
if (_self.deviceType == null) {
return null;
}
return $DeviceTypeCopyWith<$Res>(_self.deviceType!, (value) {
return _then(_self.copyWith(deviceType: value));
});
}/// Create a copy of DeviceInfo
/// with the given fields replaced by the non-null parameter values.
@override
@pragma('vm:prefer-inline')
$DeviceTypeCopyWith<$Res>? get deviceTypeInfo {
if (_self.deviceTypeInfo == null) {
return null;
}
return $DeviceTypeCopyWith<$Res>(_self.deviceTypeInfo!, (value) {
return _then(_self.copyWith(deviceTypeInfo: value));
});
}
}
/// @nodoc
mixin _$UserDevice {
int get id; DeviceInfo get device; int? get spirit; String? get spiritName; String get bindType; String? get bindTime; bool get isActive;
/// Create a copy of UserDevice
/// with the given fields replaced by the non-null parameter values.
@JsonKey(includeFromJson: false, includeToJson: false)
@pragma('vm:prefer-inline')
$UserDeviceCopyWith<UserDevice> get copyWith => _$UserDeviceCopyWithImpl<UserDevice>(this as UserDevice, _$identity);
/// Serializes this UserDevice to a JSON map.
Map<String, dynamic> toJson();
@override
bool operator ==(Object other) {
return identical(this, other) || (other.runtimeType == runtimeType&&other is UserDevice&&(identical(other.id, id) || other.id == id)&&(identical(other.device, device) || other.device == device)&&(identical(other.spirit, spirit) || other.spirit == spirit)&&(identical(other.spiritName, spiritName) || other.spiritName == spiritName)&&(identical(other.bindType, bindType) || other.bindType == bindType)&&(identical(other.bindTime, bindTime) || other.bindTime == bindTime)&&(identical(other.isActive, isActive) || other.isActive == isActive));
}
@JsonKey(includeFromJson: false, includeToJson: false)
@override
int get hashCode => Object.hash(runtimeType,id,device,spirit,spiritName,bindType,bindTime,isActive);
@override
String toString() {
return 'UserDevice(id: $id, device: $device, spirit: $spirit, spiritName: $spiritName, bindType: $bindType, bindTime: $bindTime, isActive: $isActive)';
}
}
/// @nodoc
abstract mixin class $UserDeviceCopyWith<$Res> {
factory $UserDeviceCopyWith(UserDevice value, $Res Function(UserDevice) _then) = _$UserDeviceCopyWithImpl;
@useResult
$Res call({
int id, DeviceInfo device, int? spirit, String? spiritName, String bindType, String? bindTime, bool isActive
});
$DeviceInfoCopyWith<$Res> get device;
}
/// @nodoc
class _$UserDeviceCopyWithImpl<$Res>
implements $UserDeviceCopyWith<$Res> {
_$UserDeviceCopyWithImpl(this._self, this._then);
final UserDevice _self;
final $Res Function(UserDevice) _then;
/// Create a copy of UserDevice
/// with the given fields replaced by the non-null parameter values.
@pragma('vm:prefer-inline') @override $Res call({Object? id = null,Object? device = null,Object? spirit = freezed,Object? spiritName = freezed,Object? bindType = null,Object? bindTime = freezed,Object? isActive = null,}) {
return _then(_self.copyWith(
id: null == id ? _self.id : id // ignore: cast_nullable_to_non_nullable
as int,device: null == device ? _self.device : device // ignore: cast_nullable_to_non_nullable
as DeviceInfo,spirit: freezed == spirit ? _self.spirit : spirit // ignore: cast_nullable_to_non_nullable
as int?,spiritName: freezed == spiritName ? _self.spiritName : spiritName // ignore: cast_nullable_to_non_nullable
as String?,bindType: null == bindType ? _self.bindType : bindType // ignore: cast_nullable_to_non_nullable
as String,bindTime: freezed == bindTime ? _self.bindTime : bindTime // ignore: cast_nullable_to_non_nullable
as String?,isActive: null == isActive ? _self.isActive : isActive // ignore: cast_nullable_to_non_nullable
as bool,
));
}
/// Create a copy of UserDevice
/// with the given fields replaced by the non-null parameter values.
@override
@pragma('vm:prefer-inline')
$DeviceInfoCopyWith<$Res> get device {
return $DeviceInfoCopyWith<$Res>(_self.device, (value) {
return _then(_self.copyWith(device: value));
});
}
}
/// Adds pattern-matching-related methods to [UserDevice].
extension UserDevicePatterns on UserDevice {
/// 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( _UserDevice value)? $default,{required TResult orElse(),}){
final _that = this;
switch (_that) {
case _UserDevice() 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( _UserDevice value) $default,){
final _that = this;
switch (_that) {
case _UserDevice():
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( _UserDevice value)? $default,){
final _that = this;
switch (_that) {
case _UserDevice() 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( int id, DeviceInfo device, int? spirit, String? spiritName, String bindType, String? bindTime, bool isActive)? $default,{required TResult orElse(),}) {final _that = this;
switch (_that) {
case _UserDevice() when $default != null:
return $default(_that.id,_that.device,_that.spirit,_that.spiritName,_that.bindType,_that.bindTime,_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( int id, DeviceInfo device, int? spirit, String? spiritName, String bindType, String? bindTime, bool isActive) $default,) {final _that = this;
switch (_that) {
case _UserDevice():
return $default(_that.id,_that.device,_that.spirit,_that.spiritName,_that.bindType,_that.bindTime,_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( int id, DeviceInfo device, int? spirit, String? spiritName, String bindType, String? bindTime, bool isActive)? $default,) {final _that = this;
switch (_that) {
case _UserDevice() when $default != null:
return $default(_that.id,_that.device,_that.spirit,_that.spiritName,_that.bindType,_that.bindTime,_that.isActive);case _:
return null;
}
}
}
/// @nodoc
@JsonSerializable()
class _UserDevice implements UserDevice {
const _UserDevice({required this.id, required this.device, this.spirit, this.spiritName, this.bindType = 'owner', this.bindTime, this.isActive = true});
factory _UserDevice.fromJson(Map<String, dynamic> json) => _$UserDeviceFromJson(json);
@override final int id;
@override final DeviceInfo device;
@override final int? spirit;
@override final String? spiritName;
@override@JsonKey() final String bindType;
@override final String? bindTime;
@override@JsonKey() final bool isActive;
/// Create a copy of UserDevice
/// with the given fields replaced by the non-null parameter values.
@override @JsonKey(includeFromJson: false, includeToJson: false)
@pragma('vm:prefer-inline')
_$UserDeviceCopyWith<_UserDevice> get copyWith => __$UserDeviceCopyWithImpl<_UserDevice>(this, _$identity);
@override
Map<String, dynamic> toJson() {
return _$UserDeviceToJson(this, );
}
@override
bool operator ==(Object other) {
return identical(this, other) || (other.runtimeType == runtimeType&&other is _UserDevice&&(identical(other.id, id) || other.id == id)&&(identical(other.device, device) || other.device == device)&&(identical(other.spirit, spirit) || other.spirit == spirit)&&(identical(other.spiritName, spiritName) || other.spiritName == spiritName)&&(identical(other.bindType, bindType) || other.bindType == bindType)&&(identical(other.bindTime, bindTime) || other.bindTime == bindTime)&&(identical(other.isActive, isActive) || other.isActive == isActive));
}
@JsonKey(includeFromJson: false, includeToJson: false)
@override
int get hashCode => Object.hash(runtimeType,id,device,spirit,spiritName,bindType,bindTime,isActive);
@override
String toString() {
return 'UserDevice(id: $id, device: $device, spirit: $spirit, spiritName: $spiritName, bindType: $bindType, bindTime: $bindTime, isActive: $isActive)';
}
}
/// @nodoc
abstract mixin class _$UserDeviceCopyWith<$Res> implements $UserDeviceCopyWith<$Res> {
factory _$UserDeviceCopyWith(_UserDevice value, $Res Function(_UserDevice) _then) = __$UserDeviceCopyWithImpl;
@override @useResult
$Res call({
int id, DeviceInfo device, int? spirit, String? spiritName, String bindType, String? bindTime, bool isActive
});
@override $DeviceInfoCopyWith<$Res> get device;
}
/// @nodoc
class __$UserDeviceCopyWithImpl<$Res>
implements _$UserDeviceCopyWith<$Res> {
__$UserDeviceCopyWithImpl(this._self, this._then);
final _UserDevice _self;
final $Res Function(_UserDevice) _then;
/// Create a copy of UserDevice
/// with the given fields replaced by the non-null parameter values.
@override @pragma('vm:prefer-inline') $Res call({Object? id = null,Object? device = null,Object? spirit = freezed,Object? spiritName = freezed,Object? bindType = null,Object? bindTime = freezed,Object? isActive = null,}) {
return _then(_UserDevice(
id: null == id ? _self.id : id // ignore: cast_nullable_to_non_nullable
as int,device: null == device ? _self.device : device // ignore: cast_nullable_to_non_nullable
as DeviceInfo,spirit: freezed == spirit ? _self.spirit : spirit // ignore: cast_nullable_to_non_nullable
as int?,spiritName: freezed == spiritName ? _self.spiritName : spiritName // ignore: cast_nullable_to_non_nullable
as String?,bindType: null == bindType ? _self.bindType : bindType // ignore: cast_nullable_to_non_nullable
as String,bindTime: freezed == bindTime ? _self.bindTime : bindTime // ignore: cast_nullable_to_non_nullable
as String?,isActive: null == isActive ? _self.isActive : isActive // ignore: cast_nullable_to_non_nullable
as bool,
));
}
/// Create a copy of UserDevice
/// with the given fields replaced by the non-null parameter values.
@override
@pragma('vm:prefer-inline')
$DeviceInfoCopyWith<$Res> get device {
return $DeviceInfoCopyWith<$Res>(_self.device, (value) {
return _then(_self.copyWith(device: value));
});
}
}
// dart format on