part of 'generated.dart';

class FilterStaffVariablesBuilder {
  Optional<String> _ownerId = Optional.optional(nativeFromJson, nativeToJson);
  Optional<String> _fullName = Optional.optional(nativeFromJson, nativeToJson);
  Optional<String> _level = Optional.optional(nativeFromJson, nativeToJson);
  Optional<String> _email = Optional.optional(nativeFromJson, nativeToJson);

  final FirebaseDataConnect _dataConnect;
  FilterStaffVariablesBuilder ownerId(String? t) {
   _ownerId.value = t;
   return this;
  }
  FilterStaffVariablesBuilder fullName(String? t) {
   _fullName.value = t;
   return this;
  }
  FilterStaffVariablesBuilder level(String? t) {
   _level.value = t;
   return this;
  }
  FilterStaffVariablesBuilder email(String? t) {
   _email.value = t;
   return this;
  }

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

  QueryRef<FilterStaffData, FilterStaffVariables> ref() {
    FilterStaffVariables vars= FilterStaffVariables(ownerId: _ownerId,fullName: _fullName,level: _level,email: _email,);
    return _dataConnect.query("filterStaff", dataDeserializer, varsSerializer, vars);
  }
}

@immutable
class FilterStaffStaffs {
  final String id;
  final String userId;
  final String fullName;
  final String? level;
  final String? phone;
  final String? email;
  final String? photoUrl;
  final double? averageRating;
  final int? reliabilityScore;
  final int? totalShifts;
  final String? ownerId;
  final bool? isRecommended;
  final AnyValue? skills;
  final EnumValue<BackgroundCheckStatus>? backgroundCheckStatus;
  final EnumValue<EmploymentType>? employmentType;
  final String? initial;
  final bool? englishRequired;
  final String? city;
  final String? addres;
  FilterStaffStaffs.fromJson(dynamic json):
  
  id = nativeFromJson<String>(json['id']),
  userId = nativeFromJson<String>(json['userId']),
  fullName = nativeFromJson<String>(json['fullName']),
  level = json['level'] == null ? null : nativeFromJson<String>(json['level']),
  phone = json['phone'] == null ? null : nativeFromJson<String>(json['phone']),
  email = json['email'] == null ? null : nativeFromJson<String>(json['email']),
  photoUrl = json['photoUrl'] == null ? null : nativeFromJson<String>(json['photoUrl']),
  averageRating = json['averageRating'] == null ? null : nativeFromJson<double>(json['averageRating']),
  reliabilityScore = json['reliabilityScore'] == null ? null : nativeFromJson<int>(json['reliabilityScore']),
  totalShifts = json['totalShifts'] == null ? null : nativeFromJson<int>(json['totalShifts']),
  ownerId = json['ownerId'] == null ? null : nativeFromJson<String>(json['ownerId']),
  isRecommended = json['isRecommended'] == null ? null : nativeFromJson<bool>(json['isRecommended']),
  skills = json['skills'] == null ? null : AnyValue.fromJson(json['skills']),
  backgroundCheckStatus = json['backgroundCheckStatus'] == null ? null : backgroundCheckStatusDeserializer(json['backgroundCheckStatus']),
  employmentType = json['employmentType'] == null ? null : employmentTypeDeserializer(json['employmentType']),
  initial = json['initial'] == null ? null : nativeFromJson<String>(json['initial']),
  englishRequired = json['englishRequired'] == null ? null : nativeFromJson<bool>(json['englishRequired']),
  city = json['city'] == null ? null : nativeFromJson<String>(json['city']),
  addres = json['addres'] == null ? null : nativeFromJson<String>(json['addres']);
  @override
  bool operator ==(Object other) {
    if(identical(this, other)) {
      return true;
    }
    if(other.runtimeType != runtimeType) {
      return false;
    }

    final FilterStaffStaffs otherTyped = other as FilterStaffStaffs;
    return id == otherTyped.id && 
    userId == otherTyped.userId && 
    fullName == otherTyped.fullName && 
    level == otherTyped.level && 
    phone == otherTyped.phone && 
    email == otherTyped.email && 
    photoUrl == otherTyped.photoUrl && 
    averageRating == otherTyped.averageRating && 
    reliabilityScore == otherTyped.reliabilityScore && 
    totalShifts == otherTyped.totalShifts && 
    ownerId == otherTyped.ownerId && 
    isRecommended == otherTyped.isRecommended && 
    skills == otherTyped.skills && 
    backgroundCheckStatus == otherTyped.backgroundCheckStatus && 
    employmentType == otherTyped.employmentType && 
    initial == otherTyped.initial && 
    englishRequired == otherTyped.englishRequired && 
    city == otherTyped.city && 
    addres == otherTyped.addres;
    
  }
  @override
  int get hashCode => Object.hashAll([id.hashCode, userId.hashCode, fullName.hashCode, level.hashCode, phone.hashCode, email.hashCode, photoUrl.hashCode, averageRating.hashCode, reliabilityScore.hashCode, totalShifts.hashCode, ownerId.hashCode, isRecommended.hashCode, skills.hashCode, backgroundCheckStatus.hashCode, employmentType.hashCode, initial.hashCode, englishRequired.hashCode, city.hashCode, addres.hashCode]);
  

