part of 'generated.dart';

class FilterCategoriesVariablesBuilder {
  Optional<String> _categoryId = Optional.optional(nativeFromJson, nativeToJson);
  Optional<String> _label = Optional.optional(nativeFromJson, nativeToJson);

  final FirebaseDataConnect _dataConnect;
  FilterCategoriesVariablesBuilder categoryId(String? t) {
   _categoryId.value = t;
   return this;
  }
  FilterCategoriesVariablesBuilder label(String? t) {
   _label.value = t;
   return this;
  }

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

  QueryRef<FilterCategoriesData, FilterCategoriesVariables> ref() {
    FilterCategoriesVariables vars= FilterCategoriesVariables(categoryId: _categoryId,label: _label,);
    return _dataConnect.query("filterCategories", dataDeserializer, varsSerializer, vars);
  }
}

@immutable
class FilterCategoriesCategories {
  final String id;
  final String categoryId;
  final String label;
  final String? icon;
  final Timestamp? createdAt;
  final Timestamp? updatedAt;
  final String? createdBy;
  FilterCategoriesCategories.fromJson(dynamic json):
  
  id = nativeFromJson<String>(json['id']),
  categoryId = nativeFromJson<String>(json['categoryId']),
  label = nativeFromJson<String>(json['label']),
  icon = json['icon'] == null ? null : nativeFromJson<String>(json['icon']),
  createdAt = json['createdAt'] == null ? null : Timestamp.fromJson(json['createdAt']),
  updatedAt = json['updatedAt'] == null ? null : Timestamp.fromJson(json['updatedAt']),
  createdBy = json['createdBy'] == null ? null : nativeFromJson<String>(json['createdBy']);
  @override
  bool operator ==(Object other) {
    if(identical(this, other)) {
      return true;
    }
    if(other.runtimeType != runtimeType) {
      return false;
    }

    final FilterCategoriesCategories otherTyped = other as FilterCategoriesCategories;
    return id == otherTyped.id && 
    categoryId == otherTyped.categoryId && 
    label == otherTyped.label && 
    icon == otherTyped.icon && 
    createdAt == otherTyped.createdAt && 
    updatedAt == otherTyped.updatedAt && 
    createdBy == otherTyped.createdBy;
    
  }
  @override
  int get hashCode => Object.hashAll([id.hashCode, categoryId.hashCode, label.hashCode, icon.hashCode, createdAt.hashCode, updatedAt.hashCode, createdBy.hashCode]);
  

  Map<String, dynamic> toJson() {
    Map<String, dynamic> json = {};
    json['id'] = nativeToJson<String>(id);
    json['categoryId'] = nativeToJson<String>(categoryId);
    json['label'] = nativeToJson<String>(label);
    if (icon != null) {
      json['icon'] = nativeToJson<String?>(icon);
    }
    if (createdAt != null) {
      json['createdAt'] = createdAt!.toJson();
    }
    if (updatedAt != null) {
      json['updatedAt'] = updatedAt!.toJson();
    }
    if (createdBy != null) {
      json['createdBy'] = nativeToJson<String?>(createdBy);
    }
    return json;
  }

  FilterCategoriesCategories({
    required this.id,
    required this.categoryId,
    required this.label,
    this.icon,
    this.createdAt,
    this.updatedAt,
    this.createdBy,
  });
}

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

    final FilterCategoriesData otherTyped = other as FilterCategoriesData;
    return categories == otherTyped.categories;
    
  }
  @override
  int get hashCode => categories.hashCode;
  

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

  FilterCategoriesData({
    required this.categories,
  });
}

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

    final FilterCategoriesVariables otherTyped = other as FilterCategoriesVariables;
    return categoryId == otherTyped.categoryId && 
    label == otherTyped.label;
    
  }
  @override
  int get hashCode => Object.hashAll([categoryId.hashCode, label.hashCode]);
  

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

  FilterCategoriesVariables({
    required this.categoryId,
    required this.label,
  });
}

