part of 'generated.dart';

class FilterHubsVariablesBuilder {
  Optional<String> _ownerId = Optional.optional(nativeFromJson, nativeToJson);
  Optional<String> _name = Optional.optional(nativeFromJson, nativeToJson);
  Optional<String> _nfcTagId = Optional.optional(nativeFromJson, nativeToJson);

  final FirebaseDataConnect _dataConnect;
  FilterHubsVariablesBuilder ownerId(String? t) {
   _ownerId.value = t;
   return this;
  }
  FilterHubsVariablesBuilder name(String? t) {
   _name.value = t;
   return this;
  }
  FilterHubsVariablesBuilder nfcTagId(String? t) {
   _nfcTagId.value = t;
   return this;
  }

  FilterHubsVariablesBuilder(this._dataConnect, );
  Deserializer<FilterHubsData> dataDeserializer = (dynamic json)  => FilterHubsData.fromJson(jsonDecode(json));
  Serializer<FilterHubsVariables> varsSerializer = (FilterHubsVariables vars) => jsonEncode(vars.toJson());
  Future<QueryResult<FilterHubsData, FilterHubsVariables>> execute() {
    return ref().execute();
  }

  QueryRef<FilterHubsData, FilterHubsVariables> ref() {
    FilterHubsVariables vars= FilterHubsVariables(ownerId: _ownerId,name: _name,nfcTagId: _nfcTagId,);
    return _dataConnect.query("filterHubs", dataDeserializer, varsSerializer, vars);
  }
}

@immutable
class FilterHubsHubs {
  final String id;
  final String name;
  final String? locationName;
  final String? address;
  final String? nfcTagId;
  final String ownerId;
  FilterHubsHubs.fromJson(dynamic json):
  
  id = nativeFromJson<String>(json['id']),
  name = nativeFromJson<String>(json['name']),
  locationName = json['locationName'] == null ? null : nativeFromJson<String>(json['locationName']),
  address = json['address'] == null ? null : nativeFromJson<String>(json['address']),
  nfcTagId = json['nfcTagId'] == null ? null : nativeFromJson<String>(json['nfcTagId']),
  ownerId = nativeFromJson<String>(json['ownerId']);
  @override
  bool operator ==(Object other) {
    if(identical(this, other)) {
      return true;
    }
    if(other.runtimeType != runtimeType) {
      return false;
    }

    final FilterHubsHubs otherTyped = other as FilterHubsHubs;
    return id == otherTyped.id && 
    name == otherTyped.name && 
    locationName == otherTyped.locationName && 
    address == otherTyped.address && 
    nfcTagId == otherTyped.nfcTagId && 
    ownerId == otherTyped.ownerId;
    
  }
  @override
  int get hashCode => Object.hashAll([id.hashCode, name.hashCode, locationName.hashCode, address.hashCode, nfcTagId.hashCode, ownerId.hashCode]);
  

  Map<String, dynamic> toJson() {
    Map<String, dynamic> json = {};
    json['id'] = nativeToJson<String>(id);
    json['name'] = nativeToJson<String>(name);
    if (locationName != null) {
      json['locationName'] = nativeToJson<String?>(locationName);
    }
    if (address != null) {
      json['address'] = nativeToJson<String?>(address);
    }
    if (nfcTagId != null) {
      json['nfcTagId'] = nativeToJson<String?>(nfcTagId);
    }
    json['ownerId'] = nativeToJson<String>(ownerId);
    return json;
  }

  FilterHubsHubs({
    required this.id,
    required this.name,
    this.locationName,
    this.address,
    this.nfcTagId,
    required this.ownerId,
  });
}

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

    final FilterHubsData otherTyped = other as FilterHubsData;
    return hubs == otherTyped.hubs;
    
  }
  @override
  int get hashCode => hubs.hashCode;
  

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

  FilterHubsData({
    required this.hubs,
  });
}

@immutable
class FilterHubsVariables {
  late final Optional<String>ownerId;
  late final Optional<String>name;
  late final Optional<String>nfcTagId;
  @Deprecated('fromJson is deprecated for Variable classes as they are no longer required for deserialization.')
  FilterHubsVariables.fromJson(Map<String, dynamic> json) {
  
  
    ownerId = Optional.optional(nativeFromJson, nativeToJson);
    ownerId.value = json['ownerId'] == null ? null : nativeFromJson<String>(json['ownerId']);
  
  
    name = Optional.optional(nativeFromJson, nativeToJson);
    name.value = json['name'] == null ? null : nativeFromJson<String>(json['name']);
  
  
    nfcTagId = Optional.optional(nativeFromJson, nativeToJson);
    nfcTagId.value = json['nfcTagId'] == null ? null : nativeFromJson<String>(json['nfcTagId']);
  
  }
  @override
  bool operator ==(Object other) {
    if(identical(this, other)) {
      return true;
    }
    if(other.runtimeType != runtimeType) {
      return false;
    }

    final FilterHubsVariables otherTyped = other as FilterHubsVariables;
    return ownerId == otherTyped.ownerId && 
    name == otherTyped.name && 
    nfcTagId == otherTyped.nfcTagId;
    
  }
  @override
  int get hashCode => Object.hashAll([ownerId.hashCode, name.hashCode, nfcTagId.hashCode]);
  

  Map<String, dynamic> toJson() {
    Map<String, dynamic> json = {};
    if(ownerId.state == OptionalState.set) {
      json['ownerId'] = ownerId.toJson();
    }
    if(name.state == OptionalState.set) {
      json['name'] = name.toJson();
    }
    if(nfcTagId.state == OptionalState.set) {
      json['nfcTagId'] = nfcTagId.toJson();
    }
    return json;
  }

  FilterHubsVariables({
    required this.ownerId,
    required this.name,
    required this.nfcTagId,
  });
}

