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(new EnvDetail.fromJson(v));
      });
    }
  }

  Map<String, dynamic> toJson() {
    final Map<String, dynamic> data = new Map<String, dynamic>();
    data['activityId'] = this.activityId;
    data['cropId'] = this.cropId;
    data['executeDate'] = this.executeDate;
    data['description'] = this.description;
    data['media_del'] = this.mediaDel;
    if (this.envDetail != null) {
      data['envDetail'] = this.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 Map<String, dynamic> data = new Map<String, dynamic>();
    data['name'] = this.name;
    data['index'] = this.index;
    return data;
  }
}
