part of 'generated.dart';

class GetRoleCategoriesByCategoryVariablesBuilder {
  RoleCategoryType category;

  final FirebaseDataConnect _dataConnect;
  GetRoleCategoriesByCategoryVariablesBuilder(this._dataConnect, {required  this.category,});
  Deserializer<GetRoleCategoriesByCategoryData> dataDeserializer = (dynamic json)  => GetRoleCategoriesByCategoryData.fromJson(jsonDecode(json));
  Serializer<GetRoleCategoriesByCategoryVariables> varsSerializer = (GetRoleCategoriesByCategoryVariables vars) => jsonEncode(vars.toJson());
  Future<QueryResult<GetRoleCategoriesByCategoryData, GetRoleCategoriesByCategoryVariables>> execute() {
    return ref().execute();
  }

  QueryRef<GetRoleCategoriesByCategoryData, GetRoleCategoriesByCategoryVariables> ref() {
    GetRoleCategoriesByCategoryVariables vars= GetRoleCategoriesByCategoryVariables(category: category,);
    return _dataConnect.query("getRoleCategoriesByCategory", dataDeserializer, varsSerializer, vars);
  }
}

@immutable
class GetRoleCategoriesByCategoryRoleCategories {
  final String id;
  final String roleName;
  final EnumValue<RoleCategoryType> category;
  GetRoleCategoriesByCategoryRoleCategories.fromJson(dynamic json):
  
  id = nativeFromJson<String>(json['id']),
  roleName = nativeFromJson<String>(json['roleName']),
  category = roleCategoryTypeDeserializer(json['category']);
  @override
  bool operator ==(Object other) {
    if(identical(this, other)) {
      return true;
    }
    if(other.runtimeType != runtimeType) {
      return false;
    }

    final GetRoleCategoriesByCategoryRoleCategories otherTyped = other as GetRoleCategoriesByCategoryRoleCategories;
    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);
    json['roleName'] = nativeToJson<String>(roleName);
    json['category'] = 
    roleCategoryTypeSerializer(category)
    ;
    return json;
  }

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

@immutable
class GetRoleCategoriesByCategoryData {
  final List<GetRoleCategoriesByCategoryRoleCategories> roleCategories;
  GetRoleCategoriesByCategoryData.fromJson(dynamic json):
  
  roleCategories = (json['roleCategories'] as List<dynamic>)
        .map((e) => GetRoleCategoriesByCategoryRoleCategories.fromJson(e))
        .toList();
  @override
  bool operator ==(Object other) {
    if(identical(this, other)) {
      return true;
    }
    if(other.runtimeType != runtimeType) {
      return false;
    }

    final GetRoleCategoriesByCategoryData otherTyped = other as GetRoleCategoriesByCategoryData;
    return roleCategories == otherTyped.roleCategories;
    
  }
  @override
  int get hashCode => roleCategories.hashCode;
  

  Map<String, dynamic> toJson() {
    Map<String, dynamic> json = {};
    json['roleCategories'] = roleCategories.map((e) => e.toJson()).toList();
    return json;
  }

  GetRoleCategoriesByCategoryData({
    required this.roleCategories,
  });
}

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

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

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

  GetRoleCategoriesByCategoryVariables({
    required this.category,
  });
}

