part of 'generated.dart';

class ListShiftsForCoverageVariablesBuilder {
  String businessId;
  Timestamp startDate;
  Timestamp endDate;

  final FirebaseDataConnect _dataConnect;
  ListShiftsForCoverageVariablesBuilder(this._dataConnect, {required  this.businessId,required  this.startDate,required  this.endDate,});
  Deserializer<ListShiftsForCoverageData> dataDeserializer = (dynamic json)  => ListShiftsForCoverageData.fromJson(jsonDecode(json));
  Serializer<ListShiftsForCoverageVariables> varsSerializer = (ListShiftsForCoverageVariables vars) => jsonEncode(vars.toJson());
  Future<QueryResult<ListShiftsForCoverageData, ListShiftsForCoverageVariables>> execute() {
    return ref().execute();
  }

  QueryRef<ListShiftsForCoverageData, ListShiftsForCoverageVariables> ref() {
    ListShiftsForCoverageVariables vars= ListShiftsForCoverageVariables(businessId: businessId,startDate: startDate,endDate: endDate,);
    return _dataConnect.query("listShiftsForCoverage", dataDeserializer, varsSerializer, vars);
  }
}

@immutable
class ListShiftsForCoverageShifts {
  final String id;
  final Timestamp? date;
  final int? workersNeeded;
  final int? filled;
  final EnumValue<ShiftStatus>? status;
  ListShiftsForCoverageShifts.fromJson(dynamic json):
  
  id = nativeFromJson<String>(json['id']),
  date = json['date'] == null ? null : Timestamp.fromJson(json['date']),
  workersNeeded = json['workersNeeded'] == null ? null : nativeFromJson<int>(json['workersNeeded']),
  filled = json['filled'] == null ? null : nativeFromJson<int>(json['filled']),
  status = json['status'] == null ? null : shiftStatusDeserializer(json['status']);
  @override
  bool operator ==(Object other) {
    if(identical(this, other)) {
      return true;
    }
    if(other.runtimeType != runtimeType) {
      return false;
    }

    final ListShiftsForCoverageShifts otherTyped = other as ListShiftsForCoverageShifts;
    return id == otherTyped.id && 
    date == otherTyped.date && 
    workersNeeded == otherTyped.workersNeeded && 
    filled == otherTyped.filled && 
    status == otherTyped.status;
    
  }
  @override
  int get hashCode => Object.hashAll([id.hashCode, date.hashCode, workersNeeded.hashCode, filled.hashCode, status.hashCode]);
  

  Map<String, dynamic> toJson() {
    Map<String, dynamic> json = {};
    json['id'] = nativeToJson<String>(id);
    if (date != null) {
      json['date'] = date!.toJson();
    }
    if (workersNeeded != null) {
      json['workersNeeded'] = nativeToJson<int?>(workersNeeded);
    }
    if (filled != null) {
      json['filled'] = nativeToJson<int?>(filled);
    }
    if (status != null) {
      json['status'] = 
    shiftStatusSerializer(status!)
    ;
    }
    return json;
  }

  ListShiftsForCoverageShifts({
    required this.id,
    this.date,
    this.workersNeeded,
    this.filled,
    this.status,
  });
}

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

    final ListShiftsForCoverageData otherTyped = other as ListShiftsForCoverageData;
    return shifts == otherTyped.shifts;
    
  }
  @override
  int get hashCode => shifts.hashCode;
  

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

  ListShiftsForCoverageData({
    required this.shifts,
  });
}

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

    final ListShiftsForCoverageVariables otherTyped = other as ListShiftsForCoverageVariables;
    return businessId == otherTyped.businessId && 
    startDate == otherTyped.startDate && 
    endDate == otherTyped.endDate;
    
  }
  @override
  int get hashCode => Object.hashAll([businessId.hashCode, startDate.hashCode, endDate.hashCode]);
  

  Map<String, dynamic> toJson() {
    Map<String, dynamic> json = {};
    json['businessId'] = nativeToJson<String>(businessId);
    json['startDate'] = startDate.toJson();
    json['endDate'] = endDate.toJson();
    return json;
  }

  ListShiftsForCoverageVariables({
    required this.businessId,
    required this.startDate,
    required this.endDate,
  });
}

