part of 'generated.dart';

class GetBusinessesByUserIdVariablesBuilder {
  String userId;

  final FirebaseDataConnect _dataConnect;
  GetBusinessesByUserIdVariablesBuilder(this._dataConnect, {required  this.userId,});
  Deserializer<GetBusinessesByUserIdData> dataDeserializer = (dynamic json)  => GetBusinessesByUserIdData.fromJson(jsonDecode(json));
  Serializer<GetBusinessesByUserIdVariables> varsSerializer = (GetBusinessesByUserIdVariables vars) => jsonEncode(vars.toJson());
  Future<QueryResult<GetBusinessesByUserIdData, GetBusinessesByUserIdVariables>> execute() {
    return ref().execute();
  }

  QueryRef<GetBusinessesByUserIdData, GetBusinessesByUserIdVariables> ref() {
    GetBusinessesByUserIdVariables vars= GetBusinessesByUserIdVariables(userId: userId,);
    return _dataConnect.query("getBusinessesByUserId", dataDeserializer, varsSerializer, vars);
  }
}

@immutable
class GetBusinessesByUserIdBusinesses {
  final String id;
  final String businessName;
  final String? contactName;
  final String userId;
  final String? companyLogoUrl;
  final String? phone;
  final String? email;
  final String? hubBuilding;
  final String? address;
  final String? city;
  final EnumValue<BusinessArea>? area;
  final EnumValue<BusinessSector>? sector;
  final EnumValue<BusinessRateGroup> rateGroup;
  final EnumValue<BusinessStatus> status;
  final String? notes;
  final Timestamp? createdAt;
  final Timestamp? updatedAt;
  GetBusinessesByUserIdBusinesses.fromJson(dynamic json):
  
  id = nativeFromJson<String>(json['id']),
  businessName = nativeFromJson<String>(json['businessName']),
  contactName = json['contactName'] == null ? null : nativeFromJson<String>(json['contactName']),
  userId = nativeFromJson<String>(json['userId']),
  companyLogoUrl = json['companyLogoUrl'] == null ? null : nativeFromJson<String>(json['companyLogoUrl']),
  phone = json['phone'] == null ? null : nativeFromJson<String>(json['phone']),
  email = json['email'] == null ? null : nativeFromJson<String>(json['email']),
  hubBuilding = json['hubBuilding'] == null ? null : nativeFromJson<String>(json['hubBuilding']),
  address = json['address'] == null ? null : nativeFromJson<String>(json['address']),
  city = json['city'] == null ? null : nativeFromJson<String>(json['city']),
  area = json['area'] == null ? null : businessAreaDeserializer(json['area']),
  sector = json['sector'] == null ? null : businessSectorDeserializer(json['sector']),
  rateGroup = businessRateGroupDeserializer(json['rateGroup']),
  status = businessStatusDeserializer(json['status']),
  notes = json['notes'] == null ? null : nativeFromJson<String>(json['notes']),
  createdAt = json['createdAt'] == null ? null : Timestamp.fromJson(json['createdAt']),
  updatedAt = json['updatedAt'] == null ? null : Timestamp.fromJson(json['updatedAt']);
  @override
  bool operator ==(Object other) {
    if(identical(this, other)) {
      return true;
    }
    if(other.runtimeType != runtimeType) {
      return false;
    }

    final GetBusinessesByUserIdBusinesses otherTyped = other as GetBusinessesByUserIdBusinesses;
    return id == otherTyped.id && 
    businessName == otherTyped.businessName && 
    contactName == otherTyped.contactName && 
    userId == otherTyped.userId && 
    companyLogoUrl == otherTyped.companyLogoUrl && 
    phone == otherTyped.phone && 
    email == otherTyped.email && 
    hubBuilding == otherTyped.hubBuilding && 
    address == otherTyped.address && 
    city == otherTyped.city && 
    area == otherTyped.area && 
    sector == otherTyped.sector && 
    rateGroup == otherTyped.rateGroup && 
    status == otherTyped.status && 
    notes == otherTyped.notes && 
    createdAt == otherTyped.createdAt && 
    updatedAt == otherTyped.updatedAt;
    
  }
  @override
  int get hashCode => Object.hashAll([id.hashCode, businessName.hashCode, contactName.hashCode, userId.hashCode, companyLogoUrl.hashCode, phone.hashCode, email.hashCode, hubBuilding.hashCode, address.hashCode, city.hashCode, area.hashCode, sector.hashCode, rateGroup.hashCode, status.hashCode, notes.hashCode, createdAt.hashCode, updatedAt.hashCode]);
  

  Map<String, dynamic> toJson() {
    Map<String, dynamic> json = {};
    json['id'] = nativeToJson<String>(id);
    json['businessName'] = nativeToJson<String>(businessName);
    if (contactName != null) {
      json['contactName'] = nativeToJson<String?>(contactName);
    }
    json['userId'] = nativeToJson<String>(userId);
    if (companyLogoUrl != null) {
      json['companyLogoUrl'] = nativeToJson<String?>(companyLogoUrl);
    }
    if (phone != null) {
      json['phone'] = nativeToJson<String?>(phone);
    }
    if (email != null) {
      json['email'] = nativeToJson<String?>(email);
    }
    if (hubBuilding != null) {
      json['hubBuilding'] = nativeToJson<String?>(hubBuilding);
    }
    if (address != null) {
      json['address'] = nativeToJson<String?>(address);
    }
    if (city != null) {
      json['city'] = nativeToJson<String?>(city);
    }
    if (area != null) {
      json['area'] = 
    businessAreaSerializer(area!)
    ;
    }
    if (sector != null) {
      json['sector'] = 
    businessSectorSerializer(sector!)
    ;
    }
    json['rateGroup'] = 
    businessRateGroupSerializer(rateGroup)
    ;
    json['status'] = 
    businessStatusSerializer(status)
    ;
    if (notes != null) {
      json['notes'] = nativeToJson<String?>(notes);
    }
    if (createdAt != null) {
      json['createdAt'] = createdAt!.toJson();
    }
    if (updatedAt != null) {
      json['updatedAt'] = updatedAt!.toJson();
    }
    return json;
  }

  GetBusinessesByUserIdBusinesses({
    required this.id,
    required this.businessName,
    this.contactName,
    required this.userId,
    this.companyLogoUrl,
    this.phone,
    this.email,
    this.hubBuilding,
    this.address,
    this.city,
    this.area,
    this.sector,
    required this.rateGroup,
    required this.status,
    this.notes,
    this.createdAt,
    this.updatedAt,
  });
}

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

    final GetBusinessesByUserIdData otherTyped = other as GetBusinessesByUserIdData;
    return businesses == otherTyped.businesses;
    
  }
  @override
  int get hashCode => businesses.hashCode;
  

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

  GetBusinessesByUserIdData({
    required this.businesses,
  });
}

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

    final GetBusinessesByUserIdVariables otherTyped = other as GetBusinessesByUserIdVariables;
    return userId == otherTyped.userId;
    
  }
  @override
  int get hashCode => userId.hashCode;
  

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

  GetBusinessesByUserIdVariables({
    required this.userId,
  });
}

