part of 'generated.dart';

class FilterStaffAvailabilityStatsVariablesBuilder {
  Optional<int> _needWorkIndexMin = Optional.optional(nativeFromJson, nativeToJson);
  Optional<int> _needWorkIndexMax = Optional.optional(nativeFromJson, nativeToJson);
  Optional<int> _utilizationMin = Optional.optional(nativeFromJson, nativeToJson);
  Optional<int> _utilizationMax = Optional.optional(nativeFromJson, nativeToJson);
  Optional<int> _acceptanceRateMin = Optional.optional(nativeFromJson, nativeToJson);
  Optional<int> _acceptanceRateMax = Optional.optional(nativeFromJson, nativeToJson);
  Optional<Timestamp> _lastShiftAfter = Optional.optional((json) => json['lastShiftAfter'] = Timestamp.fromJson(json['lastShiftAfter']), defaultSerializer);
  Optional<Timestamp> _lastShiftBefore = Optional.optional((json) => json['lastShiftBefore'] = Timestamp.fromJson(json['lastShiftBefore']), defaultSerializer);
  Optional<int> _offset = Optional.optional(nativeFromJson, nativeToJson);
  Optional<int> _limit = Optional.optional(nativeFromJson, nativeToJson);

  final FirebaseDataConnect _dataConnect;
  FilterStaffAvailabilityStatsVariablesBuilder needWorkIndexMin(int? t) {
   _needWorkIndexMin.value = t;
   return this;
  }
  FilterStaffAvailabilityStatsVariablesBuilder needWorkIndexMax(int? t) {
   _needWorkIndexMax.value = t;
   return this;
  }
  FilterStaffAvailabilityStatsVariablesBuilder utilizationMin(int? t) {
   _utilizationMin.value = t;
   return this;
  }
  FilterStaffAvailabilityStatsVariablesBuilder utilizationMax(int? t) {
   _utilizationMax.value = t;
   return this;
  }
  FilterStaffAvailabilityStatsVariablesBuilder acceptanceRateMin(int? t) {
   _acceptanceRateMin.value = t;
   return this;
  }
  FilterStaffAvailabilityStatsVariablesBuilder acceptanceRateMax(int? t) {
   _acceptanceRateMax.value = t;
   return this;
  }
  FilterStaffAvailabilityStatsVariablesBuilder lastShiftAfter(Timestamp? t) {
   _lastShiftAfter.value = t;
   return this;
  }
  FilterStaffAvailabilityStatsVariablesBuilder lastShiftBefore(Timestamp? t) {
   _lastShiftBefore.value = t;
   return this;
  }
  FilterStaffAvailabilityStatsVariablesBuilder offset(int? t) {
   _offset.value = t;
   return this;
  }
  FilterStaffAvailabilityStatsVariablesBuilder limit(int? t) {
   _limit.value = t;
   return this;
  }

  FilterStaffAvailabilityStatsVariablesBuilder(this._dataConnect, );
  Deserializer<FilterStaffAvailabilityStatsData> dataDeserializer = (dynamic json)  => FilterStaffAvailabilityStatsData.fromJson(jsonDecode(json));
  Serializer<FilterStaffAvailabilityStatsVariables> varsSerializer = (FilterStaffAvailabilityStatsVariables vars) => jsonEncode(vars.toJson());
  Future<QueryResult<FilterStaffAvailabilityStatsData, FilterStaffAvailabilityStatsVariables>> execute() {
    return ref().execute();
  }

  QueryRef<FilterStaffAvailabilityStatsData, FilterStaffAvailabilityStatsVariables> ref() {
    FilterStaffAvailabilityStatsVariables vars= FilterStaffAvailabilityStatsVariables(needWorkIndexMin: _needWorkIndexMin,needWorkIndexMax: _needWorkIndexMax,utilizationMin: _utilizationMin,utilizationMax: _utilizationMax,acceptanceRateMin: _acceptanceRateMin,acceptanceRateMax: _acceptanceRateMax,lastShiftAfter: _lastShiftAfter,lastShiftBefore: _lastShiftBefore,offset: _offset,limit: _limit,);
    return _dataConnect.query("filterStaffAvailabilityStats", dataDeserializer, varsSerializer, vars);
  }
}

