part of 'generated.dart';

class CreateRoleCategoryVariablesBuilder {
  String roleName;
  RoleCategoryType category;

  final FirebaseDataConnect _dataConnect;
  CreateRoleCategoryVariablesBuilder(this._dataConnect, {required  this.roleName,required  this.category,});
  Deserializer<CreateRoleCategoryData> dataDeserializer = (dynamic json)  => CreateRoleCategoryData.fromJson(jsonDecode(json));
  Serializer<CreateRoleCategoryVariables> varsSerializer = (CreateRoleCategoryVariables vars) => jsonEncode(vars.toJson());
  Future<OperationResult<CreateRoleCategoryData, CreateRoleCategoryVariables>> execute() {
    return ref().execute();
  }

  MutationRef<CreateRoleCategoryData, CreateRoleCategoryVariables> ref() {
    CreateRoleCategoryVariables vars= CreateRoleCategoryVariables(roleName: roleName,category: category,);
    return _dataConnect.mutation("createRoleCategory", dataDeserializer, varsSerializer, vars);
  }
}

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

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

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

    final CreateRoleCategoryData otherTyped = other as CreateRoleCategoryData;
    return roleCategory_insert == otherTyped.roleCategory_insert;
    
  }
  @override
  int get hashCode => roleCategory_insert.hashCode;
  

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

  CreateRoleCategoryData({
    required this.roleCategory_insert,
  });
}

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

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

  Map<String, dynamic> toJson() {
    Map<String, dynamic> json = {};
    json['roleName'] = nativeToJson<String>(roleName);
    json['category'] = 
    category.name
    ;
    return json;
  }

  CreateRoleCategoryVariables({
    required this.roleName,
    required this.category,
  });
}

