part of 'generated.dart';

class CreateBusinessVariablesBuilder {
  String businessName;
  Optional<String> _contactName = Optional.optional(nativeFromJson, nativeToJson);
  String userId;
  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);
  BusinessRateGroup rateGroup;
  BusinessStatus status;
  Optional<String> _notes = Optional.optional(nativeFromJson, nativeToJson);

  final FirebaseDataConnect _dataConnect;  CreateBusinessVariablesBuilder contactName(String? t) {
   _contactName.value = t;
   return this;
  }
  CreateBusinessVariablesBuilder companyLogoUrl(String? t) {
   _companyLogoUrl.value = t;
   return this;
  }
  CreateBusinessVariablesBuilder phone(String? t) {
   _phone.value = t;
   return this;
  }
  CreateBusinessVariablesBuilder email(String? t) {
   _email.value = t;
   return this;
  }
  CreateBusinessVariablesBuilder hubBuilding(String? t) {
   _hubBuilding.value = t;
   return this;
  }
  CreateBusinessVariablesBuilder address(String? t) {
   _address.value = t;
   return this;
  }
  CreateBusinessVariablesBuilder city(String? t) {
   _city.value = t;
   return this;
  }
  CreateBusinessVariablesBuilder area(BusinessArea? t) {
   _area.value = t;
   return this;
  }
  CreateBusinessVariablesBuilder sector(BusinessSector? t) {
   _sector.value = t;
   return this;
  }
  CreateBusinessVariablesBuilder notes(String? t) {
   _notes.value = t;
   return this;
  }

  CreateBusinessVariablesBuilder(this._dataConnect, {required  this.businessName,required  this.userId,required  this.rateGroup,required  this.status,});
  Deserializer<CreateBusinessData> dataDeserializer = (dynamic json)  => CreateBusinessData.fromJson(jsonDecode(json));
  Serializer<CreateBusinessVariables> varsSerializer = (CreateBusinessVariables vars) => jsonEncode(vars.toJson());
  Future<OperationResult<CreateBusinessData, CreateBusinessVariables>> execute() {
    return ref().execute();
  }

  MutationRef<CreateBusinessData, CreateBusinessVariables> ref() {
    CreateBusinessVariables vars= CreateBusinessVariables(businessName: businessName,contactName: _contactName,userId: userId,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("createBusiness", dataDeserializer, varsSerializer, vars);
  }
}

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

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

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

    final CreateBusinessData otherTyped = other as CreateBusinessData;
    return business_insert == otherTyped.business_insert;
    
  }
  @override
  int get hashCode => business_insert.hashCode;
  

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

  CreateBusinessData({
    required this.business_insert,
  });
}

@immutable
class CreateBusinessVariables {
  final String businessName;
  late final Optional<String>contactName;
  final String userId;
  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;
  final BusinessRateGroup rateGroup;
  final BusinessStatus status;
  late final Optional<String>notes;
  @Deprecated('fromJson is deprecated for Variable classes as they are no longer required for deserialization.')
  CreateBusinessVariables.fromJson(Map<String, dynamic> json):
  
  businessName = nativeFromJson<String>(json['businessName']),
  userId = nativeFromJson<String>(json['userId']),
  rateGroup = BusinessRateGroup.values.byName(json['rateGroup']),
  status = BusinessStatus.values.byName(json['status']) {
  
  
  
    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']);
  
  
  
  
    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 CreateBusinessVariables otherTyped = other as CreateBusinessVariables;
    return 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;
    
  }
  @override
  int get hashCode => Object.hashAll([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]);
  

  Map<String, dynamic> toJson() {
    Map<String, dynamic> json = {};
    json['businessName'] = nativeToJson<String>(businessName);
    if(contactName.state == OptionalState.set) {
      json['contactName'] = contactName.toJson();
    }
    json['userId'] = nativeToJson<String>(userId);
    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();
    }
    json['rateGroup'] = 
    rateGroup.name
    ;
    json['status'] = 
    status.name
    ;
    if(notes.state == OptionalState.set) {
      json['notes'] = notes.toJson();
    }
    return json;
  }

  CreateBusinessVariables({
    required this.businessName,
    required this.contactName,
    required this.userId,
    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,
  });
}

