class Teams {
  int? pageIndex;
  int? pageSize;
  int? totalPages;
  int? totalItems;
  List<ItemTeams>? items;

  Teams(
      {this.pageIndex,
        this.pageSize,
        this.totalPages,
        this.totalItems,
        this.items});

  Teams.fromJson(Map<String, dynamic> json) {
    pageIndex = json['pageIndex'];
    pageSize = json['pageSize'];
    totalPages = json['totalPages'];
    totalItems = json['totalItems'];
    if (json['items'] != null) {
      items = <ItemTeams>[];
      json['items'].forEach((v) {
        items!.add(new ItemTeams.fromJson(v));
      });
    }
  }

  Map<String, dynamic> toJson() {
    final Map<String, dynamic> data = new Map<String, dynamic>();
    data['pageIndex'] = this.pageIndex;
    data['pageSize'] = this.pageSize;
    data['totalPages'] = this.totalPages;
    data['totalItems'] = this.totalItems;
    if (this.items != null) {
      data['items'] = this.items!.map((v) => v.toJson()).toList();
    }
    return data;
  }
}

class ItemTeams {
  String? id;
  String? teamId;
  String? name;
  String? stadium;
  String? createdAt;
  String? updatedAt;
  int? iV;
  Null logo;
  Country? country;
  String? category;
  bool? favourite;

  ItemTeams(
      {this.id,
        this.teamId,
        this.name,
        this.stadium,
        this.createdAt,
        this.updatedAt,
        this.iV,
        this.logo,
        this.country,
        this.category,
        this.favourite,});

  ItemTeams.fromJson(Map<String, dynamic> json) {
    id = json['_id'];
    teamId = json['teamId'];
    name = json['name'];
    stadium = json['stadium'];
    createdAt = json['createdAt'];
    updatedAt = json['updatedAt'];
    iV = json['__v'];
    logo = json['logo'];
    category = json['category'];
    country =
    json['country'] != null ?  Country.fromJson(json['country']) : null;
    favourite = json['favourite'];
  }

  Map<String, dynamic> toJson() {
    final Map<String, dynamic> data = new Map<String, dynamic>();
    data['_id'] = this.id;
    data['teamId'] = this.teamId;
    data['name'] = this.name;
    data['stadium'] = this.stadium;
    data['createdAt'] = this.createdAt;
    data['updatedAt'] = this.updatedAt;
    data['__v'] = this.iV;
    data['logo'] = this.logo;
    if (this.country != null) {
      data['country'] = this.country!.toJson();
    }
    data['favourite'] = this.favourite;
    return data;
  }
}

class Country {
  String? sId;
  String? countryId;
  String? name;

  Country({this.sId, this.countryId, this.name});

  Country.fromJson(Map<String, dynamic> json) {
    sId = json['_id'];
    countryId = json['countryId'];
    name = json['name'];
  }

  Map<String, dynamic> toJson() {
    final Map<String, dynamic> data = new Map<String, dynamic>();
    data['_id'] = this.sId;
    data['countryId'] = this.countryId;
    data['name'] = this.name;
    return data;
  }
}