part of 'generated.dart';

class GetHubsByOwnerIdVariablesBuilder {
  String ownerId;

  final FirebaseDataConnect _dataConnect;
  GetHubsByOwnerIdVariablesBuilder(this._dataConnect, {required  this.ownerId,});
  Deserializer<GetHubsByOwnerIdData> dataDeserializer = (dynamic json)  => GetHubsByOwnerIdData.fromJson(jsonDecode(json));
  Serializer<GetHubsByOwnerIdVariables> varsSerializer = (GetHubsByOwnerIdVariables vars) => jsonEncode(vars.toJson());
  Future<QueryResult<GetHubsByOwnerIdData, GetHubsByOwnerIdVariables>> execute() {
    return ref().execute();
  }

  QueryRef<GetHubsByOwnerIdData, GetHubsByOwnerIdVariables> ref() {
    GetHubsByOwnerIdVariables vars= GetHubsByOwnerIdVariables(ownerId: ownerId,);
    return _dataConnect.query("getHubsByOwnerId", dataDeserializer, varsSerializer, vars);
  }
}

@immutable
class GetHubsByOwnerIdHubs {
  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;
  GetHubsByOwnerIdHubs.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 GetHubsByOwnerIdHubs otherTyped = other as GetHubsByOwnerIdHubs;
    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;
  }

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

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

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

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

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

    final GetHubsByOwnerIdVariables otherTyped = other as GetHubsByOwnerIdVariables;
    return ownerId == otherTyped.ownerId;
    
  }
  @override
  int get hashCode => ownerId.hashCode;
  

  Map<String, dynamic> toJson() {
    Map<String, dynamic> json = {};
    json['ownerId'] = nativeToJson<String>(ownerId);
    return json;
  }

  GetHubsByOwnerIdVariables({
    required this.ownerId,
  });
}

