// To parse this JSON data, do
//
//     final learningDevelopement = learningDevelopementFromJson(jsonString);

import 'dart:convert';

LearningDevelopement learningDevelopementFromJson(String str) => LearningDevelopement.fromJson(json.decode(str));

String learningDevelopementToJson(LearningDevelopement data) => json.encode(data.toJson());

class LearningDevelopement {
    LearningDevelopement({
        this.attachments,
        this.sponsoredBy,
        this.conductedTraining,
        this.totalHoursAttended,
    });

    final dynamic attachments;
    final EdBy? sponsoredBy;
    final ConductedTraining? conductedTraining;
    final int? totalHoursAttended;

    factory LearningDevelopement.fromJson(Map<String, dynamic> json) => LearningDevelopement(
        attachments: json["attachments"],
        sponsoredBy: json["sponsored_by"] == null ? null : EdBy.fromJson(json["sponsored_by"]),
        conductedTraining: json["conducted_training"] == null ? null : ConductedTraining.fromJson(json["conducted_training"]),
        totalHoursAttended: json["total_hours_attended"],
    );

    Map<String, dynamic> toJson() => {
        "attachments": attachments,
        "sponsored_by": sponsoredBy?.toJson(),
        "conducted_training": conductedTraining?.toJson(),
        "total_hours_attended": totalHoursAttended,
    };
}

class ConductedTraining {
    ConductedTraining({
        this.id,
        this.title,
        this.topic,
        this.venue,
        this.locked,
        this.toDate,
        this.fromDate,
        this.totalHours,
        this.conductedBy,
        this.sessionsAttended,
        this.learningDevelopmentType,
    });

    final int? id;
    final LearningDevelopmentType? title;
    final LearningDevelopmentType? topic;
    final Venue? venue;
    final bool? locked;
    final DateTime? toDate;
    final DateTime? fromDate;
    final int? totalHours;
    final EdBy? conductedBy;
    final List<dynamic>? sessionsAttended;
    final LearningDevelopmentType? learningDevelopmentType;

    factory ConductedTraining.fromJson(Map<String, dynamic> json) => ConductedTraining(
        id: json["id"],
        title: json["title"] == null ? null : LearningDevelopmentType.fromJson(json["title"]),
        topic: json["topic"] == null ? null : LearningDevelopmentType.fromJson(json["topic"]),
        venue: json["venue"] == null ? null : Venue.fromJson(json["venue"]),
        locked: json["locked"],
        toDate: json["to_date"] == null ? null : DateTime.parse(json["to_date"]),
        fromDate: json["from_date"] == null ? null : DateTime.parse(json["from_date"]),
        totalHours: json["total_hours"],
        conductedBy: json["conducted_by"] == null ? null : EdBy.fromJson(json["conducted_by"]),
        sessionsAttended: json["sessions_attended"] == null ? [] : List<dynamic>.from(json["sessions_attended"]!.map((x) => x)),
        learningDevelopmentType: json["learning_development_type"] == null ? null : LearningDevelopmentType.fromJson(json["learning_development_type"]),
    );

    Map<String, dynamic> toJson() => {
        "id": id,
        "title": title?.toJson(),
        "topic": topic?.toJson(),
        "venue": venue?.toJson(),
        "locked": locked,
        "to_date": "${toDate!.year.toString().padLeft(4, '0')}-${toDate!.month.toString().padLeft(2, '0')}-${toDate!.day.toString().padLeft(2, '0')}",
        "from_date": "${fromDate!.year.toString().padLeft(4, '0')}-${fromDate!.month.toString().padLeft(2, '0')}-${fromDate!.day.toString().padLeft(2, '0')}",
        "total_hours": totalHours,
        "conducted_by": conductedBy?.toJson(),
        "sessions_attended": sessionsAttended == null ? [] : List<dynamic>.from(sessionsAttended!.map((x) => x)),
        "learning_development_type": learningDevelopmentType?.toJson(),
    };
}

class EdBy {
    EdBy({
        this.id,
        this.name,
        this.category,
        this.privateEntity,
    });

    final int? id;
    final String? name;
    final SponsoredByCategory? category;
    final bool? privateEntity;

    factory EdBy.fromJson(Map<String, dynamic> json) => EdBy(
        id: json["id"],
        name: json["name"],
        category: json["category"] == null ? null : SponsoredByCategory.fromJson(json["category"]),
        privateEntity: json["private_entity"],
    );

    Map<String, dynamic> toJson() => {
        "id": id,
        "name": name,
        "category": category?.toJson(),
        "private_entity": privateEntity,
    };
}

class SponsoredByCategory {
    SponsoredByCategory({
        this.id,
        this.name,
        this.industryClass,
    });

    final int? id;
    final String? name;
    final IndustryClass? industryClass;

