part of 'generated.dart';

class ListCoursesVariablesBuilder {
  
  final FirebaseDataConnect _dataConnect;
  ListCoursesVariablesBuilder(this._dataConnect, );
  Deserializer<ListCoursesData> dataDeserializer = (dynamic json)  => ListCoursesData.fromJson(jsonDecode(json));
  
  Future<QueryResult<ListCoursesData, void>> execute() {
    return ref().execute();
  }

  QueryRef<ListCoursesData, void> ref() {
    
    return _dataConnect.query("listCourses", dataDeserializer, emptySerializer, null);
  }
}

@immutable
class ListCoursesCourses {
  final String id;
  final String? title;
  final String? description;
  final String? thumbnailUrl;
  final int? durationMinutes;
  final int? xpReward;
  final String categoryId;
  final String? levelRequired;
  final bool? isCertification;
  final Timestamp? createdAt;
  final ListCoursesCoursesCategory category;
  ListCoursesCourses.fromJson(dynamic json):
  
  id = nativeFromJson<String>(json['id']),
  title = json['title'] == null ? null : nativeFromJson<String>(json['title']),
  description = json['description'] == null ? null : nativeFromJson<String>(json['description']),
  thumbnailUrl = json['thumbnailUrl'] == null ? null : nativeFromJson<String>(json['thumbnailUrl']),
  durationMinutes = json['durationMinutes'] == null ? null : nativeFromJson<int>(json['durationMinutes']),
  xpReward = json['xpReward'] == null ? null : nativeFromJson<int>(json['xpReward']),
  categoryId = nativeFromJson<String>(json['categoryId']),
  levelRequired = json['levelRequired'] == null ? null : nativeFromJson<String>(json['levelRequired']),
  isCertification = json['isCertification'] == null ? null : nativeFromJson<bool>(json['isCertification']),
  createdAt = json['createdAt'] == null ? null : Timestamp.fromJson(json['createdAt']),
  category = ListCoursesCoursesCategory.fromJson(json['category']);
  @override
  bool operator ==(Object other) {
    if(identical(this, other)) {
      return true;
    }
    if(other.runtimeType != runtimeType) {
      return false;
    }

    final ListCoursesCourses otherTyped = other as ListCoursesCourses;
    return id == otherTyped.id && 
    title == otherTyped.title && 
    description == otherTyped.description && 
    thumbnailUrl == otherTyped.thumbnailUrl && 
    durationMinutes == otherTyped.durationMinutes && 
    xpReward == otherTyped.xpReward && 
    categoryId == otherTyped.categoryId && 
    levelRequired == otherTyped.levelRequired && 
    isCertification == otherTyped.isCertification && 
    createdAt == otherTyped.createdAt && 
    category == otherTyped.category;
    
  }
  @override
  int get hashCode => Object.hashAll([id.hashCode, title.hashCode, description.hashCode, thumbnailUrl.hashCode, durationMinutes.hashCode, xpReward.hashCode, categoryId.hashCode, levelRequired.hashCode, isCertification.hashCode, createdAt.hashCode, category.hashCode]);
  

  Map<String, dynamic> toJson() {
    Map<String, dynamic> json = {};
    json['id'] = nativeToJson<String>(id);
    if (title != null) {
      json['title'] = nativeToJson<String?>(title);
    }
    if (description != null) {
      json['description'] = nativeToJson<String?>(description);
    }
    if (thumbnailUrl != null) {
      json['thumbnailUrl'] = nativeToJson<String?>(thumbnailUrl);
    }
    if (durationMinutes != null) {
      json['durationMinutes'] = nativeToJson<int?>(durationMinutes);
    }
    if (xpReward != null) {
      json['xpReward'] = nativeToJson<int?>(xpReward);
    }
    json['categoryId'] = nativeToJson<String>(categoryId);
    if (levelRequired != null) {
      json['levelRequired'] = nativeToJson<String?>(levelRequired);
    }
    if (isCertification != null) {
      json['isCertification'] = nativeToJson<bool?>(isCertification);
    }
    if (createdAt != null) {
      json['createdAt'] = createdAt!.toJson();
    }
    json['category'] = category.toJson();
    return json;
  }

  ListCoursesCourses({
    required this.id,
    this.title,
    this.description,
    this.thumbnailUrl,
    this.durationMinutes,
    this.xpReward,
    required this.categoryId,
    this.levelRequired,
    this.isCertification,
    this.createdAt,
    required this.category,
  });
}

@immutable
class ListCoursesCoursesCategory {
  final String id;
  final String label;
  ListCoursesCoursesCategory.fromJson(dynamic json):
  
  id = nativeFromJson<String>(json['id']),
  label = nativeFromJson<String>(json['label']);
  @override
  bool operator ==(Object other) {
    if(identical(this, other)) {
      return true;
    }
    if(other.runtimeType != runtimeType) {
      return false;
    }

    final ListCoursesCoursesCategory otherTyped = other as ListCoursesCoursesCategory;
    return id == otherTyped.id && 
    label == otherTyped.label;
    
  }
  @override
  int get hashCode => Object.hashAll([id.hashCode, label.hashCode]);
  

  Map<String, dynamic> toJson() {
    Map<String, dynamic> json = {};
    json['id'] = nativeToJson<String>(id);
    json['label'] = nativeToJson<String>(label);
    return json;
  }

  ListCoursesCoursesCategory({
    required this.id,
    required this.label,
  });
}

@immutable
class ListCoursesData {
  final List<ListCoursesCourses> courses;
  ListCoursesData.fromJson(dynamic json):
  
  courses = (json['courses'] as List<dynamic>)
        .map((e) => ListCoursesCourses.fromJson(e))
        .toList();
  @override
  bool operator ==(Object other) {
    if(identical(this, other)) {
      return true;
    }
    if(other.runtimeType != runtimeType) {
      return false;
    }

    final ListCoursesData otherTyped = other as ListCoursesData;
    return courses == otherTyped.courses;
    
  }
  @override
  int get hashCode => courses.hashCode;
  

  Map<String, dynamic> toJson() {
    Map<String, dynamic> json = {};
    json['courses'] = courses.map((e) => e.toJson()).toList();
    return json;
  }

  ListCoursesData({
    required this.courses,
  });
}

