part of 'generated.dart';

class GetHubByIdVariablesBuilder {
  String id;

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

  QueryRef<GetHubByIdData, GetHubByIdVariables> ref() {
    GetHubByIdVariables vars= GetHubByIdVariables(id: id,);
    return _dataConnect.query("getHubById", dataDeserializer, varsSerializer, vars);
  }
}

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

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

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

    final GetHubByIdData otherTyped = other as GetHubByIdData;
    return hub == otherTyped.hub;
    
  }
  @override
  int get hashCode => hub.hashCode;
  

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

  GetHubByIdData({
    this.hub,
  });
}

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

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

