// ignore_for_file: non_constant_identifier_names, avoid_init_to_null

import 'package:json_annotation/json_annotation.dart';
import 'package:oto/oto/data/base_data.dart';

part 'network_data.g.dart';

//FTP
@JsonSerializable()
class DataFTP extends DataParam {
  DataFTP();

  late bool sftp;
  late int port;
  late String host;
  late String user;
  late String password;
  late Map<String, String> map;

  factory DataFTP.fromJson(Map<String, dynamic> json) =>
      _$DataFTPFromJson(json);
  @override
  Map<String, dynamic> toJson() => _$DataFTPToJson(this);
}

//Web Base
@JsonSerializable()
class DataWebBase extends DataParam {
  DataWebBase();

  late String url;
  late String? method;
  late Map<String, String>? headers = <String, String>{};
  late Map<String, String>? fields = <String, String>{};
  late List<dynamic>? successCodes;
  late String? setResponse;

  factory DataWebBase.fromJson(Map<String, dynamic> json) =>
      _$DataWebBaseFromJson(json);
  @override
  Map<String, dynamic> toJson() => _$DataWebBaseToJson(this);
}

//Web File
@JsonSerializable()
class DataWebFile extends DataWebBase {
  DataWebFile();

  late String? filePart;
  late String? fileMimeType;
  late List<String>? files = [];

  factory DataWebFile.fromJson(Map<String, dynamic> json) =>
      _$DataWebFileFromJson(json);
  @override
  Map<String, dynamic> toJson() => _$DataWebFileToJson(this);
}
