part of 'generated.dart';

class GetBusinessByIdVariablesBuilder {
  String id;

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

  QueryRef<GetBusinessByIdData, GetBusinessByIdVariables> ref() {
    GetBusinessByIdVariables vars= GetBusinessByIdVariables(id: id,);
    return _dataConnect.query("getBusinessById", dataDeserializer, varsSerializer, vars);
  }
}

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

  GetBusinessByIdBusiness({
    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 GetBusinessByIdData {
  final GetBusinessByIdBusiness? business;
  GetBusinessByIdData.fromJson(dynamic json):
  
  business = json['business'] == null ? null : GetBusinessByIdBusiness.fromJson(json['business']);
  @override
  bool operator ==(Object other) {
    if(identical(this, other)) {
      return true;
    }
    if(other.runtimeType != runtimeType) {
      return false;
    }

    final GetBusinessByIdData otherTyped = other as GetBusinessByIdData;
    return business == otherTyped.business;
    
  }
  @override
  int get hashCode => business.hashCode;
  

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

  GetBusinessByIdData({
    this.business,
  });
}

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

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