@immutable
class FilterStaffAvailabilityStatsStaffAvailabilityStatss {
  final String id;
  final String staffId;
  final int? needWorkIndex;
  final int? utilizationPercentage;
  final int? predictedAvailabilityScore;
  final int? scheduledHoursThisPeriod;
  final int? desiredHoursThisPeriod;
  final Timestamp? lastShiftDate;
  final int? acceptanceRate;
  final Timestamp? createdAt;
  final Timestamp? updatedAt;
  final String? createdBy;
  final FilterStaffAvailabilityStatsStaffAvailabilityStatssStaff staff;
  FilterStaffAvailabilityStatsStaffAvailabilityStatss.fromJson(dynamic json):
  
  id = nativeFromJson<String>(json['id']),
  staffId = nativeFromJson<String>(json['staffId']),
  needWorkIndex = json['needWorkIndex'] == null ? null : nativeFromJson<int>(json['needWorkIndex']),
  utilizationPercentage = json['utilizationPercentage'] == null ? null : nativeFromJson<int>(json['utilizationPercentage']),
  predictedAvailabilityScore = json['predictedAvailabilityScore'] == null ? null : nativeFromJson<int>(json['predictedAvailabilityScore']),
  scheduledHoursThisPeriod = json['scheduledHoursThisPeriod'] == null ? null : nativeFromJson<int>(json['scheduledHoursThisPeriod']),
  desiredHoursThisPeriod = json['desiredHoursThisPeriod'] == null ? null : nativeFromJson<int>(json['desiredHoursThisPeriod']),
  lastShiftDate = json['lastShiftDate'] == null ? null : Timestamp.fromJson(json['lastShiftDate']),
  acceptanceRate = json['acceptanceRate'] == null ? null : nativeFromJson<int>(json['acceptanceRate']),
  createdAt = json['createdAt'] == null ? null : Timestamp.fromJson(json['createdAt']),
  updatedAt = json['updatedAt'] == null ? null : Timestamp.fromJson(json['updatedAt']),
  createdBy = json['createdBy'] == null ? null : nativeFromJson<String>(json['createdBy']),
  staff = FilterStaffAvailabilityStatsStaffAvailabilityStatssStaff.fromJson(json['staff']);
  @override
  bool operator ==(Object other) {
    if(identical(this, other)) {
      return true;
    }
    if(other.runtimeType != runtimeType) {
      return false;
    }

    final FilterStaffAvailabilityStatsStaffAvailabilityStatss otherTyped = other as FilterStaffAvailabilityStatsStaffAvailabilityStatss;
    return id == otherTyped.id && 
    staffId == otherTyped.staffId && 
    needWorkIndex == otherTyped.needWorkIndex && 
    utilizationPercentage == otherTyped.utilizationPercentage && 
    predictedAvailabilityScore == otherTyped.predictedAvailabilityScore && 
    scheduledHoursThisPeriod == otherTyped.scheduledHoursThisPeriod && 
    desiredHoursThisPeriod == otherTyped.desiredHoursThisPeriod && 
    lastShiftDate == otherTyped.lastShiftDate && 
    acceptanceRate == otherTyped.acceptanceRate && 
    createdAt == otherTyped.createdAt && 
    updatedAt == otherTyped.updatedAt && 
    createdBy == otherTyped.createdBy && 
    staff == otherTyped.staff;
    
  }
  @override
  int get hashCode => Object.hashAll([id.hashCode, staffId.hashCode, needWorkIndex.hashCode, utilizationPercentage.hashCode, predictedAvailabilityScore.hashCode, scheduledHoursThisPeriod.hashCode, desiredHoursThisPeriod.hashCode, lastShiftDate.hashCode, acceptanceRate.hashCode, createdAt.hashCode, updatedAt.hashCode, createdBy.hashCode, staff.hashCode]);
  

