part of 'generated.dart';

class UpdateStaffAvailabilityStatsVariablesBuilder {
  String staffId;
  Optional<int> _needWorkIndex = Optional.optional(nativeFromJson, nativeToJson);
  Optional<int> _utilizationPercentage = Optional.optional(nativeFromJson, nativeToJson);
  Optional<int> _predictedAvailabilityScore = Optional.optional(nativeFromJson, nativeToJson);
  Optional<int> _scheduledHoursThisPeriod = Optional.optional(nativeFromJson, nativeToJson);
  Optional<int> _desiredHoursThisPeriod = Optional.optional(nativeFromJson, nativeToJson);
  Optional<Timestamp> _lastShiftDate = Optional.optional((json) => json['lastShiftDate'] = Timestamp.fromJson(json['lastShiftDate']), defaultSerializer);
  Optional<int> _acceptanceRate = Optional.optional(nativeFromJson, nativeToJson);

  final FirebaseDataConnect _dataConnect;  UpdateStaffAvailabilityStatsVariablesBuilder needWorkIndex(int? t) {
   _needWorkIndex.value = t;
   return this;
  }
  UpdateStaffAvailabilityStatsVariablesBuilder utilizationPercentage(int? t) {
   _utilizationPercentage.value = t;
   return this;
  }
  UpdateStaffAvailabilityStatsVariablesBuilder predictedAvailabilityScore(int? t) {
   _predictedAvailabilityScore.value = t;
   return this;
  }
  UpdateStaffAvailabilityStatsVariablesBuilder scheduledHoursThisPeriod(int? t) {
   _scheduledHoursThisPeriod.value = t;
   return this;
  }
  UpdateStaffAvailabilityStatsVariablesBuilder desiredHoursThisPeriod(int? t) {
   _desiredHoursThisPeriod.value = t;
   return this;
  }
  UpdateStaffAvailabilityStatsVariablesBuilder lastShiftDate(Timestamp? t) {
   _lastShiftDate.value = t;
   return this;
  }
  UpdateStaffAvailabilityStatsVariablesBuilder acceptanceRate(int? t) {
   _acceptanceRate.value = t;
   return this;
  }

  UpdateStaffAvailabilityStatsVariablesBuilder(this._dataConnect, {required  this.staffId,});
  Deserializer<UpdateStaffAvailabilityStatsData> dataDeserializer = (dynamic json)  => UpdateStaffAvailabilityStatsData.fromJson(jsonDecode(json));
  Serializer<UpdateStaffAvailabilityStatsVariables> varsSerializer = (UpdateStaffAvailabilityStatsVariables vars) => jsonEncode(vars.toJson());
  Future<OperationResult<UpdateStaffAvailabilityStatsData, UpdateStaffAvailabilityStatsVariables>> execute() {
    return ref().execute();
  }

  MutationRef<UpdateStaffAvailabilityStatsData, UpdateStaffAvailabilityStatsVariables> ref() {
    UpdateStaffAvailabilityStatsVariables vars= UpdateStaffAvailabilityStatsVariables(staffId: staffId,needWorkIndex: _needWorkIndex,utilizationPercentage: _utilizationPercentage,predictedAvailabilityScore: _predictedAvailabilityScore,scheduledHoursThisPeriod: _scheduledHoursThisPeriod,desiredHoursThisPeriod: _desiredHoursThisPeriod,lastShiftDate: _lastShiftDate,acceptanceRate: _acceptanceRate,);
    return _dataConnect.mutation("updateStaffAvailabilityStats", dataDeserializer, varsSerializer, vars);
  }
}

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

    final UpdateStaffAvailabilityStatsStaffAvailabilityStatsUpdate otherTyped = other as UpdateStaffAvailabilityStatsStaffAvailabilityStatsUpdate;
    return staffId == otherTyped.staffId;
    
  }
  @override
  int get hashCode => staffId.hashCode;
  

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

  UpdateStaffAvailabilityStatsStaffAvailabilityStatsUpdate({
    required this.staffId,
  });
}

@immutable
class UpdateStaffAvailabilityStatsData {
  final UpdateStaffAvailabilityStatsStaffAvailabilityStatsUpdate? staffAvailabilityStats_update;
  UpdateStaffAvailabilityStatsData.fromJson(dynamic json):
  
  staffAvailabilityStats_update = json['staffAvailabilityStats_update'] == null ? null : UpdateStaffAvailabilityStatsStaffAvailabilityStatsUpdate.fromJson(json['staffAvailabilityStats_update']);
  @override
  bool operator ==(Object other) {
    if(identical(this, other)) {
      return true;
    }
    if(other.runtimeType != runtimeType) {
      return false;
    }

    final UpdateStaffAvailabilityStatsData otherTyped = other as UpdateStaffAvailabilityStatsData;
    return staffAvailabilityStats_update == otherTyped.staffAvailabilityStats_update;
    
  }
  @override
  int get hashCode => staffAvailabilityStats_update.hashCode;
  

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

