// 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 'api_response.dart'; // ************************************************************************** // FreezedGenerator // ************************************************************************** // dart format off T _$identity(T value) => value; /// @nodoc mixin _$ApiResponse { @JsonKey(name: 'code') String get retCode;@JsonKey(name: 'msg') String get retMsg;@JsonKey(name: 'data') T? get retData; /// Create a copy of ApiResponse /// with the given fields replaced by the non-null parameter values. @JsonKey(includeFromJson: false, includeToJson: false) @pragma('vm:prefer-inline') $ApiResponseCopyWith> get copyWith => _$ApiResponseCopyWithImpl>(this as ApiResponse, _$identity); /// Serializes this ApiResponse to a JSON map. Map toJson(Object? Function(T) toJsonT); @override bool operator ==(Object other) { return identical(this, other) || (other.runtimeType == runtimeType&&other is ApiResponse&&(identical(other.retCode, retCode) || other.retCode == retCode)&&(identical(other.retMsg, retMsg) || other.retMsg == retMsg)&&const DeepCollectionEquality().equals(other.retData, retData)); } @JsonKey(includeFromJson: false, includeToJson: false) @override int get hashCode => Object.hash(runtimeType,retCode,retMsg,const DeepCollectionEquality().hash(retData)); @override String toString() { return 'ApiResponse<$T>(retCode: $retCode, retMsg: $retMsg, retData: $retData)'; } } /// @nodoc abstract mixin class $ApiResponseCopyWith { factory $ApiResponseCopyWith(ApiResponse value, $Res Function(ApiResponse) _then) = _$ApiResponseCopyWithImpl; @useResult $Res call({ @JsonKey(name: 'code') String retCode,@JsonKey(name: 'msg') String retMsg,@JsonKey(name: 'data') T? retData }); } /// @nodoc class _$ApiResponseCopyWithImpl implements $ApiResponseCopyWith { _$ApiResponseCopyWithImpl(this._self, this._then); final ApiResponse _self; final $Res Function(ApiResponse) _then; /// Create a copy of ApiResponse /// with the given fields replaced by the non-null parameter values. @pragma('vm:prefer-inline') @override $Res call({Object? retCode = null,Object? retMsg = null,Object? retData = freezed,}) { return _then(_self.copyWith( retCode: null == retCode ? _self.retCode : retCode // ignore: cast_nullable_to_non_nullable as String,retMsg: null == retMsg ? _self.retMsg : retMsg // ignore: cast_nullable_to_non_nullable as String,retData: freezed == retData ? _self.retData : retData // ignore: cast_nullable_to_non_nullable as T?, )); } } /// Adds pattern-matching-related methods to [ApiResponse]. extension ApiResponsePatterns on ApiResponse { /// A variant of `map` that fallback to returning `orElse`. /// /// It is equivalent to doing: /// ```dart /// switch (sealedClass) { /// case final Subclass value: /// return ...; /// case _: /// return orElse(); /// } /// ``` @optionalTypeArgs TResult maybeMap(TResult Function( _ApiResponse value)? $default,{required TResult orElse(),}){ final _that = this; switch (_that) { case _ApiResponse() 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 Function( _ApiResponse value) $default,){ final _that = this; switch (_that) { case _ApiResponse(): 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? Function( _ApiResponse value)? $default,){ final _that = this; switch (_that) { case _ApiResponse() 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 Function(@JsonKey(name: 'code') String retCode, @JsonKey(name: 'msg') String retMsg, @JsonKey(name: 'data') T? retData)? $default,{required TResult orElse(),}) {final _that = this; switch (_that) { case _ApiResponse() when $default != null: return $default(_that.retCode,_that.retMsg,_that.retData);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 Function(@JsonKey(name: 'code') String retCode, @JsonKey(name: 'msg') String retMsg, @JsonKey(name: 'data') T? retData) $default,) {final _that = this; switch (_that) { case _ApiResponse(): return $default(_that.retCode,_that.retMsg,_that.retData);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? Function(@JsonKey(name: 'code') String retCode, @JsonKey(name: 'msg') String retMsg, @JsonKey(name: 'data') T? retData)? $default,) {final _that = this; switch (_that) { case _ApiResponse() when $default != null: return $default(_that.retCode,_that.retMsg,_that.retData);case _: return null; } } } /// @nodoc @JsonSerializable(genericArgumentFactories: true) class _ApiResponse implements ApiResponse { const _ApiResponse({@JsonKey(name: 'code') required this.retCode, @JsonKey(name: 'msg') this.retMsg = '', @JsonKey(name: 'data') this.retData}); factory _ApiResponse.fromJson(Map json,T Function(Object?) fromJsonT) => _$ApiResponseFromJson(json,fromJsonT); @override@JsonKey(name: 'code') final String retCode; @override@JsonKey(name: 'msg') final String retMsg; @override@JsonKey(name: 'data') final T? retData; /// Create a copy of ApiResponse /// with the given fields replaced by the non-null parameter values. @override @JsonKey(includeFromJson: false, includeToJson: false) @pragma('vm:prefer-inline') _$ApiResponseCopyWith> get copyWith => __$ApiResponseCopyWithImpl>(this, _$identity); @override Map toJson(Object? Function(T) toJsonT) { return _$ApiResponseToJson(this, toJsonT); } @override bool operator ==(Object other) { return identical(this, other) || (other.runtimeType == runtimeType&&other is _ApiResponse&&(identical(other.retCode, retCode) || other.retCode == retCode)&&(identical(other.retMsg, retMsg) || other.retMsg == retMsg)&&const DeepCollectionEquality().equals(other.retData, retData)); } @JsonKey(includeFromJson: false, includeToJson: false) @override int get hashCode => Object.hash(runtimeType,retCode,retMsg,const DeepCollectionEquality().hash(retData)); @override String toString() { return 'ApiResponse<$T>(retCode: $retCode, retMsg: $retMsg, retData: $retData)'; } } /// @nodoc abstract mixin class _$ApiResponseCopyWith implements $ApiResponseCopyWith { factory _$ApiResponseCopyWith(_ApiResponse value, $Res Function(_ApiResponse) _then) = __$ApiResponseCopyWithImpl; @override @useResult $Res call({ @JsonKey(name: 'code') String retCode,@JsonKey(name: 'msg') String retMsg,@JsonKey(name: 'data') T? retData }); } /// @nodoc class __$ApiResponseCopyWithImpl implements _$ApiResponseCopyWith { __$ApiResponseCopyWithImpl(this._self, this._then); final _ApiResponse _self; final $Res Function(_ApiResponse) _then; /// Create a copy of ApiResponse /// with the given fields replaced by the non-null parameter values. @override @pragma('vm:prefer-inline') $Res call({Object? retCode = null,Object? retMsg = null,Object? retData = freezed,}) { return _then(_ApiResponse( retCode: null == retCode ? _self.retCode : retCode // ignore: cast_nullable_to_non_nullable as String,retMsg: null == retMsg ? _self.retMsg : retMsg // ignore: cast_nullable_to_non_nullable as String,retData: freezed == retData ? _self.retData : retData // ignore: cast_nullable_to_non_nullable as T?, )); } } // dart format on