part of 'generated.dart';

class ListRoleCategoriesVariablesBuilder {
  
  final FirebaseDataConnect _dataConnect;
  ListRoleCategoriesVariablesBuilder(this._dataConnect, );
  Deserializer<ListRoleCategoriesData> dataDeserializer = (dynamic json)  => ListRoleCategoriesData.fromJson(jsonDecode(json));
  
  Future<QueryResult<ListRoleCategoriesData, void>> execute() {
    return ref().execute();
  }

  QueryRef<ListRoleCategoriesData, void> ref() {
    
    return _dataConnect.query("listRoleCategories", dataDeserializer, emptySerializer, null);
  }
}

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

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

  Map<String, dynamic> toJson() {
    Map<String, dynamic> json = {};
    json['id'] = nativeToJson<String>(id);
    json['roleName'] = nativeToJson<String>(roleName);
    json['category'] = 
    roleCategoryTypeSerializer(category)
    ;
    if (createdAt != null) {
      json['createdAt'] = createdAt!.toJson();
    }
    if (updatedAt != null) {
      json['updatedAt'] = updatedAt!.toJson();
    }
    return json;
  }

  ListRoleCategoriesRoleCategories({
    required this.id,
    required this.roleName,
    required this.category,
    this.createdAt,
    this.updatedAt,
  });
}

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

    final ListRoleCategoriesData otherTyped = other as ListRoleCategoriesData;
    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;
  }

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

