part of 'generated.dart';

class ListBenefitsDataByStaffIdVariablesBuilder {
  String staffId;
  Optional<int> _offset = Optional.optional(nativeFromJson, nativeToJson);
  Optional<int> _limit = Optional.optional(nativeFromJson, nativeToJson);

  final FirebaseDataConnect _dataConnect;  ListBenefitsDataByStaffIdVariablesBuilder offset(int? t) {
   _offset.value = t;
   return this;
  }
  ListBenefitsDataByStaffIdVariablesBuilder limit(int? t) {
   _limit.value = t;
   return this;
  }

  ListBenefitsDataByStaffIdVariablesBuilder(this._dataConnect, {required  this.staffId,});
  Deserializer<ListBenefitsDataByStaffIdData> dataDeserializer = (dynamic json)  => ListBenefitsDataByStaffIdData.fromJson(jsonDecode(json));
  Serializer<ListBenefitsDataByStaffIdVariables> varsSerializer = (ListBenefitsDataByStaffIdVariables vars) => jsonEncode(vars.toJson());
  Future<QueryResult<ListBenefitsDataByStaffIdData, ListBenefitsDataByStaffIdVariables>> execute() {
    return ref().execute();
  }

  QueryRef<ListBenefitsDataByStaffIdData, ListBenefitsDataByStaffIdVariables> ref() {
    ListBenefitsDataByStaffIdVariables vars= ListBenefitsDataByStaffIdVariables(staffId: staffId,offset: _offset,limit: _limit,);
    return _dataConnect.query("listBenefitsDataByStaffId", dataDeserializer, varsSerializer, vars);
  }
}

@immutable
class ListBenefitsDataByStaffIdBenefitsDatas {
  final String id;
  final String vendorBenefitPlanId;
  final int current;
  final String staffId;
  final ListBenefitsDataByStaffIdBenefitsDatasStaff staff;
  final ListBenefitsDataByStaffIdBenefitsDatasVendorBenefitPlan vendorBenefitPlan;
  ListBenefitsDataByStaffIdBenefitsDatas.fromJson(dynamic json):
  
  id = nativeFromJson<String>(json['id']),
  vendorBenefitPlanId = nativeFromJson<String>(json['vendorBenefitPlanId']),
  current = nativeFromJson<int>(json['current']),
  staffId = nativeFromJson<String>(json['staffId']),
  staff = ListBenefitsDataByStaffIdBenefitsDatasStaff.fromJson(json['staff']),
  vendorBenefitPlan = ListBenefitsDataByStaffIdBenefitsDatasVendorBenefitPlan.fromJson(json['vendorBenefitPlan']);
  @override
  bool operator ==(Object other) {
    if(identical(this, other)) {
      return true;
    }
    if(other.runtimeType != runtimeType) {
      return false;
    }

    final ListBenefitsDataByStaffIdBenefitsDatas otherTyped = other as ListBenefitsDataByStaffIdBenefitsDatas;
    return id == otherTyped.id && 
    vendorBenefitPlanId == otherTyped.vendorBenefitPlanId && 
    current == otherTyped.current && 
    staffId == otherTyped.staffId && 
    staff == otherTyped.staff && 
    vendorBenefitPlan == otherTyped.vendorBenefitPlan;
    
  }
  @override
  int get hashCode => Object.hashAll([id.hashCode, vendorBenefitPlanId.hashCode, current.hashCode, staffId.hashCode, staff.hashCode, vendorBenefitPlan.hashCode]);
  

  Map<String, dynamic> toJson() {
    Map<String, dynamic> json = {};
    json['id'] = nativeToJson<String>(id);
    json['vendorBenefitPlanId'] = nativeToJson<String>(vendorBenefitPlanId);
    json['current'] = nativeToJson<int>(current);
    json['staffId'] = nativeToJson<String>(staffId);
    json['staff'] = staff.toJson();
    json['vendorBenefitPlan'] = vendorBenefitPlan.toJson();
    return json;
  }

  ListBenefitsDataByStaffIdBenefitsDatas({
    required this.id,
    required this.vendorBenefitPlanId,
    required this.current,
    required this.staffId,
    required this.staff,
    required this.vendorBenefitPlan,
  });
}

