part of 'generated.dart';

class UpdateBusinessVariablesBuilder {
  String id;
  Optional<String> _businessName = Optional.optional(nativeFromJson, nativeToJson);
  Optional<String> _contactName = Optional.optional(nativeFromJson, nativeToJson);
  Optional<String> _companyLogoUrl = Optional.optional(nativeFromJson, nativeToJson);
  Optional<String> _phone = Optional.optional(nativeFromJson, nativeToJson);
  Optional<String> _email = Optional.optional(nativeFromJson, nativeToJson);
  Optional<String> _hubBuilding = Optional.optional(nativeFromJson, nativeToJson);
  Optional<String> _address = Optional.optional(nativeFromJson, nativeToJson);
  Optional<String> _city = Optional.optional(nativeFromJson, nativeToJson);
  Optional<BusinessArea> _area = Optional.optional((data) => BusinessArea.values.byName(data), enumSerializer);
  Optional<BusinessSector> _sector = Optional.optional((data) => BusinessSector.values.byName(data), enumSerializer);
  Optional<BusinessRateGroup> _rateGroup = Optional.optional((data) => BusinessRateGroup.values.byName(data), enumSerializer);
  Optional<BusinessStatus> _status = Optional.optional((data) => BusinessStatus.values.byName(data), enumSerializer);
  Optional<String> _notes = Optional.optional(nativeFromJson, nativeToJson);

  final FirebaseDataConnect _dataConnect;  UpdateBusinessVariablesBuilder businessName(String? t) {
   _businessName.value = t;
   return this;
  }
  UpdateBusinessVariablesBuilder contactName(String? t) {
   _contactName.value = t;
   return this;
  }
  UpdateBusinessVariablesBuilder companyLogoUrl(String? t) {
   _companyLogoUrl.value = t;
   return this;
  }
  UpdateBusinessVariablesBuilder phone(String? t) {
   _phone.value = t;
   return this;
  }
  UpdateBusinessVariablesBuilder email(String? t) {
   _email.value = t;
   return this;
  }
  UpdateBusinessVariablesBuilder hubBuilding(String? t) {
   _hubBuilding.value = t;
   return this;
  }
  UpdateBusinessVariablesBuilder address(String? t) {
   _address.value = t;
   return this;
  }
  UpdateBusinessVariablesBuilder city(String? t) {
   _city.value = t;
   return this;
  }
  UpdateBusinessVariablesBuilder area(BusinessArea? t) {
   _area.value = t;
   return this;
  }
  UpdateBusinessVariablesBuilder sector(BusinessSector? t) {
   _sector.value = t;
   return this;
  }
  UpdateBusinessVariablesBuilder rateGroup(BusinessRateGroup? t) {
   _rateGroup.value = t;
   return this;
  }
  UpdateBusinessVariablesBuilder status(BusinessStatus? t) {
   _status.value = t;
   return this;
  }
  UpdateBusinessVariablesBuilder notes(String? t) {
   _notes.value = t;
   return this;
  }

  UpdateBusinessVariablesBuilder(this._dataConnect, {required  this.id,});
  Deserializer<UpdateBusinessData> dataDeserializer = (dynamic json)  => UpdateBusinessData.fromJson(jsonDecode(json));
  Serializer<UpdateBusinessVariables> varsSerializer = (UpdateBusinessVariables vars) => jsonEncode(vars.toJson());
  Future<OperationResult<UpdateBusinessData, UpdateBusinessVariables>> execute() {
    return ref().execute();
  }

  MutationRef<UpdateBusinessData, UpdateBusinessVariables> ref() {
    UpdateBusinessVariables vars= UpdateBusinessVariables(id: id,businessName: _businessName,contactName: _contactName,companyLogoUrl: _companyLogoUrl,phone: _phone,email: _email,hubBuilding: _hubBuilding,address: _address,city: _city,area: _area,sector: _sector,rateGroup: _rateGroup,status: _status,notes: _notes,);
    return _dataConnect.mutation("updateBusiness", dataDeserializer, varsSerializer, vars);
  }
}

@immutable
class UpdateBusinessBusinessUpdate {
  final String id;
  UpdateBusinessBusinessUpdate.fromJson(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 UpdateBusinessBusinessUpdate otherTyped = other as UpdateBusinessBusinessUpdate;
    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;
  }

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

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

    final UpdateBusinessData otherTyped = other as UpdateBusinessData;
    return business_update == otherTyped.business_update;
    
  }
  @override
  int get hashCode => business_update.hashCode;
  

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

  UpdateBusinessData({
    this.business_update,
  });
}

@immutable
class UpdateBusinessVariables {
  final String id;
  late final Optional<String>businessName;
  late final Optional<String>contactName;
  late final Optional<String>companyLogoUrl;
  late final Optional<String>phone;
  late final Optional<String>email;
  late final Optional<String>hubBuilding;
  late final Optional<String>address;
  late final Optional<String>city;
  late final Optional<BusinessArea>area;
  late final Optional<BusinessSector>sector;
  late final Optional<BusinessRateGroup>rateGroup;
  late final Optional<BusinessStatus>status;
  late final Optional<String>notes;
  @Deprecated('fromJson is deprecated for Variable classes as they are no longer required for deserialization.')
  UpdateBusinessVariables.fromJson(Map<String, dynamic> json):
  
