part of 'generated.dart';

class ListStaffCoursesByCourseIdVariablesBuilder {
  String courseId;
  Optional<int> _offset = Optional.optional(nativeFromJson, nativeToJson);
  Optional<int> _limit = Optional.optional(nativeFromJson, nativeToJson);

  final FirebaseDataConnect _dataConnect;  ListStaffCoursesByCourseIdVariablesBuilder offset(int? t) {
   _offset.value = t;
   return this;
  }
  ListStaffCoursesByCourseIdVariablesBuilder limit(int? t) {
   _limit.value = t;
   return this;
  }

  ListStaffCoursesByCourseIdVariablesBuilder(this._dataConnect, {required  this.courseId,});
  Deserializer<ListStaffCoursesByCourseIdData> dataDeserializer = (dynamic json)  => ListStaffCoursesByCourseIdData.fromJson(jsonDecode(json));
  Serializer<ListStaffCoursesByCourseIdVariables> varsSerializer = (ListStaffCoursesByCourseIdVariables vars) => jsonEncode(vars.toJson());
  Future<QueryResult<ListStaffCoursesByCourseIdData, ListStaffCoursesByCourseIdVariables>> execute() {
    return ref().execute();
  }

  QueryRef<ListStaffCoursesByCourseIdData, ListStaffCoursesByCourseIdVariables> ref() {
    ListStaffCoursesByCourseIdVariables vars= ListStaffCoursesByCourseIdVariables(courseId: courseId,offset: _offset,limit: _limit,);
    return _dataConnect.query("listStaffCoursesByCourseId", dataDeserializer, varsSerializer, vars);
  }
}

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

  ListStaffCoursesByCourseIdStaffCourses({
    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 ListStaffCoursesByCourseIdData {
  final List<ListStaffCoursesByCourseIdStaffCourses> staffCourses;
  ListStaffCoursesByCourseIdData.fromJson(dynamic json):
  
  staffCourses = (json['staffCourses'] as List<dynamic>)
        .map((e) => ListStaffCoursesByCourseIdStaffCourses.fromJson(e))
        .toList();
  @override
  bool operator ==(Object other) {
    if(identical(this, other)) {
      return true;
    }
    if(other.runtimeType != runtimeType) {
      return false;
    }

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

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

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

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

  Map<String, dynamic> toJson() {
    Map<String, dynamic> json = {};
    json['courseId'] = nativeToJson<String>(courseId);
    if(offset.state == OptionalState.set) {
      json['offset'] = offset.toJson();
    }
    if(limit.state == OptionalState.set) {
      json['limit'] = limit.toJson();
    }
    return json;
  }

  ListStaffCoursesByCourseIdVariables({
    required this.courseId,
    required this.offset,
    required this.limit,
  });
}