  UpdateStaffAvailabilityStatsData({
    this.staffAvailabilityStats_update,
  });
}

@immutable
class UpdateStaffAvailabilityStatsVariables {
  final String staffId;
  late final Optional<int>needWorkIndex;
  late final Optional<int>utilizationPercentage;
  late final Optional<int>predictedAvailabilityScore;
  late final Optional<int>scheduledHoursThisPeriod;
  late final Optional<int>desiredHoursThisPeriod;
  late final Optional<Timestamp>lastShiftDate;
  late final Optional<int>acceptanceRate;
  @Deprecated('fromJson is deprecated for Variable classes as they are no longer required for deserialization.')
  UpdateStaffAvailabilityStatsVariables.fromJson(Map<String, dynamic> json):
  
  staffId = nativeFromJson<String>(json['staffId']) {
  
  
  
    needWorkIndex = Optional.optional(nativeFromJson, nativeToJson);
    needWorkIndex.value = json['needWorkIndex'] == null ? null : nativeFromJson<int>(json['needWorkIndex']);
  
  
    utilizationPercentage = Optional.optional(nativeFromJson, nativeToJson);
    utilizationPercentage.value = json['utilizationPercentage'] == null ? null : nativeFromJson<int>(json['utilizationPercentage']);
  
  
    predictedAvailabilityScore = Optional.optional(nativeFromJson, nativeToJson);
    predictedAvailabilityScore.value = json['predictedAvailabilityScore'] == null ? null : nativeFromJson<int>(json['predictedAvailabilityScore']);
  
  
    scheduledHoursThisPeriod = Optional.optional(nativeFromJson, nativeToJson);
    scheduledHoursThisPeriod.value = json['scheduledHoursThisPeriod'] == null ? null : nativeFromJson<int>(json['scheduledHoursThisPeriod']);
  
  
    desiredHoursThisPeriod = Optional.optional(nativeFromJson, nativeToJson);
    desiredHoursThisPeriod.value = json['desiredHoursThisPeriod'] == null ? null : nativeFromJson<int>(json['desiredHoursThisPeriod']);
  
  
    lastShiftDate = Optional.optional((json) => json['lastShiftDate'] = Timestamp.fromJson(json['lastShiftDate']), defaultSerializer);
    lastShiftDate.value = json['lastShiftDate'] == null ? null : Timestamp.fromJson(json['lastShiftDate']);
  
  
    acceptanceRate = Optional.optional(nativeFromJson, nativeToJson);
    acceptanceRate.value = json['acceptanceRate'] == null ? null : nativeFromJson<int>(json['acceptanceRate']);
  
  }
  @override
  bool operator ==(Object other) {
    if(identical(this, other)) {
      return true;
    }
    if(other.runtimeType != runtimeType) {
      return false;
    }

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

  Map<String, dynamic> toJson() {
    Map<String, dynamic> json = {};
    json['staffId'] = nativeToJson<String>(staffId);
    if(needWorkIndex.state == OptionalState.set) {
      json['needWorkIndex'] = needWorkIndex.toJson();
    }
    if(utilizationPercentage.state == OptionalState.set) {
      json['utilizationPercentage'] = utilizationPercentage.toJson();
    }
    if(predictedAvailabilityScore.state == OptionalState.set) {
      json['predictedAvailabilityScore'] = predictedAvailabilityScore.toJson();
    }
    if(scheduledHoursThisPeriod.state == OptionalState.set) {
      json['scheduledHoursThisPeriod'] = scheduledHoursThisPeriod.toJson();
    }
    if(desiredHoursThisPeriod.state == OptionalState.set) {
      json['desiredHoursThisPeriod'] = desiredHoursThisPeriod.toJson();
    }
    if(lastShiftDate.state == OptionalState.set) {
      json['lastShiftDate'] = lastShiftDate.toJson();
    }
    if(acceptanceRate.state == OptionalState.set) {
      json['acceptanceRate'] = acceptanceRate.toJson();
    }
    return json;
  }

  UpdateStaffAvailabilityStatsVariables({
    required this.staffId,
    required this.needWorkIndex,
    required this.utilizationPercentage,
    required this.predictedAvailabilityScore,
    required this.scheduledHoursThisPeriod,
    required this.desiredHoursThisPeriod,
    required this.lastShiftDate,
    required this.acceptanceRate,
  });
}