  id = nativeFromJson<String>(json['id']) {
  
  
  
    businessName = Optional.optional(nativeFromJson, nativeToJson);
    businessName.value = json['businessName'] == null ? null : nativeFromJson<String>(json['businessName']);
  
  
    contactName = Optional.optional(nativeFromJson, nativeToJson);
    contactName.value = json['contactName'] == null ? null : nativeFromJson<String>(json['contactName']);
  
  
    companyLogoUrl = Optional.optional(nativeFromJson, nativeToJson);
    companyLogoUrl.value = json['companyLogoUrl'] == null ? null : nativeFromJson<String>(json['companyLogoUrl']);
  
  
    phone = Optional.optional(nativeFromJson, nativeToJson);
    phone.value = json['phone'] == null ? null : nativeFromJson<String>(json['phone']);
  
  
    email = Optional.optional(nativeFromJson, nativeToJson);
    email.value = json['email'] == null ? null : nativeFromJson<String>(json['email']);
  
  
    hubBuilding = Optional.optional(nativeFromJson, nativeToJson);
    hubBuilding.value = json['hubBuilding'] == null ? null : nativeFromJson<String>(json['hubBuilding']);
  
  
    address = Optional.optional(nativeFromJson, nativeToJson);
    address.value = json['address'] == null ? null : nativeFromJson<String>(json['address']);
  
  
    city = Optional.optional(nativeFromJson, nativeToJson);
    city.value = json['city'] == null ? null : nativeFromJson<String>(json['city']);
  
  
    area = Optional.optional((data) => BusinessArea.values.byName(data), enumSerializer);
    area.value = json['area'] == null ? null : BusinessArea.values.byName(json['area']);
  
  
    sector = Optional.optional((data) => BusinessSector.values.byName(data), enumSerializer);
    sector.value = json['sector'] == null ? null : BusinessSector.values.byName(json['sector']);
  
  
    rateGroup = Optional.optional((data) => BusinessRateGroup.values.byName(data), enumSerializer);
    rateGroup.value = json['rateGroup'] == null ? null : BusinessRateGroup.values.byName(json['rateGroup']);
  
  
    status = Optional.optional((data) => BusinessStatus.values.byName(data), enumSerializer);
    status.value = json['status'] == null ? null : BusinessStatus.values.byName(json['status']);
  
  
    notes = Optional.optional(nativeFromJson, nativeToJson);
    notes.value = json['notes'] == null ? null : nativeFromJson<String>(json['notes']);
  
  }
  @override
  bool operator ==(Object other) {
    if(identical(this, other)) {
      return true;
    }
    if(other.runtimeType != runtimeType) {
      return false;
    }

    final UpdateBusinessVariables otherTyped = other as UpdateBusinessVariables;
    return id == otherTyped.id && 
    businessName == otherTyped.businessName && 
    contactName == otherTyped.contactName && 
    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;
    
  }
  @override
  int get hashCode => Object.hashAll([id.hashCode, businessName.hashCode, contactName.hashCode, companyLogoUrl.hashCode, phone.hashCode, email.hashCode, hubBuilding.hashCode, address.hashCode, city.hashCode, area.hashCode, sector.hashCode, rateGroup.hashCode, status.hashCode, notes.hashCode]);
  

  Map<String, dynamic> toJson() {
    Map<String, dynamic> json = {};
    json['id'] = nativeToJson<String>(id);
    if(businessName.state == OptionalState.set) {
      json['businessName'] = businessName.toJson();
    }
    if(contactName.state == OptionalState.set) {
      json['contactName'] = contactName.toJson();
    }
    if(companyLogoUrl.state == OptionalState.set) {
      json['companyLogoUrl'] = companyLogoUrl.toJson();
    }
    if(phone.state == OptionalState.set) {
      json['phone'] = phone.toJson();
    }
    if(email.state == OptionalState.set) {
      json['email'] = email.toJson();
    }
    if(hubBuilding.state == OptionalState.set) {
      json['hubBuilding'] = hubBuilding.toJson();
    }
    if(address.state == OptionalState.set) {
      json['address'] = address.toJson();
    }
    if(city.state == OptionalState.set) {
      json['city'] = city.toJson();
    }
    if(area.state == OptionalState.set) {
      json['area'] = area.toJson();
    }
    if(sector.state == OptionalState.set) {
      json['sector'] = sector.toJson();
    }
    if(rateGroup.state == OptionalState.set) {
      json['rateGroup'] = rateGroup.toJson();
    }
    if(status.state == OptionalState.set) {
      json['status'] = status.toJson();
    }
    if(notes.state == OptionalState.set) {
      json['notes'] = notes.toJson();
    }
    return json;
  }

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

