class RequestEnvironment {
  int? activityId;
  int? cropId;
  String? executeDate;
  String? description;
  List<String>? mediaDel;
  List<EnvDetail>? envDetail;

  RequestEnvironment({this.activityId, this.cropId, this.executeDate, this.description, this.mediaDel, this.envDetail});

  RequestEnvironment.fromJson(Map<String, dynamic> json) {
    activityId = json['activityId'];
    cropId = json['cropId'];
    executeDate = json['executeDate'];
    description = json['description'];
    if (json['envDetail'] != null) {
      envDetail = <EnvDetail>[];
      json['envDetail'].forEach((v) {
        envDetail?.add(EnvDetail.fromJson(v));
      });
    }
  }

  Map<String, dynamic> toJson() {
    final data = <String, dynamic>{};
    data['activityId'] = activityId;
    data['cropId'] = cropId;
    data['executeDate'] = executeDate;
    data['description'] = description;
    data['media_del'] = mediaDel;
    if (envDetail != null) {
      data['envDetail'] = envDetail?.map((v) => v.toJson()).toList();
    }
    return data;
  }
}

class EnvDetail {
  String? name;
  String? index;

  EnvDetail({this.name, this.index});

  EnvDetail.fromJson(Map<String, dynamic> json) {
    name = json['name'];
    index = json['index'];
  }

  Map<String, dynamic> toJson() {
    final data = <String, dynamic>{};
    data['name'] = name;
    data['index'] = index;
    return data;
  }
}
