part of 'generated.dart';

class GetStaffCourseByStaffAndCourseVariablesBuilder {
  String staffId;
  String courseId;

  final FirebaseDataConnect _dataConnect;
  GetStaffCourseByStaffAndCourseVariablesBuilder(this._dataConnect, {required  this.staffId,required  this.courseId,});
  Deserializer<GetStaffCourseByStaffAndCourseData> dataDeserializer = (dynamic json)  => GetStaffCourseByStaffAndCourseData.fromJson(jsonDecode(json));
  Serializer<GetStaffCourseByStaffAndCourseVariables> varsSerializer = (GetStaffCourseByStaffAndCourseVariables vars) => jsonEncode(vars.toJson());
  Future<QueryResult<GetStaffCourseByStaffAndCourseData, GetStaffCourseByStaffAndCourseVariables>> execute() {
    return ref().execute();
  }

  QueryRef<GetStaffCourseByStaffAndCourseData, GetStaffCourseByStaffAndCourseVariables> ref() {
    GetStaffCourseByStaffAndCourseVariables vars= GetStaffCourseByStaffAndCourseVariables(staffId: staffId,courseId: courseId,);
    return _dataConnect.query("getStaffCourseByStaffAndCourse", dataDeserializer, varsSerializer, vars);
  }
}

@immutable
class GetStaffCourseByStaffAndCourseStaffCourses {
  final String id;
  final String staffId;
  final String courseId;
  final int? progressPercent;
  final bool? completed;
  final Timestamp? completedAt;
  final Timestamp? startedAt;
  final Timestamp? lastAccessedAt;
  final Timestamp? createdAt;
  final Timestamp? updatedAt;
  GetStaffCourseByStaffAndCourseStaffCourses.fromJson(dynamic json):
  
  id = nativeFromJson<String>(json['id']),
  staffId = nativeFromJson<String>(json['staffId']),
  courseId = nativeFromJson<String>(json['courseId']),
  progressPercent = json['progressPercent'] == null ? null : nativeFromJson<int>(json['progressPercent']),
  completed = json['completed'] == null ? null : nativeFromJson<bool>(json['completed']),
  completedAt = json['completedAt'] == null ? null : Timestamp.fromJson(json['completedAt']),
  startedAt = json['startedAt'] == null ? null : Timestamp.fromJson(json['startedAt']),
  lastAccessedAt = json['lastAccessedAt'] == null ? null : Timestamp.fromJson(json['lastAccessedAt']),
  createdAt = json['createdAt'] == null ? null : Timestamp.fromJson(json['createdAt']),
  updatedAt = json['updatedAt'] == null ? null : Timestamp.fromJson(json['updatedAt']);
  @override
  bool operator ==(Object other) {
    if(identical(this, other)) {
      return true;
    }
    if(other.runtimeType != runtimeType) {
      return false;
    }

    final GetStaffCourseByStaffAndCourseStaffCourses otherTyped = other as GetStaffCourseByStaffAndCourseStaffCourses;
    return id == otherTyped.id && 
    staffId == otherTyped.staffId && 
    courseId == otherTyped.courseId && 
    progressPercent == otherTyped.progressPercent && 
    completed == otherTyped.completed && 
    completedAt == otherTyped.completedAt && 
    startedAt == otherTyped.startedAt && 
    lastAccessedAt == otherTyped.lastAccessedAt && 
    createdAt == otherTyped.createdAt && 
    updatedAt == otherTyped.updatedAt;
    
  }
  @override
  int get hashCode => Object.hashAll([id.hashCode, staffId.hashCode, courseId.hashCode, progressPercent.hashCode, completed.hashCode, completedAt.hashCode, startedAt.hashCode, lastAccessedAt.hashCode, createdAt.hashCode, updatedAt.hashCode]);
  

  Map<String, dynamic> toJson() {
    Map<String, dynamic> json = {};
    json['id'] = nativeToJson<String>(id);
    json['staffId'] = nativeToJson<String>(staffId);
    json['courseId'] = nativeToJson<String>(courseId);
    if (progressPercent != null) {
      json['progressPercent'] = nativeToJson<int?>(progressPercent);
    }
    if (completed != null) {
      json['completed'] = nativeToJson<bool?>(completed);
    }
    if (completedAt != null) {
      json['completedAt'] = completedAt!.toJson();
    }
    if (startedAt != null) {
      json['startedAt'] = startedAt!.toJson();
    }
    if (lastAccessedAt != null) {
      json['lastAccessedAt'] = lastAccessedAt!.toJson();
    }
    if (createdAt != null) {
      json['createdAt'] = createdAt!.toJson();
    }
    if (updatedAt != null) {
      json['updatedAt'] = updatedAt!.toJson();
    }
    return json;
  }

  GetStaffCourseByStaffAndCourseStaffCourses({
    required this.id,
    required this.staffId,
    required this.courseId,
    this.progressPercent,
    this.completed,
    this.completedAt,
    this.startedAt,
    this.lastAccessedAt,
    this.createdAt,
    this.updatedAt,
  });
}

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

    final GetStaffCourseByStaffAndCourseData otherTyped = other as GetStaffCourseByStaffAndCourseData;
    return staffCourses == otherTyped.staffCourses;
    
  }
  @override
  int get hashCode => staffCourses.hashCode;
  

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

  GetStaffCourseByStaffAndCourseData({
    required this.staffCourses,
  });
}

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

    final GetStaffCourseByStaffAndCourseVariables otherTyped = other as GetStaffCourseByStaffAndCourseVariables;
    return staffId == otherTyped.staffId && 
    courseId == otherTyped.courseId;
    
  }
  @override
  int get hashCode => Object.hashAll([staffId.hashCode, courseId.hashCode]);
  

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

  GetStaffCourseByStaffAndCourseVariables({
    required this.staffId,
    required this.courseId,
  });
}

