part of 'generated.dart';

class FilterCoursesVariablesBuilder {
  Optional<String> _categoryId = Optional.optional(nativeFromJson, nativeToJson);
  Optional<bool> _isCertification = Optional.optional(nativeFromJson, nativeToJson);
  Optional<String> _levelRequired = Optional.optional(nativeFromJson, nativeToJson);
  Optional<bool> _completed = Optional.optional(nativeFromJson, nativeToJson);

  final FirebaseDataConnect _dataConnect;
  FilterCoursesVariablesBuilder categoryId(String? t) {
   _categoryId.value = t;
   return this;
  }
  FilterCoursesVariablesBuilder isCertification(bool? t) {
   _isCertification.value = t;
   return this;
  }
  FilterCoursesVariablesBuilder levelRequired(String? t) {
   _levelRequired.value = t;
   return this;
  }
  FilterCoursesVariablesBuilder completed(bool? t) {
   _completed.value = t;
   return this;
  }

  FilterCoursesVariablesBuilder(this._dataConnect, );
  Deserializer<FilterCoursesData> dataDeserializer = (dynamic json)  => FilterCoursesData.fromJson(jsonDecode(json));
  Serializer<FilterCoursesVariables> varsSerializer = (FilterCoursesVariables vars) => jsonEncode(vars.toJson());
  Future<QueryResult<FilterCoursesData, FilterCoursesVariables>> execute() {
    return ref().execute();
  }

  QueryRef<FilterCoursesData, FilterCoursesVariables> ref() {
    FilterCoursesVariables vars= FilterCoursesVariables(categoryId: _categoryId,isCertification: _isCertification,levelRequired: _levelRequired,completed: _completed,);
    return _dataConnect.query("filterCourses", dataDeserializer, varsSerializer, vars);
  }
}

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

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

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

  FilterCoursesCourses({
    required this.id,
    this.title,
    required this.categoryId,
    this.levelRequired,
    this.isCertification,
    required this.category,
  });
}

@immutable
class FilterCoursesCoursesCategory {
  final String id;
  final String label;
  FilterCoursesCoursesCategory.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 FilterCoursesCoursesCategory otherTyped = other as FilterCoursesCoursesCategory;
    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;
  }

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

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

    final FilterCoursesData otherTyped = other as FilterCoursesData;
    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;
  }

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

@immutable
class FilterCoursesVariables {
  late final Optional<String>categoryId;
  late final Optional<bool>isCertification;
  late final Optional<String>levelRequired;
  late final Optional<bool>completed;
  @Deprecated('fromJson is deprecated for Variable classes as they are no longer required for deserialization.')
  FilterCoursesVariables.fromJson(Map<String, dynamic> json) {
  
  
    categoryId = Optional.optional(nativeFromJson, nativeToJson);
    categoryId.value = json['categoryId'] == null ? null : nativeFromJson<String>(json['categoryId']);
  
  
    isCertification = Optional.optional(nativeFromJson, nativeToJson);
    isCertification.value = json['isCertification'] == null ? null : nativeFromJson<bool>(json['isCertification']);
  
  
    levelRequired = Optional.optional(nativeFromJson, nativeToJson);
    levelRequired.value = json['levelRequired'] == null ? null : nativeFromJson<String>(json['levelRequired']);
  
  
    completed = Optional.optional(nativeFromJson, nativeToJson);
    completed.value = json['completed'] == null ? null : nativeFromJson<bool>(json['completed']);
  
  }
  @override
  bool operator ==(Object other) {
    if(identical(this, other)) {
      return true;
    }
    if(other.runtimeType != runtimeType) {
      return false;
    }

    final FilterCoursesVariables otherTyped = other as FilterCoursesVariables;
    return categoryId == otherTyped.categoryId && 
    isCertification == otherTyped.isCertification && 
    levelRequired == otherTyped.levelRequired && 
    completed == otherTyped.completed;
    
  }
  @override
  int get hashCode => Object.hashAll([categoryId.hashCode, isCertification.hashCode, levelRequired.hashCode, completed.hashCode]);
  

  Map<String, dynamic> toJson() {
    Map<String, dynamic> json = {};
    if(categoryId.state == OptionalState.set) {
      json['categoryId'] = categoryId.toJson();
    }
    if(isCertification.state == OptionalState.set) {
      json['isCertification'] = isCertification.toJson();
    }
    if(levelRequired.state == OptionalState.set) {
      json['levelRequired'] = levelRequired.toJson();
    }
    if(completed.state == OptionalState.set) {
      json['completed'] = completed.toJson();
    }
    return json;
  }

  FilterCoursesVariables({
    required this.categoryId,
    required this.isCertification,
    required this.levelRequired,
    required this.completed,
  });
}

