part of 'generated.dart';

class UpdateStaffAvailabilityVariablesBuilder {
  String staffId;
  DayOfWeek day;
  AvailabilitySlot slot;
  Optional<AvailabilityStatus> _status = Optional.optional((data) => AvailabilityStatus.values.byName(data), enumSerializer);
  Optional<String> _notes = Optional.optional(nativeFromJson, nativeToJson);

  final FirebaseDataConnect _dataConnect;  UpdateStaffAvailabilityVariablesBuilder status(AvailabilityStatus? t) {
   _status.value = t;
   return this;
  }
  UpdateStaffAvailabilityVariablesBuilder notes(String? t) {
   _notes.value = t;
   return this;
  }

  UpdateStaffAvailabilityVariablesBuilder(this._dataConnect, {required  this.staffId,required  this.day,required  this.slot,});
  Deserializer<UpdateStaffAvailabilityData> dataDeserializer = (dynamic json)  => UpdateStaffAvailabilityData.fromJson(jsonDecode(json));
  Serializer<UpdateStaffAvailabilityVariables> varsSerializer = (UpdateStaffAvailabilityVariables vars) => jsonEncode(vars.toJson());
  Future<OperationResult<UpdateStaffAvailabilityData, UpdateStaffAvailabilityVariables>> execute() {
    return ref().execute();
  }

  MutationRef<UpdateStaffAvailabilityData, UpdateStaffAvailabilityVariables> ref() {
    UpdateStaffAvailabilityVariables vars= UpdateStaffAvailabilityVariables(staffId: staffId,day: day,slot: slot,status: _status,notes: _notes,);
    return _dataConnect.mutation("updateStaffAvailability", dataDeserializer, varsSerializer, vars);
  }
}

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

    final UpdateStaffAvailabilityStaffAvailabilityUpdate otherTyped = other as UpdateStaffAvailabilityStaffAvailabilityUpdate;
    return staffId == otherTyped.staffId && 
    day == otherTyped.day && 
    slot == otherTyped.slot;
    
  }
  @override
  int get hashCode => Object.hashAll([staffId.hashCode, day.hashCode, slot.hashCode]);
  

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

  UpdateStaffAvailabilityStaffAvailabilityUpdate({
    required this.staffId,
    required this.day,
    required this.slot,
  });
}

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

    final UpdateStaffAvailabilityData otherTyped = other as UpdateStaffAvailabilityData;
    return staffAvailability_update == otherTyped.staffAvailability_update;
    
  }
  @override
  int get hashCode => staffAvailability_update.hashCode;
  

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

  UpdateStaffAvailabilityData({
    this.staffAvailability_update,
  });
}

@immutable
class UpdateStaffAvailabilityVariables {
  final String staffId;
  final DayOfWeek day;
  final AvailabilitySlot slot;
  late final Optional<AvailabilityStatus>status;
  late final Optional<String>notes;
  @Deprecated('fromJson is deprecated for Variable classes as they are no longer required for deserialization.')
  UpdateStaffAvailabilityVariables.fromJson(Map<String, dynamic> json):
  
  staffId = nativeFromJson<String>(json['staffId']),
  day = DayOfWeek.values.byName(json['day']),
  slot = AvailabilitySlot.values.byName(json['slot']) {
  
  
  
  
  
    status = Optional.optional((data) => AvailabilityStatus.values.byName(data), enumSerializer);
    status.value = json['status'] == null ? null : AvailabilityStatus.values.byName(json['status']);
  
  
    notes = Optional.optional(nativeFromJson, nativeToJson);
    notes.value = json['notes'] == null ? null : nativeFromJson<String>(json['notes']);
  
  }
  @override
  bool operator ==(Object other) {
    if(identical(this, other)) {
      return true;
    }
    if(other.runtimeType != runtimeType) {
      return false;
    }

    final UpdateStaffAvailabilityVariables otherTyped = other as UpdateStaffAvailabilityVariables;
    return staffId == otherTyped.staffId && 
    day == otherTyped.day && 
    slot == otherTyped.slot && 
    status == otherTyped.status && 
    notes == otherTyped.notes;
    
  }
  @override
  int get hashCode => Object.hashAll([staffId.hashCode, day.hashCode, slot.hashCode, status.hashCode, notes.hashCode]);
  

  Map<String, dynamic> toJson() {
    Map<String, dynamic> json = {};
    json['staffId'] = nativeToJson<String>(staffId);
    json['day'] = 
    day.name
    ;
    json['slot'] = 
    slot.name
    ;
    if(status.state == OptionalState.set) {
      json['status'] = status.toJson();
    }
    if(notes.state == OptionalState.set) {
      json['notes'] = notes.toJson();
    }
    return json;
  }

  UpdateStaffAvailabilityVariables({
    required this.staffId,
    required this.day,
    required this.slot,
    required this.status,
    required this.notes,
  });
}

