part of 'generated.dart';

class CreateStaffAvailabilityVariablesBuilder {
  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;  CreateStaffAvailabilityVariablesBuilder status(AvailabilityStatus? t) {
   _status.value = t;
   return this;
  }
  CreateStaffAvailabilityVariablesBuilder notes(String? t) {
   _notes.value = t;
   return this;
  }

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

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

@immutable
class CreateStaffAvailabilityStaffAvailabilityInsert {
  final String staffId;
  final EnumValue<DayOfWeek> day;
  final EnumValue<AvailabilitySlot> slot;
  CreateStaffAvailabilityStaffAvailabilityInsert.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 CreateStaffAvailabilityStaffAvailabilityInsert otherTyped = other as CreateStaffAvailabilityStaffAvailabilityInsert;
    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;
  }

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

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

    final CreateStaffAvailabilityData otherTyped = other as CreateStaffAvailabilityData;
    return staffAvailability_insert == otherTyped.staffAvailability_insert;
    
  }
  @override
  int get hashCode => staffAvailability_insert.hashCode;
  

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

  CreateStaffAvailabilityData({
    required this.staffAvailability_insert,
  });
}

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

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

