mirror of
https://github.com/foss42/apidash.git
synced 2025-12-02 10:49:49 +08:00
- Introduced APIAuthType enum for various authentication methods. - Created APIAuthModel with basic authentication fields. - Updated RequestModel to include authType and authData. - Implemented EditAuthType widget for selecting and managing authentication. - Enhanced CollectionStateNotifier to handle authentication updates. :wq
71 lines
2.7 KiB
Dart
71 lines
2.7 KiB
Dart
// GENERATED CODE - DO NOT MODIFY BY HAND
|
|
|
|
part of 'request_model.dart';
|
|
|
|
// **************************************************************************
|
|
// JsonSerializableGenerator
|
|
// **************************************************************************
|
|
|
|
_$RequestModelImpl _$$RequestModelImplFromJson(Map json) => _$RequestModelImpl(
|
|
id: json['id'] as String,
|
|
apiType: $enumDecodeNullable(_$APITypeEnumMap, json['apiType']) ??
|
|
APIType.rest,
|
|
name: json['name'] as String? ?? "",
|
|
description: json['description'] as String? ?? "",
|
|
authType: $enumDecodeNullable(_$APIAuthTypeEnumMap, json['authType']) ??
|
|
APIAuthType.none,
|
|
authData: json['authData'] == null
|
|
? null
|
|
: APIAuthModel.fromJson(
|
|
Map<String, dynamic>.from(json['authData'] as Map)),
|
|
requestTabIndex: json['requestTabIndex'] ?? 0,
|
|
httpRequestModel: json['httpRequestModel'] == null
|
|
? null
|
|
: HttpRequestModel.fromJson(
|
|
Map<String, Object?>.from(json['httpRequestModel'] as Map)),
|
|
responseStatus: (json['responseStatus'] as num?)?.toInt(),
|
|
message: json['message'] as String?,
|
|
httpResponseModel: json['httpResponseModel'] == null
|
|
? null
|
|
: HttpResponseModel.fromJson(
|
|
Map<String, Object?>.from(json['httpResponseModel'] as Map)),
|
|
isWorking: json['isWorking'] as bool? ?? false,
|
|
sendingTime: json['sendingTime'] == null
|
|
? null
|
|
: DateTime.parse(json['sendingTime'] as String),
|
|
preRequestScript: json['preRequestScript'] as String?,
|
|
postRequestScript: json['postRequestScript'] as String?,
|
|
);
|
|
|
|
Map<String, dynamic> _$$RequestModelImplToJson(_$RequestModelImpl instance) =>
|
|
<String, dynamic>{
|
|
'id': instance.id,
|
|
'apiType': _$APITypeEnumMap[instance.apiType]!,
|
|
'name': instance.name,
|
|
'description': instance.description,
|
|
'authType': _$APIAuthTypeEnumMap[instance.authType]!,
|
|
'authData': instance.authData?.toJson(),
|
|
'httpRequestModel': instance.httpRequestModel?.toJson(),
|
|
'responseStatus': instance.responseStatus,
|
|
'message': instance.message,
|
|
'httpResponseModel': instance.httpResponseModel?.toJson(),
|
|
'preRequestScript': instance.preRequestScript,
|
|
'postRequestScript': instance.postRequestScript,
|
|
};
|
|
|
|
const _$APITypeEnumMap = {
|
|
APIType.rest: 'rest',
|
|
APIType.graphql: 'graphql',
|
|
};
|
|
|
|
const _$APIAuthTypeEnumMap = {
|
|
APIAuthType.none: 'none',
|
|
APIAuthType.basic: 'basic',
|
|
APIAuthType.apiKey: 'apiKey',
|
|
APIAuthType.bearerToken: 'bearerToken',
|
|
APIAuthType.jwtBearer: 'jwtBearer',
|
|
APIAuthType.digest: 'digest',
|
|
APIAuthType.oauth1: 'oauth1',
|
|
APIAuthType.oauth2: 'oauth2',
|
|
};
|