mirror of
https://github.com/foss42/apidash.git
synced 2025-12-03 11:27:50 +08:00
feat: remove AuthModel from HttpRequestModel and integrate into HistoryRequestModel and RequestModel
This commit is contained in:
@@ -36,8 +36,7 @@ mixin _$RequestModel {
|
||||
bool get isWorking => throw _privateConstructorUsedError;
|
||||
@JsonKey(includeToJson: false)
|
||||
DateTime? get sendingTime => throw _privateConstructorUsedError;
|
||||
String? get preRequestScript => throw _privateConstructorUsedError;
|
||||
String? get postRequestScript => throw _privateConstructorUsedError;
|
||||
AuthModel? get authModel => throw _privateConstructorUsedError;
|
||||
|
||||
/// Serializes this RequestModel to a JSON map.
|
||||
Map<String, dynamic> toJson() => throw _privateConstructorUsedError;
|
||||
@@ -68,12 +67,12 @@ abstract class $RequestModelCopyWith<$Res> {
|
||||
HttpResponseModel? httpResponseModel,
|
||||
@JsonKey(includeToJson: false) bool isWorking,
|
||||
@JsonKey(includeToJson: false) DateTime? sendingTime,
|
||||
String? preRequestScript,
|
||||
String? postRequestScript});
|
||||
AuthModel? authModel});
|
||||
|
||||
$AuthModelCopyWith<$Res>? get authModel;
|
||||
$HttpRequestModelCopyWith<$Res>? get httpRequestModel;
|
||||
$HttpResponseModelCopyWith<$Res>? get httpResponseModel;
|
||||
$AuthModelCopyWith<$Res>? get authModel;
|
||||
}
|
||||
|
||||
/// @nodoc
|
||||
@@ -103,8 +102,7 @@ class _$RequestModelCopyWithImpl<$Res, $Val extends RequestModel>
|
||||
Object? httpResponseModel = freezed,
|
||||
Object? isWorking = null,
|
||||
Object? sendingTime = freezed,
|
||||
Object? preRequestScript = freezed,
|
||||
Object? postRequestScript = freezed,
|
||||
Object? authModel = freezed,
|
||||
}) {
|
||||
return _then(_value.copyWith(
|
||||
id: null == id
|
||||
@@ -155,14 +153,10 @@ class _$RequestModelCopyWithImpl<$Res, $Val extends RequestModel>
|
||||
? _value.sendingTime
|
||||
: sendingTime // ignore: cast_nullable_to_non_nullable
|
||||
as DateTime?,
|
||||
preRequestScript: freezed == preRequestScript
|
||||
? _value.preRequestScript
|
||||
: preRequestScript // ignore: cast_nullable_to_non_nullable
|
||||
as String?,
|
||||
postRequestScript: freezed == postRequestScript
|
||||
? _value.postRequestScript
|
||||
: postRequestScript // ignore: cast_nullable_to_non_nullable
|
||||
as String?,
|
||||
authModel: freezed == authModel
|
||||
? _value.authModel
|
||||
: authModel // ignore: cast_nullable_to_non_nullable
|
||||
as AuthModel?,
|
||||
) as $Val);
|
||||
}
|
||||
|
||||
@@ -207,6 +201,20 @@ class _$RequestModelCopyWithImpl<$Res, $Val extends RequestModel>
|
||||
return _then(_value.copyWith(httpResponseModel: value) 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);
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
/// @nodoc
|
||||
@@ -230,8 +238,7 @@ abstract class _$$RequestModelImplCopyWith<$Res>
|
||||
HttpResponseModel? httpResponseModel,
|
||||
@JsonKey(includeToJson: false) bool isWorking,
|
||||
@JsonKey(includeToJson: false) DateTime? sendingTime,
|
||||
String? preRequestScript,
|
||||
String? postRequestScript});
|
||||
AuthModel? authModel});
|
||||
|
||||
@override
|
||||
$AuthModelCopyWith<$Res>? get authModel;
|
||||
@@ -239,6 +246,8 @@ abstract class _$$RequestModelImplCopyWith<$Res>
|
||||
$HttpRequestModelCopyWith<$Res>? get httpRequestModel;
|
||||
@override
|
||||
$HttpResponseModelCopyWith<$Res>? get httpResponseModel;
|
||||
@override
|
||||
$AuthModelCopyWith<$Res>? get authModel;
|
||||
}
|
||||
|
||||
/// @nodoc
|
||||
@@ -266,8 +275,7 @@ class __$$RequestModelImplCopyWithImpl<$Res>
|
||||
Object? httpResponseModel = freezed,
|
||||
Object? isWorking = null,
|
||||
Object? sendingTime = freezed,
|
||||
Object? preRequestScript = freezed,
|
||||
Object? postRequestScript = freezed,
|
||||
Object? authModel = freezed,
|
||||
}) {
|
||||
return _then(_$RequestModelImpl(
|
||||
id: null == id
|
||||
@@ -317,14 +325,10 @@ class __$$RequestModelImplCopyWithImpl<$Res>
|
||||
? _value.sendingTime
|
||||
: sendingTime // ignore: cast_nullable_to_non_nullable
|
||||
as DateTime?,
|
||||
preRequestScript: freezed == preRequestScript
|
||||
? _value.preRequestScript
|
||||
: preRequestScript // ignore: cast_nullable_to_non_nullable
|
||||
as String?,
|
||||
postRequestScript: freezed == postRequestScript
|
||||
? _value.postRequestScript
|
||||
: postRequestScript // ignore: cast_nullable_to_non_nullable
|
||||
as String?,
|
||||
authModel: freezed == authModel
|
||||
? _value.authModel
|
||||
: authModel // ignore: cast_nullable_to_non_nullable
|
||||
as AuthModel?,
|
||||
));
|
||||
}
|
||||
}
|
||||
@@ -346,8 +350,7 @@ class _$RequestModelImpl implements _RequestModel {
|
||||
this.httpResponseModel,
|
||||
@JsonKey(includeToJson: false) this.isWorking = false,
|
||||
@JsonKey(includeToJson: false) this.sendingTime,
|
||||
this.preRequestScript,
|
||||
this.postRequestScript});
|
||||
this.authModel = const AuthModel(type: APIAuthType.none)});
|
||||
|
||||
factory _$RequestModelImpl.fromJson(Map<String, dynamic> json) =>
|
||||
_$$RequestModelImplFromJson(json);
|
||||
@@ -384,13 +387,12 @@ class _$RequestModelImpl implements _RequestModel {
|
||||
@JsonKey(includeToJson: false)
|
||||
final DateTime? sendingTime;
|
||||
@override
|
||||
final String? preRequestScript;
|
||||
@override
|
||||
final String? postRequestScript;
|
||||
@JsonKey()
|
||||
final AuthModel? authModel;
|
||||
|
||||
@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)';
|
||||
return 'RequestModel(id: $id, apiType: $apiType, name: $name, description: $description, requestTabIndex: $requestTabIndex, httpRequestModel: $httpRequestModel, responseStatus: $responseStatus, message: $message, httpResponseModel: $httpResponseModel, isWorking: $isWorking, sendingTime: $sendingTime, authModel: $authModel)';
|
||||
}
|
||||
|
||||
@override
|
||||
@@ -418,10 +420,8 @@ class _$RequestModelImpl implements _RequestModel {
|
||||
other.isWorking == isWorking) &&
|
||||
(identical(other.sendingTime, sendingTime) ||
|
||||
other.sendingTime == sendingTime) &&
|
||||
(identical(other.preRequestScript, preRequestScript) ||
|
||||
other.preRequestScript == preRequestScript) &&
|
||||
(identical(other.postRequestScript, postRequestScript) ||
|
||||
other.postRequestScript == postRequestScript));
|
||||
(identical(other.authModel, authModel) ||
|
||||
other.authModel == authModel));
|
||||
}
|
||||
|
||||
@JsonKey(includeFromJson: false, includeToJson: false)
|
||||
@@ -440,8 +440,7 @@ class _$RequestModelImpl implements _RequestModel {
|
||||
httpResponseModel,
|
||||
isWorking,
|
||||
sendingTime,
|
||||
preRequestScript,
|
||||
postRequestScript);
|
||||
authModel);
|
||||
|
||||
/// Create a copy of RequestModel
|
||||
/// with the given fields replaced by the non-null parameter values.
|
||||
@@ -461,19 +460,18 @@ class _$RequestModelImpl implements _RequestModel {
|
||||
|
||||
abstract class _RequestModel implements RequestModel {
|
||||
const factory _RequestModel(
|
||||
{required final String id,
|
||||
final APIType apiType,
|
||||
final String name,
|
||||
final String description,
|
||||
final AuthModel? authModel,
|
||||
@JsonKey(includeToJson: false) final dynamic requestTabIndex,
|
||||
final HttpRequestModel? httpRequestModel,
|
||||
final int? responseStatus,
|
||||
final String? message,
|
||||
final HttpResponseModel? httpResponseModel,
|
||||
@JsonKey(includeToJson: false) final bool isWorking,
|
||||
@JsonKey(includeToJson: false) final DateTime? sendingTime}) =
|
||||
_$RequestModelImpl;
|
||||
{required final String id,
|
||||
final APIType apiType,
|
||||
final String name,
|
||||
final String description,
|
||||
@JsonKey(includeToJson: false) final dynamic requestTabIndex,
|
||||
final HttpRequestModel? httpRequestModel,
|
||||
final int? responseStatus,
|
||||
final String? message,
|
||||
final HttpResponseModel? httpResponseModel,
|
||||
@JsonKey(includeToJson: false) final bool isWorking,
|
||||
@JsonKey(includeToJson: false) final DateTime? sendingTime,
|
||||
final AuthModel? authModel}) = _$RequestModelImpl;
|
||||
|
||||
factory _RequestModel.fromJson(Map<String, dynamic> json) =
|
||||
_$RequestModelImpl.fromJson;
|
||||
@@ -506,9 +504,7 @@ abstract class _RequestModel implements RequestModel {
|
||||
@JsonKey(includeToJson: false)
|
||||
DateTime? get sendingTime;
|
||||
@override
|
||||
String? get preRequestScript;
|
||||
@override
|
||||
String? get postRequestScript;
|
||||
AuthModel? get authModel;
|
||||
|
||||
/// Create a copy of RequestModel
|
||||
/// with the given fields replaced by the non-null parameter values.
|
||||
|
||||
Reference in New Issue
Block a user