part of 'generated.dart';

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

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

  ListStaffCoursesByStaffIdVariablesBuilder(this._dataConnect, {required  this.staffId,});
  Deserializer<ListStaffCoursesByStaffIdData> dataDeserializer = (dynamic json)  => ListStaffCoursesByStaffIdData.fromJson(jsonDecode(json));
  Serializer<ListStaffCoursesByStaffIdVariables> varsSerializer = (ListStaffCoursesByStaffIdVariables vars) => jsonEncode(vars.toJson());
  Future<QueryResult<ListStaffCoursesByStaffIdData, ListStaffCoursesByStaffIdVariables>> execute() {
    return ref().execute();
  }

  QueryRef<ListStaffCoursesByStaffIdData, ListStaffCoursesByStaffIdVariables> ref() {
    ListStaffCoursesByStaffIdVariables vars= ListStaffCoursesByStaffIdVariables(staffId: staffId,offset: _offset,limit: _limit,);
    return _dataConnect.query("listStaffCoursesByStaffId", dataDeserializer, varsSerializer, vars);
  }
}

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

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

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

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

@immutable
class ListStaffCoursesByStaffIdVariables {
  final String staffId;
  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.')
  ListStaffCoursesByStaffIdVariables.fromJson(Map<String, dynamic> json):
  
  staffId = nativeFromJson<String>(json['staffId']) {
  
  
  
    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 ListStaffCoursesByStaffIdVariables otherTyped = other as ListStaffCoursesByStaffIdVariables;
    return staffId == otherTyped.staffId && 
    offset == otherTyped.offset && 
    limit == otherTyped.limit;
    
  }
  @override
  int get hashCode => Object.hashAll([staffId.hashCode, offset.hashCode, limit.hashCode]);
  

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

  ListStaffCoursesByStaffIdVariables({
    required this.staffId,
    required this.offset,
    required this.limit,
  });
}

