part of 'generated.dart';

class GetCategoryByIdVariablesBuilder {
  String id;

  final FirebaseDataConnect _dataConnect;
  GetCategoryByIdVariablesBuilder(this._dataConnect, {required  this.id,});
  Deserializer<GetCategoryByIdData> dataDeserializer = (dynamic json)  => GetCategoryByIdData.fromJson(jsonDecode(json));
  Serializer<GetCategoryByIdVariables> varsSerializer = (GetCategoryByIdVariables vars) => jsonEncode(vars.toJson());
  Future<QueryResult<GetCategoryByIdData, GetCategoryByIdVariables>> execute() {
    return ref().execute();
  }

  QueryRef<GetCategoryByIdData, GetCategoryByIdVariables> ref() {
    GetCategoryByIdVariables vars= GetCategoryByIdVariables(id: id,);
    return _dataConnect.query("getCategoryById", dataDeserializer, varsSerializer, vars);
  }
}

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

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

@immutable
class GetCategoryByIdData {
  final GetCategoryByIdCategory? category;
  GetCategoryByIdData.fromJson(dynamic json):
  
  category = json['category'] == null ? null : GetCategoryByIdCategory.fromJson(json['category']);
  @override
  bool operator ==(Object other) {
    if(identical(this, other)) {
      return true;
    }
    if(other.runtimeType != runtimeType) {
      return false;
    }

    final GetCategoryByIdData otherTyped = other as GetCategoryByIdData;
    return category == otherTyped.category;
    
  }
  @override
  int get hashCode => category.hashCode;
  

  Map<String, dynamic> toJson() {
    Map<String, dynamic> json = {};
    if (category != null) {
      json['category'] = category!.toJson();
    }
    return json;
  }

  GetCategoryByIdData({
    this.category,
  });
}

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

    final GetCategoryByIdVariables otherTyped = other as GetCategoryByIdVariables;
    return id == otherTyped.id;
    
  }
  @override
  int get hashCode => id.hashCode;
  

  Map<String, dynamic> toJson() {
    Map<String, dynamic> json = {};
    json['id'] = nativeToJson<String>(id);
    return json;
  }

  GetCategoryByIdVariables({
    required this.id,
  });
}