  Map<String, dynamic> toJson() {
    Map<String, dynamic> json = {};
    json['id'] = nativeToJson<String>(id);
    json['userId'] = nativeToJson<String>(userId);
    json['fullName'] = nativeToJson<String>(fullName);
    if (level != null) {
      json['level'] = nativeToJson<String?>(level);
    }
    if (phone != null) {
      json['phone'] = nativeToJson<String?>(phone);
    }
    if (email != null) {
      json['email'] = nativeToJson<String?>(email);
    }
    if (photoUrl != null) {
      json['photoUrl'] = nativeToJson<String?>(photoUrl);
    }
    if (averageRating != null) {
      json['averageRating'] = nativeToJson<double?>(averageRating);
    }
    if (reliabilityScore != null) {
      json['reliabilityScore'] = nativeToJson<int?>(reliabilityScore);
    }
    if (totalShifts != null) {
      json['totalShifts'] = nativeToJson<int?>(totalShifts);
    }
    if (ownerId != null) {
      json['ownerId'] = nativeToJson<String?>(ownerId);
    }
    if (isRecommended != null) {
      json['isRecommended'] = nativeToJson<bool?>(isRecommended);
    }
    if (skills != null) {
      json['skills'] = skills!.toJson();
    }
    if (backgroundCheckStatus != null) {
      json['backgroundCheckStatus'] = 
    backgroundCheckStatusSerializer(backgroundCheckStatus!)
    ;
    }
    if (employmentType != null) {
      json['employmentType'] = 
    employmentTypeSerializer(employmentType!)
    ;
    }
    if (initial != null) {
      json['initial'] = nativeToJson<String?>(initial);
    }
    if (englishRequired != null) {
      json['englishRequired'] = nativeToJson<bool?>(englishRequired);
    }
    if (city != null) {
      json['city'] = nativeToJson<String?>(city);
    }
    if (addres != null) {
      json['addres'] = nativeToJson<String?>(addres);
    }
    return json;
  }

  FilterStaffStaffs({
    required this.id,
    required this.userId,
    required this.fullName,
    this.level,
    this.phone,
    this.email,
    this.photoUrl,
    this.averageRating,
    this.reliabilityScore,
    this.totalShifts,
    this.ownerId,
    this.isRecommended,
    this.skills,
    this.backgroundCheckStatus,
    this.employmentType,
    this.initial,
    this.englishRequired,
    this.city,
    this.addres,
  });
}

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

    final FilterStaffData otherTyped = other as FilterStaffData;
    return staffs == otherTyped.staffs;
    
  }
  @override
  int get hashCode => staffs.hashCode;
  

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

  FilterStaffData({
    required this.staffs,
  });
}

@immutable
class FilterStaffVariables {
  late final Optional<String>ownerId;
  late final Optional<String>fullName;
  late final Optional<String>level;
  late final Optional<String>email;
  @Deprecated('fromJson is deprecated for Variable classes as they are no longer required for deserialization.')
  FilterStaffVariables.fromJson(Map<String, dynamic> json) {
  
  
    ownerId = Optional.optional(nativeFromJson, nativeToJson);
    ownerId.value = json['ownerId'] == null ? null : nativeFromJson<String>(json['ownerId']);
  
  
    fullName = Optional.optional(nativeFromJson, nativeToJson);
    fullName.value = json['fullName'] == null ? null : nativeFromJson<String>(json['fullName']);
  
  
    level = Optional.optional(nativeFromJson, nativeToJson);
    level.value = json['level'] == null ? null : nativeFromJson<String>(json['level']);
  
  
    email = Optional.optional(nativeFromJson, nativeToJson);
    email.value = json['email'] == null ? null : nativeFromJson<String>(json['email']);
  
  }
  @override
  bool operator ==(Object other) {
    if(identical(this, other)) {
      return true;
    }
    if(other.runtimeType != runtimeType) {
      return false;
    }

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

  Map<String, dynamic> toJson() {
    Map<String, dynamic> json = {};
    if(ownerId.state == OptionalState.set) {
      json['ownerId'] = ownerId.toJson();
    }
    if(fullName.state == OptionalState.set) {
      json['fullName'] = fullName.toJson();
    }
    if(level.state == OptionalState.set) {
      json['level'] = level.toJson();
    }
    if(email.state == OptionalState.set) {
      json['email'] = email.toJson();
    }
    return json;
  }

  FilterStaffVariables({
    required this.ownerId,
    required this.fullName,
    required this.level,
    required this.email,
  });
}

