part of 'generated.dart';

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

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

@immutable
class ListLevelsLevels {
  final String id;
  final String name;
  final int xpRequired;
  final String? icon;
  final AnyValue? colors;
  final Timestamp? createdAt;
  final Timestamp? updatedAt;
  final String? createdBy;
  ListLevelsLevels.fromJson(dynamic json):
  
  id = nativeFromJson<String>(json['id']),
  name = nativeFromJson<String>(json['name']),
  xpRequired = nativeFromJson<int>(json['xpRequired']),
  icon = json['icon'] == null ? null : nativeFromJson<String>(json['icon']),
  colors = json['colors'] == null ? null : AnyValue.fromJson(json['colors']),
  createdAt = json['createdAt'] == null ? null : Timestamp.fromJson(json['createdAt']),
  updatedAt = json['updatedAt'] == null ? null : Timestamp.fromJson(json['updatedAt']),
  createdBy = json['createdBy'] == null ? null : nativeFromJson<String>(json['createdBy']);
  @override
  bool operator ==(Object other) {
    if(identical(this, other)) {
      return true;
    }
    if(other.runtimeType != runtimeType) {
      return false;
    }

    final ListLevelsLevels otherTyped = other as ListLevelsLevels;
    return id == otherTyped.id && 
    name == otherTyped.name && 
    xpRequired == otherTyped.xpRequired && 
    icon == otherTyped.icon && 
    colors == otherTyped.colors && 
    createdAt == otherTyped.createdAt && 
    updatedAt == otherTyped.updatedAt && 
    createdBy == otherTyped.createdBy;
    
  }
  @override
  int get hashCode => Object.hashAll([id.hashCode, name.hashCode, xpRequired.hashCode, icon.hashCode, colors.hashCode, createdAt.hashCode, updatedAt.hashCode, createdBy.hashCode]);
  

  Map<String, dynamic> toJson() {
    Map<String, dynamic> json = {};
    json['id'] = nativeToJson<String>(id);
    json['name'] = nativeToJson<String>(name);
    json['xpRequired'] = nativeToJson<int>(xpRequired);
    if (icon != null) {
      json['icon'] = nativeToJson<String?>(icon);
    }
    if (colors != null) {
      json['colors'] = colors!.toJson();
    }
    if (createdAt != null) {
      json['createdAt'] = createdAt!.toJson();
    }
    if (updatedAt != null) {
      json['updatedAt'] = updatedAt!.toJson();
    }
    if (createdBy != null) {
      json['createdBy'] = nativeToJson<String?>(createdBy);
    }
    return json;
  }

  ListLevelsLevels({
    required this.id,
    required this.name,
    required this.xpRequired,
    this.icon,
    this.colors,
    this.createdAt,
    this.updatedAt,
    this.createdBy,
  });
}

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

    final ListLevelsData otherTyped = other as ListLevelsData;
    return levels == otherTyped.levels;
    
  }
  @override
  int get hashCode => levels.hashCode;
  

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

  ListLevelsData({
    required this.levels,
  });
}

