mirror of
https://github.com/foss42/apidash.git
synced 2025-12-01 10:17:47 +08:00
refactor: move authModel to HttpRequestModel
This commit is contained in:
@@ -15,7 +15,6 @@ class RequestModel with _$RequestModel {
|
||||
@Default(APIType.rest) APIType apiType,
|
||||
@Default("") String name,
|
||||
@Default("") String description,
|
||||
@Default(AuthModel(type: APIAuthType.none)) AuthModel? authModel,
|
||||
@JsonKey(includeToJson: false) @Default(0) requestTabIndex,
|
||||
HttpRequestModel? httpRequestModel,
|
||||
int? responseStatus,
|
||||
|
||||
@@ -24,7 +24,6 @@ mixin _$RequestModel {
|
||||
APIType get apiType => throw _privateConstructorUsedError;
|
||||
String get name => throw _privateConstructorUsedError;
|
||||
String get description => throw _privateConstructorUsedError;
|
||||
AuthModel? get authModel => throw _privateConstructorUsedError;
|
||||
@JsonKey(includeToJson: false)
|
||||
dynamic get requestTabIndex => throw _privateConstructorUsedError;
|
||||
HttpRequestModel? get httpRequestModel => throw _privateConstructorUsedError;
|
||||
@@ -60,7 +59,6 @@ abstract class $RequestModelCopyWith<$Res> {
|
||||
APIType apiType,
|
||||
String name,
|
||||
String description,
|
||||
AuthModel? authModel,
|
||||
@JsonKey(includeToJson: false) dynamic requestTabIndex,
|
||||
HttpRequestModel? httpRequestModel,
|
||||
int? responseStatus,
|
||||
@@ -71,7 +69,6 @@ abstract class $RequestModelCopyWith<$Res> {
|
||||
String? preRequestScript,
|
||||
String? postRequestScript});
|
||||
|
||||
$AuthModelCopyWith<$Res>? get authModel;
|
||||
$HttpRequestModelCopyWith<$Res>? get httpRequestModel;
|
||||
$HttpResponseModelCopyWith<$Res>? get httpResponseModel;
|
||||
}
|
||||
@@ -95,7 +92,6 @@ class _$RequestModelCopyWithImpl<$Res, $Val extends RequestModel>
|
||||
Object? apiType = null,
|
||||
Object? name = null,
|
||||
Object? description = null,
|
||||
Object? authModel = freezed,
|
||||
Object? requestTabIndex = freezed,
|
||||
Object? httpRequestModel = freezed,
|
||||
Object? responseStatus = freezed,
|
||||
@@ -123,10 +119,6 @@ class _$RequestModelCopyWithImpl<$Res, $Val extends RequestModel>
|
||||
? _value.description
|
||||
: description // ignore: cast_nullable_to_non_nullable
|
||||
as String,
|
||||
authModel: freezed == authModel
|
||||
? _value.authModel
|
||||
: authModel // ignore: cast_nullable_to_non_nullable
|
||||
as AuthModel?,
|
||||
requestTabIndex: freezed == requestTabIndex
|
||||
? _value.requestTabIndex
|
||||
: requestTabIndex // ignore: cast_nullable_to_non_nullable
|
||||
@@ -166,20 +158,6 @@ class _$RequestModelCopyWithImpl<$Res, $Val extends RequestModel>
|
||||
) as $Val);
|
||||
}
|
||||
|
||||
/// Create a copy of RequestModel
|
||||
/// with the given fields replaced by the non-null parameter values.
|
||||
@override
|
||||
@pragma('vm:prefer-inline')
|
||||
$AuthModelCopyWith<$Res>? get authModel {
|
||||
if (_value.authModel == null) {
|
||||
return null;
|
||||
}
|
||||
|
||||
return $AuthModelCopyWith<$Res>(_value.authModel!, (value) {
|
||||
return _then(_value.copyWith(authModel: value) as $Val);
|
||||
});
|
||||
}
|
||||
|
||||
/// Create a copy of RequestModel
|
||||
/// with the given fields replaced by the non-null parameter values.
|
||||
@override
|
||||
@@ -222,7 +200,6 @@ abstract class _$$RequestModelImplCopyWith<$Res>
|
||||
APIType apiType,
|
||||
String name,
|
||||
String description,
|
||||
AuthModel? authModel,
|
||||
@JsonKey(includeToJson: false) dynamic requestTabIndex,
|
||||
HttpRequestModel? httpRequestModel,
|
||||
int? responseStatus,
|
||||
@@ -233,8 +210,6 @@ abstract class _$$RequestModelImplCopyWith<$Res>
|
||||
String? preRequestScript,
|
||||
String? postRequestScript});
|
||||
|
||||
@override
|
||||
$AuthModelCopyWith<$Res>? get authModel;
|
||||
@override
|
||||
$HttpRequestModelCopyWith<$Res>? get httpRequestModel;
|
||||
@override
|
||||
@@ -258,7 +233,6 @@ class __$$RequestModelImplCopyWithImpl<$Res>
|
||||
Object? apiType = null,
|
||||
Object? name = null,
|
||||
Object? description = null,
|
||||
Object? authModel = freezed,
|
||||
Object? requestTabIndex = freezed,
|
||||
Object? httpRequestModel = freezed,
|
||||
Object? responseStatus = freezed,
|
||||
@@ -286,10 +260,6 @@ class __$$RequestModelImplCopyWithImpl<$Res>
|
||||
? _value.description
|
||||
: description // ignore: cast_nullable_to_non_nullable
|
||||
as String,
|
||||
authModel: freezed == authModel
|
||||
? _value.authModel
|
||||
: authModel // ignore: cast_nullable_to_non_nullable
|
||||
as AuthModel?,
|
||||
requestTabIndex: freezed == requestTabIndex
|
||||
? _value.requestTabIndex!
|
||||
: requestTabIndex,
|
||||
@@ -338,7 +308,6 @@ class _$RequestModelImpl implements _RequestModel {
|
||||
this.apiType = APIType.rest,
|
||||
this.name = "",
|
||||
this.description = "",
|
||||
this.authModel = const AuthModel(type: APIAuthType.none),
|
||||
@JsonKey(includeToJson: false) this.requestTabIndex = 0,
|
||||
this.httpRequestModel,
|
||||
this.responseStatus,
|
||||
@@ -364,9 +333,6 @@ class _$RequestModelImpl implements _RequestModel {
|
||||
@JsonKey()
|
||||
final String description;
|
||||
@override
|
||||
@JsonKey()
|
||||
final AuthModel? authModel;
|
||||
@override
|
||||
@JsonKey(includeToJson: false)
|
||||
final dynamic requestTabIndex;
|
||||
@override
|
||||
@@ -390,7 +356,7 @@ class _$RequestModelImpl implements _RequestModel {
|
||||
|
||||
@override
|
||||
String toString() {
|
||||
return 'RequestModel(id: $id, apiType: $apiType, name: $name, description: $description, authModel: $authModel, requestTabIndex: $requestTabIndex, httpRequestModel: $httpRequestModel, responseStatus: $responseStatus, message: $message, httpResponseModel: $httpResponseModel, isWorking: $isWorking, sendingTime: $sendingTime, preRequestScript: $preRequestScript, postRequestScript: $postRequestScript)';
|
||||
return 'RequestModel(id: $id, apiType: $apiType, name: $name, description: $description, requestTabIndex: $requestTabIndex, httpRequestModel: $httpRequestModel, responseStatus: $responseStatus, message: $message, httpResponseModel: $httpResponseModel, isWorking: $isWorking, sendingTime: $sendingTime, preRequestScript: $preRequestScript, postRequestScript: $postRequestScript)';
|
||||
}
|
||||
|
||||
@override
|
||||
@@ -403,8 +369,6 @@ class _$RequestModelImpl implements _RequestModel {
|
||||
(identical(other.name, name) || other.name == name) &&
|
||||
(identical(other.description, description) ||
|
||||
other.description == description) &&
|
||||
(identical(other.authModel, authModel) ||
|
||||
other.authModel == authModel) &&
|
||||
const DeepCollectionEquality()
|
||||
.equals(other.requestTabIndex, requestTabIndex) &&
|
||||
(identical(other.httpRequestModel, httpRequestModel) ||
|
||||
@@ -432,7 +396,6 @@ class _$RequestModelImpl implements _RequestModel {
|
||||
apiType,
|
||||
name,
|
||||
description,
|
||||
authModel,
|
||||
const DeepCollectionEquality().hash(requestTabIndex),
|
||||
httpRequestModel,
|
||||
responseStatus,
|
||||
@@ -465,7 +428,6 @@ abstract class _RequestModel implements RequestModel {
|
||||
final APIType apiType,
|
||||
final String name,
|
||||
final String description,
|
||||
final AuthModel? authModel,
|
||||
@JsonKey(includeToJson: false) final dynamic requestTabIndex,
|
||||
final HttpRequestModel? httpRequestModel,
|
||||
final int? responseStatus,
|
||||
@@ -488,8 +450,6 @@ abstract class _RequestModel implements RequestModel {
|
||||
@override
|
||||
String get description;
|
||||
@override
|
||||
AuthModel? get authModel;
|
||||
@override
|
||||
@JsonKey(includeToJson: false)
|
||||
dynamic get requestTabIndex;
|
||||
@override
|
||||
|
||||
@@ -12,10 +12,6 @@ _$RequestModelImpl _$$RequestModelImplFromJson(Map json) => _$RequestModelImpl(
|
||||
APIType.rest,
|
||||
name: json['name'] as String? ?? "",
|
||||
description: json['description'] as String? ?? "",
|
||||
authModel: json['authModel'] == null
|
||||
? const AuthModel(type: APIAuthType.none)
|
||||
: AuthModel.fromJson(
|
||||
Map<String, dynamic>.from(json['authModel'] as Map)),
|
||||
requestTabIndex: json['requestTabIndex'] ?? 0,
|
||||
httpRequestModel: json['httpRequestModel'] == null
|
||||
? null
|
||||
@@ -41,7 +37,6 @@ Map<String, dynamic> _$$RequestModelImplToJson(_$RequestModelImpl instance) =>
|
||||
'apiType': _$APITypeEnumMap[instance.apiType]!,
|
||||
'name': instance.name,
|
||||
'description': instance.description,
|
||||
'authModel': instance.authModel?.toJson(),
|
||||
'httpRequestModel': instance.httpRequestModel?.toJson(),
|
||||
'responseStatus': instance.responseStatus,
|
||||
'message': instance.message,
|
||||
|
||||
Reference in New Issue
Block a user