mirror of
https://github.com/foss42/apidash.git
synced 2025-12-01 02:07:00 +08:00
71 lines
2.5 KiB
Dart
71 lines
2.5 KiB
Dart
// GENERATED CODE - DO NOT MODIFY BY HAND
|
|
|
|
part of 'http_request_model.dart';
|
|
|
|
// **************************************************************************
|
|
// JsonSerializableGenerator
|
|
// **************************************************************************
|
|
|
|
_$HttpRequestModelImpl _$$HttpRequestModelImplFromJson(
|
|
Map json,
|
|
) => _$HttpRequestModelImpl(
|
|
method:
|
|
$enumDecodeNullable(_$HTTPVerbEnumMap, json['method']) ?? HTTPVerb.get,
|
|
url: json['url'] as String? ?? "",
|
|
headers: (json['headers'] as List<dynamic>?)
|
|
?.map((e) => NameValueModel.fromJson(Map<String, Object?>.from(e as Map)))
|
|
.toList(),
|
|
params: (json['params'] as List<dynamic>?)
|
|
?.map((e) => NameValueModel.fromJson(Map<String, Object?>.from(e as Map)))
|
|
.toList(),
|
|
authModel: json['authModel'] == null
|
|
? const AuthModel(type: APIAuthType.none)
|
|
: AuthModel.fromJson(Map<String, dynamic>.from(json['authModel'] as Map)),
|
|
isHeaderEnabledList: (json['isHeaderEnabledList'] as List<dynamic>?)
|
|
?.map((e) => e as bool)
|
|
.toList(),
|
|
isParamEnabledList: (json['isParamEnabledList'] as List<dynamic>?)
|
|
?.map((e) => e as bool)
|
|
.toList(),
|
|
bodyContentType:
|
|
$enumDecodeNullable(_$ContentTypeEnumMap, json['bodyContentType']) ??
|
|
ContentType.json,
|
|
body: json['body'] as String?,
|
|
query: json['query'] as String?,
|
|
formData: (json['formData'] as List<dynamic>?)
|
|
?.map((e) => FormDataModel.fromJson(Map<String, Object?>.from(e as Map)))
|
|
.toList(),
|
|
);
|
|
|
|
Map<String, dynamic> _$$HttpRequestModelImplToJson(
|
|
_$HttpRequestModelImpl instance,
|
|
) => <String, dynamic>{
|
|
'method': _$HTTPVerbEnumMap[instance.method]!,
|
|
'url': instance.url,
|
|
'headers': instance.headers?.map((e) => e.toJson()).toList(),
|
|
'params': instance.params?.map((e) => e.toJson()).toList(),
|
|
'authModel': instance.authModel?.toJson(),
|
|
'isHeaderEnabledList': instance.isHeaderEnabledList,
|
|
'isParamEnabledList': instance.isParamEnabledList,
|
|
'bodyContentType': _$ContentTypeEnumMap[instance.bodyContentType]!,
|
|
'body': instance.body,
|
|
'query': instance.query,
|
|
'formData': instance.formData?.map((e) => e.toJson()).toList(),
|
|
};
|
|
|
|
const _$HTTPVerbEnumMap = {
|
|
HTTPVerb.get: 'get',
|
|
HTTPVerb.head: 'head',
|
|
HTTPVerb.post: 'post',
|
|
HTTPVerb.put: 'put',
|
|
HTTPVerb.patch: 'patch',
|
|
HTTPVerb.delete: 'delete',
|
|
HTTPVerb.options: 'options',
|
|
};
|
|
|
|
const _$ContentTypeEnumMap = {
|
|
ContentType.json: 'json',
|
|
ContentType.text: 'text',
|
|
ContentType.formdata: 'formdata',
|
|
};
|