part of 'generated.dart';

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

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

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

  QueryRef<ListBenefitsDataData, ListBenefitsDataVariables> ref() {
    ListBenefitsDataVariables vars= ListBenefitsDataVariables(offset: _offset,limit: _limit,);
    return _dataConnect.query("listBenefitsData", dataDeserializer, varsSerializer, vars);
  }
}

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

    final ListBenefitsDataBenefitsDatas otherTyped = other as ListBenefitsDataBenefitsDatas;
    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;
  }

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

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

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

@immutable
class ListBenefitsDataBenefitsDatasVendorBenefitPlan {
  final String id;
  final String vendorId;
  final String title;
  final String? description;
  final String? requestLabel;
  final int? total;
  final bool? isActive;
  ListBenefitsDataBenefitsDatasVendorBenefitPlan.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 ListBenefitsDataBenefitsDatasVendorBenefitPlan otherTyped = other as ListBenefitsDataBenefitsDatasVendorBenefitPlan;
    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;
  }

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

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

    final ListBenefitsDataData otherTyped = other as ListBenefitsDataData;
    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;
  }

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

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

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

  ListBenefitsDataVariables({
    required this.offset,
    required this.limit,
  });
}