  Map<String, dynamic> toJson() {
    Map<String, dynamic> json = {};
    json['id'] = nativeToJson<String>(id);
    json['staffId'] = nativeToJson<String>(staffId);
    if (needWorkIndex != null) {
      json['needWorkIndex'] = nativeToJson<int?>(needWorkIndex);
    }
    if (utilizationPercentage != null) {
      json['utilizationPercentage'] = nativeToJson<int?>(utilizationPercentage);
    }
    if (predictedAvailabilityScore != null) {
      json['predictedAvailabilityScore'] = nativeToJson<int?>(predictedAvailabilityScore);
    }
    if (scheduledHoursThisPeriod != null) {
      json['scheduledHoursThisPeriod'] = nativeToJson<int?>(scheduledHoursThisPeriod);
    }
    if (desiredHoursThisPeriod != null) {
      json['desiredHoursThisPeriod'] = nativeToJson<int?>(desiredHoursThisPeriod);
    }
    if (lastShiftDate != null) {
      json['lastShiftDate'] = lastShiftDate!.toJson();
    }
    if (acceptanceRate != null) {
      json['acceptanceRate'] = nativeToJson<int?>(acceptanceRate);
    }
    if (createdAt != null) {
      json['createdAt'] = createdAt!.toJson();
    }
    if (updatedAt != null) {
      json['updatedAt'] = updatedAt!.toJson();
    }
    if (createdBy != null) {
      json['createdBy'] = nativeToJson<String?>(createdBy);
    }
    json['staff'] = staff.toJson();
    return json;
  }

  FilterStaffAvailabilityStatsStaffAvailabilityStatss({
    required this.id,
    required this.staffId,
    this.needWorkIndex,
    this.utilizationPercentage,
    this.predictedAvailabilityScore,
    this.scheduledHoursThisPeriod,
    this.desiredHoursThisPeriod,
    this.lastShiftDate,
    this.acceptanceRate,
    this.createdAt,
    this.updatedAt,
    this.createdBy,
    required this.staff,
  });
}

@immutable
class FilterStaffAvailabilityStatsStaffAvailabilityStatssStaff {
  final String id;
  final String fullName;
  FilterStaffAvailabilityStatsStaffAvailabilityStatssStaff.fromJson(dynamic json):
  
  id = nativeFromJson<String>(json['id']),
  fullName = nativeFromJson<String>(json['fullName']);
  @override
  bool operator ==(Object other) {
    if(identical(this, other)) {
      return true;
    }
    if(other.runtimeType != runtimeType) {
      return false;
    }

    final FilterStaffAvailabilityStatsStaffAvailabilityStatssStaff otherTyped = other as FilterStaffAvailabilityStatsStaffAvailabilityStatssStaff;
    return id == otherTyped.id && 
    fullName == otherTyped.fullName;
    
  }
  @override
  int get hashCode => Object.hashAll([id.hashCode, fullName.hashCode]);
  

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

  FilterStaffAvailabilityStatsStaffAvailabilityStatssStaff({
    required this.id,
    required this.fullName,
  });
}

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

    final FilterStaffAvailabilityStatsData otherTyped = other as FilterStaffAvailabilityStatsData;
    return staffAvailabilityStatss == otherTyped.staffAvailabilityStatss;
    
  }
  @override
  int get hashCode => staffAvailabilityStatss.hashCode;
  

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

  FilterStaffAvailabilityStatsData({
    required this.staffAvailabilityStatss,
  });
}