    factory SponsoredByCategory.fromJson(Map<String, dynamic> json) => SponsoredByCategory(
        id: json["id"],
        name: json["name"],
        industryClass: json["industry_class"] == null ? null : IndustryClass.fromJson(json["industry_class"]),
    );

    Map<String, dynamic> toJson() => {
        "id": id,
        "name": name,
        "industry_class": industryClass?.toJson(),
    };
}

class IndustryClass {
    IndustryClass({
        this.id,
        this.name,
        this.description,
    });

    final int? id;
    final String? name;
    final dynamic description;

    factory IndustryClass.fromJson(Map<String, dynamic> json) => IndustryClass(
        id: json["id"],
        name: json["name"],
        description: json["description"],
    );

    Map<String, dynamic> toJson() => {
        "id": id,
        "name": name,
        "description": description,
    };
}

class LearningDevelopmentType {
    LearningDevelopmentType({
        this.id,
        this.title,
    });

    final int? id;
    final String? title;

    factory LearningDevelopmentType.fromJson(Map<String, dynamic> json) => LearningDevelopmentType(
        id: json["id"],
        title: json["title"],
    );

    Map<String, dynamic> toJson() => {
        "id": id,
        "title": title,
    };
}

class Venue {
    Venue({
        this.id,
        this.country,
        this.barangay,
        this.category,
        this.areaClass,
        this.cityMunicipality,
    });

    final int? id;
    final Country? country;
    final dynamic barangay;
    final VenueCategory? category;
    final dynamic areaClass;
    final CityMunicipality? cityMunicipality;

    factory Venue.fromJson(Map<String, dynamic> json) => Venue(
        id: json["id"],
        country: json["country"] == null ? null : Country.fromJson(json["country"]),
        barangay: json["barangay"],
        category: json["category"] == null ? null : VenueCategory.fromJson(json["category"]),
        areaClass: json["area_class"],
        cityMunicipality: json["city_municipality"] == null ? null : CityMunicipality.fromJson(json["city_municipality"]),
    );

    Map<String, dynamic> toJson() => {
        "id": id,
        "country": country?.toJson(),
        "barangay": barangay,
        "category": category?.toJson(),
        "area_class": areaClass,
        "city_municipality": cityMunicipality?.toJson(),
    };
}

class VenueCategory {
    VenueCategory({
        this.id,
        this.name,
        this.type,
    });

    final int? id;
    final String? name;
    final String? type;

    factory VenueCategory.fromJson(Map<String, dynamic> json) => VenueCategory(
        id: json["id"],
        name: json["name"],
        type: json["type"],
    );

    Map<String, dynamic> toJson() => {
        "id": id,
        "name": name,
        "type": type,
    };
}

class CityMunicipality {
    CityMunicipality({
        this.code,
        this.zipcode,
        this.province,
        this.psgcCode,
        this.description,
    });

    final String? code;
    final String? zipcode;
    final Province? province;
    final String? psgcCode;
    final String? description;

    factory CityMunicipality.fromJson(Map<String, dynamic> json) => CityMunicipality(
        code: json["code"],
        zipcode: json["zipcode"],
        province: json["province"] == null ? null : Province.fromJson(json["province"]),
        psgcCode: json["psgc_code"],
        description: json["description"],
    );

    Map<String, dynamic> toJson() => {
        "code": code,
        "zipcode": zipcode,
        "province": province?.toJson(),
        "psgc_code": psgcCode,
        "description": description,
    };
}

class Province {
    Province({
        this.code,
        this.region,
        this.psgcCode,
        this.shortname,
        this.description,
    });

    final String? code;
    final Region? region;
    final String? psgcCode;
    final String? shortname;
    final String? description;

    factory Province.fromJson(Map<String, dynamic> json) => Province(
        code: json["code"],
        region: json["region"] == null ? null : Region.fromJson(json["region"]),
        psgcCode: json["psgc_code"],
        shortname: json["shortname"],
        description: json["description"],
    );

    Map<String, dynamic> toJson() => {
        "code": code,
        "region": region?.toJson(),
        "psgc_code": psgcCode,
        "shortname": shortname,
        "description": description,
    };
}

class Region {
    Region({
        this.code,
        this.psgcCode,
        this.description,
    });

    final int? code;
    final String? psgcCode;
    final String? description;

    factory Region.fromJson(Map<String, dynamic> json) => Region(
        code: json["code"],
        psgcCode: json["psgc_code"],
        description: json["description"],
    );

    Map<String, dynamic> toJson() => {
        "code": code,
        "psgc_code": psgcCode,
        "description": description,
    };
}

class Country {
    Country({
        this.id,
        this.code,
        this.name,
    });

    final int? id;
    final String? code;
    final String? name;

    factory Country.fromJson(Map<String, dynamic> json) => Country(
        id: json["id"],
        code: json["code"],
        name: json["name"],
    );

    Map<String, dynamic> toJson() => {
        "id": id,
        "code": code,
        "name": name,
    };
}
