part of 'generated.dart';

class UpdateRoleCategoryVariablesBuilder {
  String id;
  Optional<String> _roleName = Optional.optional(nativeFromJson, nativeToJson);
  Optional<RoleCategoryType> _category = Optional.optional((data) => RoleCategoryType.values.byName(data), enumSerializer);

  final FirebaseDataConnect _dataConnect;  UpdateRoleCategoryVariablesBuilder roleName(String? t) {
   _roleName.value = t;
   return this;
  }
  UpdateRoleCategoryVariablesBuilder category(RoleCategoryType? t) {
   _category.value = t;
   return this;
  }

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

  MutationRef<UpdateRoleCategoryData, UpdateRoleCategoryVariables> ref() {
    UpdateRoleCategoryVariables vars= UpdateRoleCategoryVariables(id: id,roleName: _roleName,category: _category,);
    return _dataConnect.mutation("updateRoleCategory", dataDeserializer, varsSerializer, vars);
  }
}

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

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

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

    final UpdateRoleCategoryData otherTyped = other as UpdateRoleCategoryData;
    return roleCategory_update == otherTyped.roleCategory_update;
    
  }
  @override
  int get hashCode => roleCategory_update.hashCode;
  

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

  UpdateRoleCategoryData({
    this.roleCategory_update,
  });
}

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

    final UpdateRoleCategoryVariables otherTyped = other as UpdateRoleCategoryVariables;
    return id == otherTyped.id && 
    roleName == otherTyped.roleName && 
    category == otherTyped.category;
    
  }
  @override
  int get hashCode => Object.hashAll([id.hashCode, roleName.hashCode, category.hashCode]);
  

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

  UpdateRoleCategoryVariables({
    required this.id,
    required this.roleName,
    required this.category,
  });
}

