part of 'generated.dart';

class ListCategoriesVariablesBuilder {
  
  final FirebaseDataConnect _dataConnect;
  ListCategoriesVariablesBuilder(this._dataConnect, );
  Deserializer<ListCategoriesData> dataDeserializer = (dynamic json)  => ListCategoriesData.fromJson(jsonDecode(json));
  
  Future<QueryResult<ListCategoriesData, void>> execute() {
    return ref().execute();
  }

  QueryRef<ListCategoriesData, void> ref() {
    
    return _dataConnect.query("listCategories", dataDeserializer, emptySerializer, null);
  }
}

@immutable
class ListCategoriesCategories {
  final String id;
  final String categoryId;
  final String label;
  final String? icon;
  final Timestamp? createdAt;
  final Timestamp? updatedAt;
  final String? createdBy;
  ListCategoriesCategories.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 ListCategoriesCategories otherTyped = other as ListCategoriesCategories;
    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;
  }

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

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

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

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

