part of 'generated.dart';

class CreateCategoryVariablesBuilder {
  String categoryId;
  String label;
  Optional<String> _icon = Optional.optional(nativeFromJson, nativeToJson);

  final FirebaseDataConnect _dataConnect;  CreateCategoryVariablesBuilder icon(String? t) {
   _icon.value = t;
   return this;
  }

  CreateCategoryVariablesBuilder(this._dataConnect, {required  this.categoryId,required  this.label,});
  Deserializer<CreateCategoryData> dataDeserializer = (dynamic json)  => CreateCategoryData.fromJson(jsonDecode(json));
  Serializer<CreateCategoryVariables> varsSerializer = (CreateCategoryVariables vars) => jsonEncode(vars.toJson());
  Future<OperationResult<CreateCategoryData, CreateCategoryVariables>> execute() {
    return ref().execute();
  }

  MutationRef<CreateCategoryData, CreateCategoryVariables> ref() {
    CreateCategoryVariables vars= CreateCategoryVariables(categoryId: categoryId,label: label,icon: _icon,);
    return _dataConnect.mutation("createCategory", dataDeserializer, varsSerializer, vars);
  }
}

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

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

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

    final CreateCategoryData otherTyped = other as CreateCategoryData;
    return category_insert == otherTyped.category_insert;
    
  }
  @override
  int get hashCode => category_insert.hashCode;
  

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

  CreateCategoryData({
    required this.category_insert,
  });
}

@immutable
class CreateCategoryVariables {
  final String categoryId;
  final String label;
  late final Optional<String>icon;
  @Deprecated('fromJson is deprecated for Variable classes as they are no longer required for deserialization.')
  CreateCategoryVariables.fromJson(Map<String, dynamic> json):
  
  categoryId = nativeFromJson<String>(json['categoryId']),
  label = 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 CreateCategoryVariables otherTyped = other as CreateCategoryVariables;
    return categoryId == otherTyped.categoryId && 
    label == otherTyped.label && 
    icon == otherTyped.icon;
    
  }
  @override
  int get hashCode => Object.hashAll([categoryId.hashCode, label.hashCode, icon.hashCode]);
  

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

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

