part of 'generated.dart';

class GetCourseByIdVariablesBuilder {
  String id;

  final FirebaseDataConnect _dataConnect;
  GetCourseByIdVariablesBuilder(this._dataConnect, {required  this.id,});
  Deserializer<GetCourseByIdData> dataDeserializer = (dynamic json)  => GetCourseByIdData.fromJson(jsonDecode(json));
  Serializer<GetCourseByIdVariables> varsSerializer = (GetCourseByIdVariables vars) => jsonEncode(vars.toJson());
  Future<QueryResult<GetCourseByIdData, GetCourseByIdVariables>> execute() {
    return ref().execute();
  }

  QueryRef<GetCourseByIdData, GetCourseByIdVariables> ref() {
    GetCourseByIdVariables vars= GetCourseByIdVariables(id: id,);
    return _dataConnect.query("getCourseById", dataDeserializer, varsSerializer, vars);
  }
}

@immutable
class GetCourseByIdCourse {
  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 GetCourseByIdCourseCategory category;
  GetCourseByIdCourse.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 = GetCourseByIdCourseCategory.fromJson(json['category']);
  @override
  bool operator ==(Object other) {
    if(identical(this, other)) {
      return true;
    }
    if(other.runtimeType != runtimeType) {
      return false;
    }

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

  GetCourseByIdCourse({
    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 GetCourseByIdCourseCategory {
  final String id;
  final String label;
  GetCourseByIdCourseCategory.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 GetCourseByIdCourseCategory otherTyped = other as GetCourseByIdCourseCategory;
    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;
  }

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

@immutable
class GetCourseByIdData {
  final GetCourseByIdCourse? course;
  GetCourseByIdData.fromJson(dynamic json):
  
  course = json['course'] == null ? null : GetCourseByIdCourse.fromJson(json['course']);
  @override
  bool operator ==(Object other) {
    if(identical(this, other)) {
      return true;
    }
    if(other.runtimeType != runtimeType) {
      return false;
    }

    final GetCourseByIdData otherTyped = other as GetCourseByIdData;
    return course == otherTyped.course;
    
  }
  @override
  int get hashCode => course.hashCode;
  

  Map<String, dynamic> toJson() {
    Map<String, dynamic> json = {};
    if (course != null) {
      json['course'] = course!.toJson();
    }
    return json;
  }

  GetCourseByIdData({
    this.course,
  });
}

@immutable
class GetCourseByIdVariables {
  final String id;
  @Deprecated('fromJson is deprecated for Variable classes as they are no longer required for deserialization.')
  GetCourseByIdVariables.fromJson(Map<String, dynamic> json):
  
  id = nativeFromJson<String>(json['id']);
  @override
  bool operator ==(Object other) {
    if(identical(this, other)) {
      return true;
    }
    if(other.runtimeType != runtimeType) {
      return false;
    }

    final GetCourseByIdVariables otherTyped = other as GetCourseByIdVariables;
    return id == otherTyped.id;
    
  }
  @override
  int get hashCode => id.hashCode;
  

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

  GetCourseByIdVariables({
    required this.id,
  });
}

