part of 'generated.dart';

class FilterTaxFormsVariablesBuilder {
  Optional<TaxFormType> _formType = Optional.optional((data) => TaxFormType.values.byName(data), enumSerializer);
  Optional<TaxFormStatus> _status = Optional.optional((data) => TaxFormStatus.values.byName(data), enumSerializer);
  Optional<String> _staffId = Optional.optional(nativeFromJson, nativeToJson);

  final FirebaseDataConnect _dataConnect;
  FilterTaxFormsVariablesBuilder formType(TaxFormType? t) {
   _formType.value = t;
   return this;
  }
  FilterTaxFormsVariablesBuilder status(TaxFormStatus? t) {
   _status.value = t;
   return this;
  }
  FilterTaxFormsVariablesBuilder staffId(String? t) {
   _staffId.value = t;
   return this;
  }

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

  QueryRef<FilterTaxFormsData, FilterTaxFormsVariables> ref() {
    FilterTaxFormsVariables vars= FilterTaxFormsVariables(formType: _formType,status: _status,staffId: _staffId,);
    return _dataConnect.query("filterTaxForms", dataDeserializer, varsSerializer, vars);
  }
}

@immutable
class FilterTaxFormsTaxForms {
  final String id;
  final EnumValue<TaxFormType> formType;
  final String title;
  final EnumValue<TaxFormStatus> status;
  final String staffId;
  FilterTaxFormsTaxForms.fromJson(dynamic json):
  
  id = nativeFromJson<String>(json['id']),
  formType = taxFormTypeDeserializer(json['formType']),
  title = nativeFromJson<String>(json['title']),
  status = taxFormStatusDeserializer(json['status']),
  staffId = nativeFromJson<String>(json['staffId']);
  @override
  bool operator ==(Object other) {
    if(identical(this, other)) {
      return true;
    }
    if(other.runtimeType != runtimeType) {
      return false;
    }

    final FilterTaxFormsTaxForms otherTyped = other as FilterTaxFormsTaxForms;
    return id == otherTyped.id && 
    formType == otherTyped.formType && 
    title == otherTyped.title && 
    status == otherTyped.status && 
    staffId == otherTyped.staffId;
    
  }
  @override
  int get hashCode => Object.hashAll([id.hashCode, formType.hashCode, title.hashCode, status.hashCode, staffId.hashCode]);
  

  Map<String, dynamic> toJson() {
    Map<String, dynamic> json = {};
    json['id'] = nativeToJson<String>(id);
    json['formType'] = 
    taxFormTypeSerializer(formType)
    ;
    json['title'] = nativeToJson<String>(title);
    json['status'] = 
    taxFormStatusSerializer(status)
    ;
    json['staffId'] = nativeToJson<String>(staffId);
    return json;
  }

  FilterTaxFormsTaxForms({
    required this.id,
    required this.formType,
    required this.title,
    required this.status,
    required this.staffId,
  });
}

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

    final FilterTaxFormsData otherTyped = other as FilterTaxFormsData;
    return taxForms == otherTyped.taxForms;
    
  }
  @override
  int get hashCode => taxForms.hashCode;
  

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

  FilterTaxFormsData({
    required this.taxForms,
  });
}

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

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

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

  FilterTaxFormsVariables({
    required this.formType,
    required this.status,
    required this.staffId,
  });
}

