part of 'generated.dart';

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

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

  UpdateCategoryVariablesBuilder(this._dataConnect, {required  this.id,});
  Deserializer<UpdateCategoryData> dataDeserializer = (dynamic json)  => UpdateCategoryData.fromJson(jsonDecode(json));
  Serializer<UpdateCategoryVariables> varsSerializer = (UpdateCategoryVariables vars) => jsonEncode(vars.toJson());
  Future<OperationResult<UpdateCategoryData, UpdateCategoryVariables>> execute() {
    return ref().execute();
  }

  MutationRef<UpdateCategoryData, UpdateCategoryVariables> ref() {
    UpdateCategoryVariables vars= UpdateCategoryVariables(id: id,categoryId: _categoryId,label: _label,icon: _icon,);
    return _dataConnect.mutation("updateCategory", dataDeserializer, varsSerializer, vars);
  }
}

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

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

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

    final UpdateCategoryData otherTyped = other as UpdateCategoryData;
    return category_update == otherTyped.category_update;
    
  }
  @override
  int get hashCode => category_update.hashCode;
  

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

  UpdateCategoryData({
    this.category_update,
  });
}

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

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

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

  UpdateCategoryVariables({
    required this.id,
    required this.categoryId,
    required this.label,
    required this.icon,
  });
}

