part of 'generated.dart';

class GetStaffCourseByIdVariablesBuilder {
  String id;

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

  QueryRef<GetStaffCourseByIdData, GetStaffCourseByIdVariables> ref() {
    GetStaffCourseByIdVariables vars= GetStaffCourseByIdVariables(id: id,);
    return _dataConnect.query("getStaffCourseById", dataDeserializer, varsSerializer, vars);
  }
}

@immutable
class GetStaffCourseByIdStaffCourse {
  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;
  GetStaffCourseByIdStaffCourse.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 GetStaffCourseByIdStaffCourse otherTyped = other as GetStaffCourseByIdStaffCourse;
    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;
  }

  GetStaffCourseByIdStaffCourse({
    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 GetStaffCourseByIdData {
  final GetStaffCourseByIdStaffCourse? staffCourse;
  GetStaffCourseByIdData.fromJson(dynamic json):
  
  staffCourse = json['staffCourse'] == null ? null : GetStaffCourseByIdStaffCourse.fromJson(json['staffCourse']);
  @override
  bool operator ==(Object other) {
    if(identical(this, other)) {
      return true;
    }
    if(other.runtimeType != runtimeType) {
      return false;
    }

    final GetStaffCourseByIdData otherTyped = other as GetStaffCourseByIdData;
    return staffCourse == otherTyped.staffCourse;
    
  }
  @override
  int get hashCode => staffCourse.hashCode;
  

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

  GetStaffCourseByIdData({
    this.staffCourse,
  });
}

@immutable
class GetStaffCourseByIdVariables {
  final String id;
  @Deprecated('fromJson is deprecated for Variable classes as they are no longer required for deserialization.')
  GetStaffCourseByIdVariables.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 GetStaffCourseByIdVariables otherTyped = other as GetStaffCourseByIdVariables;
    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;
  }

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

