part of 'generated.dart';

class GetLevelByIdVariablesBuilder {
  String id;

  final FirebaseDataConnect _dataConnect;
  GetLevelByIdVariablesBuilder(this._dataConnect, {required  this.id,});
  Deserializer<GetLevelByIdData> dataDeserializer = (dynamic json)  => GetLevelByIdData.fromJson(jsonDecode(json));
  Serializer<GetLevelByIdVariables> varsSerializer = (GetLevelByIdVariables vars) => jsonEncode(vars.toJson());
  Future<QueryResult<GetLevelByIdData, GetLevelByIdVariables>> execute() {
    return ref().execute();
  }

  QueryRef<GetLevelByIdData, GetLevelByIdVariables> ref() {
    GetLevelByIdVariables vars= GetLevelByIdVariables(id: id,);
    return _dataConnect.query("getLevelById", dataDeserializer, varsSerializer, vars);
  }
}

@immutable
class GetLevelByIdLevel {
  final String id;
  final String name;
  final int xpRequired;
  final String? icon;
  final AnyValue? colors;
  final Timestamp? createdAt;
  final Timestamp? updatedAt;
  final String? createdBy;
  GetLevelByIdLevel.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 GetLevelByIdLevel otherTyped = other as GetLevelByIdLevel;
    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;
  }

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

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

    final GetLevelByIdData otherTyped = other as GetLevelByIdData;
    return level == otherTyped.level;
    
  }
  @override
  int get hashCode => level.hashCode;
  

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

  GetLevelByIdData({
    this.level,
  });
}

@immutable
class GetLevelByIdVariables {
  final String id;
  @Deprecated('fromJson is deprecated for Variable classes as they are no longer required for deserialization.')
  GetLevelByIdVariables.fromJson(Map<String, 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 GetLevelByIdVariables otherTyped = other as GetLevelByIdVariables;
    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;
  }

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