@immutable
class ListBenefitsDataByStaffIdBenefitsDatasStaff {
  final String id;
  final String fullName;
  ListBenefitsDataByStaffIdBenefitsDatasStaff.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 ListBenefitsDataByStaffIdBenefitsDatasStaff otherTyped = other as ListBenefitsDataByStaffIdBenefitsDatasStaff;
    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;
  }

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

@immutable
class ListBenefitsDataByStaffIdBenefitsDatasVendorBenefitPlan {
  final String id;
  final String vendorId;
  final String title;
  final String? description;
  final String? requestLabel;
  final int? total;
  final bool? isActive;
  ListBenefitsDataByStaffIdBenefitsDatasVendorBenefitPlan.fromJson(dynamic json):
  
  id = nativeFromJson<String>(json['id']),
  vendorId = nativeFromJson<String>(json['vendorId']),
  title = nativeFromJson<String>(json['title']),
  description = json['description'] == null ? null : nativeFromJson<String>(json['description']),
  requestLabel = json['requestLabel'] == null ? null : nativeFromJson<String>(json['requestLabel']),
  total = json['total'] == null ? null : nativeFromJson<int>(json['total']),
  isActive = json['isActive'] == null ? null : nativeFromJson<bool>(json['isActive']);
  @override
  bool operator ==(Object other) {
    if(identical(this, other)) {
      return true;
    }
    if(other.runtimeType != runtimeType) {
      return false;
    }

    final ListBenefitsDataByStaffIdBenefitsDatasVendorBenefitPlan otherTyped = other as ListBenefitsDataByStaffIdBenefitsDatasVendorBenefitPlan;
    return id == otherTyped.id && 
    vendorId == otherTyped.vendorId && 
    title == otherTyped.title && 
    description == otherTyped.description && 
    requestLabel == otherTyped.requestLabel && 
    total == otherTyped.total && 
    isActive == otherTyped.isActive;
    
  }
  @override
  int get hashCode => Object.hashAll([id.hashCode, vendorId.hashCode, title.hashCode, description.hashCode, requestLabel.hashCode, total.hashCode, isActive.hashCode]);
  

  Map<String, dynamic> toJson() {
    Map<String, dynamic> json = {};
    json['id'] = nativeToJson<String>(id);
    json['vendorId'] = nativeToJson<String>(vendorId);
    json['title'] = nativeToJson<String>(title);
    if (description != null) {
      json['description'] = nativeToJson<String?>(description);
    }
    if (requestLabel != null) {
      json['requestLabel'] = nativeToJson<String?>(requestLabel);
    }
    if (total != null) {
      json['total'] = nativeToJson<int?>(total);
    }
    if (isActive != null) {
      json['isActive'] = nativeToJson<bool?>(isActive);
    }
    return json;
  }

  ListBenefitsDataByStaffIdBenefitsDatasVendorBenefitPlan({
    required this.id,
    required this.vendorId,
    required this.title,
    this.description,
    this.requestLabel,
    this.total,
    this.isActive,
  });
}

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

    final ListBenefitsDataByStaffIdData otherTyped = other as ListBenefitsDataByStaffIdData;
    return benefitsDatas == otherTyped.benefitsDatas;
    
  }
  @override
  int get hashCode => benefitsDatas.hashCode;
  

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

  ListBenefitsDataByStaffIdData({
    required this.benefitsDatas,
  });
}

@immutable
class ListBenefitsDataByStaffIdVariables {
  final String staffId;
  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.')
  ListBenefitsDataByStaffIdVariables.fromJson(Map<String, dynamic> json):
  
  staffId = nativeFromJson<String>(json['staffId']) {
  
  
  
    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 ListBenefitsDataByStaffIdVariables otherTyped = other as ListBenefitsDataByStaffIdVariables;
    return staffId == otherTyped.staffId && 
    offset == otherTyped.offset && 
    limit == otherTyped.limit;
    
  }
  @override
  int get hashCode => Object.hashAll([staffId.hashCode, offset.hashCode, limit.hashCode]);
  

  Map<String, dynamic> toJson() {
    Map<String, dynamic> json = {};
    json['staffId'] = nativeToJson<String>(staffId);
    if(offset.state == OptionalState.set) {
      json['offset'] = offset.toJson();
    }
    if(limit.state == OptionalState.set) {
      json['limit'] = limit.toJson();
    }
    return json;
  }

  ListBenefitsDataByStaffIdVariables({
    required this.staffId,
    required this.offset,
    required this.limit,
  });
}