@immutable
class FilterStaffAvailabilityStatsVariables {
  late final Optional<int>needWorkIndexMin;
  late final Optional<int>needWorkIndexMax;
  late final Optional<int>utilizationMin;
  late final Optional<int>utilizationMax;
  late final Optional<int>acceptanceRateMin;
  late final Optional<int>acceptanceRateMax;
  late final Optional<Timestamp>lastShiftAfter;
  late final Optional<Timestamp>lastShiftBefore;
  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.')
  FilterStaffAvailabilityStatsVariables.fromJson(Map<String, dynamic> json) {
  
  
    needWorkIndexMin = Optional.optional(nativeFromJson, nativeToJson);
    needWorkIndexMin.value = json['needWorkIndexMin'] == null ? null : nativeFromJson<int>(json['needWorkIndexMin']);
  
  
    needWorkIndexMax = Optional.optional(nativeFromJson, nativeToJson);
    needWorkIndexMax.value = json['needWorkIndexMax'] == null ? null : nativeFromJson<int>(json['needWorkIndexMax']);
  
  
    utilizationMin = Optional.optional(nativeFromJson, nativeToJson);
    utilizationMin.value = json['utilizationMin'] == null ? null : nativeFromJson<int>(json['utilizationMin']);
  
  
    utilizationMax = Optional.optional(nativeFromJson, nativeToJson);
    utilizationMax.value = json['utilizationMax'] == null ? null : nativeFromJson<int>(json['utilizationMax']);
  
  
    acceptanceRateMin = Optional.optional(nativeFromJson, nativeToJson);
    acceptanceRateMin.value = json['acceptanceRateMin'] == null ? null : nativeFromJson<int>(json['acceptanceRateMin']);
  
  
    acceptanceRateMax = Optional.optional(nativeFromJson, nativeToJson);
    acceptanceRateMax.value = json['acceptanceRateMax'] == null ? null : nativeFromJson<int>(json['acceptanceRateMax']);
  
  
    lastShiftAfter = Optional.optional((json) => json['lastShiftAfter'] = Timestamp.fromJson(json['lastShiftAfter']), defaultSerializer);
    lastShiftAfter.value = json['lastShiftAfter'] == null ? null : Timestamp.fromJson(json['lastShiftAfter']);
  
  
    lastShiftBefore = Optional.optional((json) => json['lastShiftBefore'] = Timestamp.fromJson(json['lastShiftBefore']), defaultSerializer);
    lastShiftBefore.value = json['lastShiftBefore'] == null ? null : Timestamp.fromJson(json['lastShiftBefore']);
  
  
    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 FilterStaffAvailabilityStatsVariables otherTyped = other as FilterStaffAvailabilityStatsVariables;
    return needWorkIndexMin == otherTyped.needWorkIndexMin && 
    needWorkIndexMax == otherTyped.needWorkIndexMax && 
    utilizationMin == otherTyped.utilizationMin && 
    utilizationMax == otherTyped.utilizationMax && 
    acceptanceRateMin == otherTyped.acceptanceRateMin && 
    acceptanceRateMax == otherTyped.acceptanceRateMax && 
    lastShiftAfter == otherTyped.lastShiftAfter && 
    lastShiftBefore == otherTyped.lastShiftBefore && 
    offset == otherTyped.offset && 
    limit == otherTyped.limit;
    
  }
  @override
  int get hashCode => Object.hashAll([needWorkIndexMin.hashCode, needWorkIndexMax.hashCode, utilizationMin.hashCode, utilizationMax.hashCode, acceptanceRateMin.hashCode, acceptanceRateMax.hashCode, lastShiftAfter.hashCode, lastShiftBefore.hashCode, offset.hashCode, limit.hashCode]);
  

  Map<String, dynamic> toJson() {
    Map<String, dynamic> json = {};
    if(needWorkIndexMin.state == OptionalState.set) {
      json['needWorkIndexMin'] = needWorkIndexMin.toJson();
    }
    if(needWorkIndexMax.state == OptionalState.set) {
      json['needWorkIndexMax'] = needWorkIndexMax.toJson();
    }
    if(utilizationMin.state == OptionalState.set) {
      json['utilizationMin'] = utilizationMin.toJson();
    }
    if(utilizationMax.state == OptionalState.set) {
      json['utilizationMax'] = utilizationMax.toJson();
    }
    if(acceptanceRateMin.state == OptionalState.set) {
      json['acceptanceRateMin'] = acceptanceRateMin.toJson();
    }
    if(acceptanceRateMax.state == OptionalState.set) {
      json['acceptanceRateMax'] = acceptanceRateMax.toJson();
    }
    if(lastShiftAfter.state == OptionalState.set) {
      json['lastShiftAfter'] = lastShiftAfter.toJson();
    }
    if(lastShiftBefore.state == OptionalState.set) {
      json['lastShiftBefore'] = lastShiftBefore.toJson();
    }
    if(offset.state == OptionalState.set) {
      json['offset'] = offset.toJson();
    }
    if(limit.state == OptionalState.set) {
      json['limit'] = limit.toJson();
    }
    return json;
  }

  FilterStaffAvailabilityStatsVariables({
    required this.needWorkIndexMin,
    required this.needWorkIndexMax,
    required this.utilizationMin,
    required this.utilizationMax,
    required this.acceptanceRateMin,
    required this.acceptanceRateMax,
    required this.lastShiftAfter,
    required this.lastShiftBefore,
    required this.offset,
    required this.limit,
  });
}

