part of 'generated.dart';

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

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

@immutable
class ListHubsHubs {
  final String id;
  final String name;
  final String? locationName;
  final String? address;
  final String? nfcTagId;
  final String ownerId;
  final Timestamp? createdAt;
  final Timestamp? updatedAt;
  final String? createdBy;
  ListHubsHubs.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']),
  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 ListHubsHubs otherTyped = other as ListHubsHubs;
    return id == otherTyped.id && 
    name == otherTyped.name && 
    locationName == otherTyped.locationName && 
    address == otherTyped.address && 
    nfcTagId == otherTyped.nfcTagId && 
    ownerId == otherTyped.ownerId && 
    createdAt == otherTyped.createdAt && 
    updatedAt == otherTyped.updatedAt && 
    createdBy == otherTyped.createdBy;
    
  }
  @override
  int get hashCode => Object.hashAll([id.hashCode, name.hashCode, locationName.hashCode, address.hashCode, nfcTagId.hashCode, ownerId.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);
    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);
    if (createdAt != null) {
      json['createdAt'] = createdAt!.toJson();
    }
    if (updatedAt != null) {
      json['updatedAt'] = updatedAt!.toJson();
    }
    if (createdBy != null) {
      json['createdBy'] = nativeToJson<String?>(createdBy);
    }
    return json;
  }

  ListHubsHubs({
    required this.id,
    required this.name,
    this.locationName,
    this.address,
    this.nfcTagId,
    required this.ownerId,
    this.createdAt,
    this.updatedAt,
    this.createdBy,
  });
}

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

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

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

