part of 'generated.dart';

class CreateVendorVariablesBuilder {
  String userId;
  String companyName;
  Optional<String> _email = Optional.optional(nativeFromJson, nativeToJson);
  Optional<String> _phone = Optional.optional(nativeFromJson, nativeToJson);
  Optional<String> _photoUrl = Optional.optional(nativeFromJson, nativeToJson);
  Optional<String> _address = Optional.optional(nativeFromJson, nativeToJson);
  Optional<String> _billingAddress = Optional.optional(nativeFromJson, nativeToJson);
  Optional<String> _timezone = Optional.optional(nativeFromJson, nativeToJson);
  Optional<String> _legalName = Optional.optional(nativeFromJson, nativeToJson);
  Optional<String> _doingBusinessAs = Optional.optional(nativeFromJson, nativeToJson);
  Optional<String> _region = Optional.optional(nativeFromJson, nativeToJson);
  Optional<String> _state = Optional.optional(nativeFromJson, nativeToJson);
  Optional<String> _city = Optional.optional(nativeFromJson, nativeToJson);
  Optional<String> _serviceSpecialty = Optional.optional(nativeFromJson, nativeToJson);
  Optional<ApprovalStatus> _approvalStatus = Optional.optional((data) => ApprovalStatus.values.byName(data), enumSerializer);
  Optional<bool> _isActive = Optional.optional(nativeFromJson, nativeToJson);
  Optional<double> _markup = Optional.optional(nativeFromJson, nativeToJson);
  Optional<double> _fee = Optional.optional(nativeFromJson, nativeToJson);
  Optional<double> _csat = Optional.optional(nativeFromJson, nativeToJson);
  Optional<VendorTier> _tier = Optional.optional((data) => VendorTier.values.byName(data), enumSerializer);

  final FirebaseDataConnect _dataConnect;  CreateVendorVariablesBuilder email(String? t) {
   _email.value = t;
   return this;
  }
  CreateVendorVariablesBuilder phone(String? t) {
   _phone.value = t;
   return this;
  }
  CreateVendorVariablesBuilder photoUrl(String? t) {
   _photoUrl.value = t;
   return this;
  }
  CreateVendorVariablesBuilder address(String? t) {
   _address.value = t;
   return this;
  }
  CreateVendorVariablesBuilder billingAddress(String? t) {
   _billingAddress.value = t;
   return this;
  }
  CreateVendorVariablesBuilder timezone(String? t) {
   _timezone.value = t;
   return this;
  }
  CreateVendorVariablesBuilder legalName(String? t) {
   _legalName.value = t;
   return this;
  }
  CreateVendorVariablesBuilder doingBusinessAs(String? t) {
   _doingBusinessAs.value = t;
   return this;
  }
  CreateVendorVariablesBuilder region(String? t) {
   _region.value = t;
   return this;
  }
  CreateVendorVariablesBuilder state(String? t) {
   _state.value = t;
   return this;
  }
  CreateVendorVariablesBuilder city(String? t) {
   _city.value = t;
   return this;
  }
  CreateVendorVariablesBuilder serviceSpecialty(String? t) {
   _serviceSpecialty.value = t;
   return this;
  }
  CreateVendorVariablesBuilder approvalStatus(ApprovalStatus? t) {
   _approvalStatus.value = t;
   return this;
  }
  CreateVendorVariablesBuilder isActive(bool? t) {
   _isActive.value = t;
   return this;
  }
  CreateVendorVariablesBuilder markup(double? t) {
   _markup.value = t;
   return this;
  }
  CreateVendorVariablesBuilder fee(double? t) {
   _fee.value = t;
   return this;
  }
  CreateVendorVariablesBuilder csat(double? t) {
   _csat.value = t;
   return this;
  }
  CreateVendorVariablesBuilder tier(VendorTier? t) {
   _tier.value = t;
   return this;
  }

  CreateVendorVariablesBuilder(this._dataConnect, {required  this.userId,required  this.companyName,});
  Deserializer<CreateVendorData> dataDeserializer = (dynamic json)  => CreateVendorData.fromJson(jsonDecode(json));
  Serializer<CreateVendorVariables> varsSerializer = (CreateVendorVariables vars) => jsonEncode(vars.toJson());
  Future<OperationResult<CreateVendorData, CreateVendorVariables>> execute() {
    return ref().execute();
  }

  MutationRef<CreateVendorData, CreateVendorVariables> ref() {
    CreateVendorVariables vars= CreateVendorVariables(userId: userId,companyName: companyName,email: _email,phone: _phone,photoUrl: _photoUrl,address: _address,billingAddress: _billingAddress,timezone: _timezone,legalName: _legalName,doingBusinessAs: _doingBusinessAs,region: _region,state: _state,city: _city,serviceSpecialty: _serviceSpecialty,approvalStatus: _approvalStatus,isActive: _isActive,markup: _markup,fee: _fee,csat: _csat,tier: _tier,);
    return _dataConnect.mutation("createVendor", dataDeserializer, varsSerializer, vars);
  }
}

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

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

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

    final CreateVendorData otherTyped = other as CreateVendorData;
    return vendor_insert == otherTyped.vendor_insert;
    
  }
  @override
  int get hashCode => vendor_insert.hashCode;
  

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

  CreateVendorData({
    required this.vendor_insert,
  });
}

@immutable
class CreateVendorVariables {
  final String userId;
  final String companyName;
  late final Optional<String>email;
  late final Optional<String>phone;
  late final Optional<String>photoUrl;
  late final Optional<String>address;
  late final Optional<String>billingAddress;
  late final Optional<String>timezone;
  late final Optional<String>legalName;
  late final Optional<String>doingBusinessAs;
  late final Optional<String>region;
  late final Optional<String>state;
  late final Optional<String>city;
  late final Optional<String>serviceSpecialty;
  late final Optional<ApprovalStatus>approvalStatus;
  late final Optional<bool>isActive;
  late final Optional<double>markup;
  late final Optional<double>fee;
  late final Optional<double>csat;
  late final Optional<VendorTier>tier;
  @Deprecated('fromJson is deprecated for Variable classes as they are no longer required for deserialization.')
  CreateVendorVariables.fromJson(Map<String, dynamic> json):
  
  userId = nativeFromJson<String>(json['userId']),
  companyName = nativeFromJson<String>(json['companyName']) {
  
  
  
  
    email = Optional.optional(nativeFromJson, nativeToJson);
    email.value = json['email'] == null ? null : nativeFromJson<String>(json['email']);
  
  
    phone = Optional.optional(nativeFromJson, nativeToJson);
    phone.value = json['phone'] == null ? null : nativeFromJson<String>(json['phone']);
  
  
    photoUrl = Optional.optional(nativeFromJson, nativeToJson);
    photoUrl.value = json['photoUrl'] == null ? null : nativeFromJson<String>(json['photoUrl']);
  
  
    address = Optional.optional(nativeFromJson, nativeToJson);
    address.value = json['address'] == null ? null : nativeFromJson<String>(json['address']);
  
  
    billingAddress = Optional.optional(nativeFromJson, nativeToJson);
    billingAddress.value = json['billingAddress'] == null ? null : nativeFromJson<String>(json['billingAddress']);
  
  
    timezone = Optional.optional(nativeFromJson, nativeToJson);
    timezone.value = json['timezone'] == null ? null : nativeFromJson<String>(json['timezone']);
  
  
    legalName = Optional.optional(nativeFromJson, nativeToJson);
    legalName.value = json['legalName'] == null ? null : nativeFromJson<String>(json['legalName']);
  
  
    doingBusinessAs = Optional.optional(nativeFromJson, nativeToJson);
    doingBusinessAs.value = json['doingBusinessAs'] == null ? null : nativeFromJson<String>(json['doingBusinessAs']);
  
  
    region = Optional.optional(nativeFromJson, nativeToJson);
    region.value = json['region'] == null ? null : nativeFromJson<String>(json['region']);
  
  
    state = Optional.optional(nativeFromJson, nativeToJson);
    state.value = json['state'] == null ? null : nativeFromJson<String>(json['state']);
  
  
    city = Optional.optional(nativeFromJson, nativeToJson);
    city.value = json['city'] == null ? null : nativeFromJson<String>(json['city']);
  
  
    serviceSpecialty = Optional.optional(nativeFromJson, nativeToJson);
    serviceSpecialty.value = json['serviceSpecialty'] == null ? null : nativeFromJson<String>(json['serviceSpecialty']);
  
  
    approvalStatus = Optional.optional((data) => ApprovalStatus.values.byName(data), enumSerializer);
    approvalStatus.value = json['approvalStatus'] == null ? null : ApprovalStatus.values.byName(json['approvalStatus']);
  
  
    isActive = Optional.optional(nativeFromJson, nativeToJson);
    isActive.value = json['isActive'] == null ? null : nativeFromJson<bool>(json['isActive']);
  
  
    markup = Optional.optional(nativeFromJson, nativeToJson);
    markup.value = json['markup'] == null ? null : nativeFromJson<double>(json['markup']);
  
  
    fee = Optional.optional(nativeFromJson, nativeToJson);
    fee.value = json['fee'] == null ? null : nativeFromJson<double>(json['fee']);
  
  
    csat = Optional.optional(nativeFromJson, nativeToJson);
    csat.value = json['csat'] == null ? null : nativeFromJson<double>(json['csat']);
  
  
    tier = Optional.optional((data) => VendorTier.values.byName(data), enumSerializer);
    tier.value = json['tier'] == null ? null : VendorTier.values.byName(json['tier']);
  
  }
  @override
  bool operator ==(Object other) {
    if(identical(this, other)) {
      return true;
    }
    if(other.runtimeType != runtimeType) {
      return false;
    }

    final CreateVendorVariables otherTyped = other as CreateVendorVariables;
    return userId == otherTyped.userId && 
    companyName == otherTyped.companyName && 
    email == otherTyped.email && 
    phone == otherTyped.phone && 
    photoUrl == otherTyped.photoUrl && 
    address == otherTyped.address && 
    billingAddress == otherTyped.billingAddress && 
    timezone == otherTyped.timezone && 
    legalName == otherTyped.legalName && 
    doingBusinessAs == otherTyped.doingBusinessAs && 
    region == otherTyped.region && 
    state == otherTyped.state && 
    city == otherTyped.city && 
    serviceSpecialty == otherTyped.serviceSpecialty && 
    approvalStatus == otherTyped.approvalStatus && 
    isActive == otherTyped.isActive && 
    markup == otherTyped.markup && 
    fee == otherTyped.fee && 
    csat == otherTyped.csat && 
    tier == otherTyped.tier;
    
  }
  @override
  int get hashCode => Object.hashAll([userId.hashCode, companyName.hashCode, email.hashCode, phone.hashCode, photoUrl.hashCode, address.hashCode, billingAddress.hashCode, timezone.hashCode, legalName.hashCode, doingBusinessAs.hashCode, region.hashCode, state.hashCode, city.hashCode, serviceSpecialty.hashCode, approvalStatus.hashCode, isActive.hashCode, markup.hashCode, fee.hashCode, csat.hashCode, tier.hashCode]);
  

  Map<String, dynamic> toJson() {
    Map<String, dynamic> json = {};
    json['userId'] = nativeToJson<String>(userId);
    json['companyName'] = nativeToJson<String>(companyName);
    if(email.state == OptionalState.set) {
      json['email'] = email.toJson();
    }
    if(phone.state == OptionalState.set) {
      json['phone'] = phone.toJson();
    }
    if(photoUrl.state == OptionalState.set) {
      json['photoUrl'] = photoUrl.toJson();
    }
    if(address.state == OptionalState.set) {
      json['address'] = address.toJson();
    }
    if(billingAddress.state == OptionalState.set) {
      json['billingAddress'] = billingAddress.toJson();
    }
    if(timezone.state == OptionalState.set) {
      json['timezone'] = timezone.toJson();
    }
    if(legalName.state == OptionalState.set) {
      json['legalName'] = legalName.toJson();
    }
    if(doingBusinessAs.state == OptionalState.set) {
      json['doingBusinessAs'] = doingBusinessAs.toJson();
    }
    if(region.state == OptionalState.set) {
      json['region'] = region.toJson();
    }
    if(state.state == OptionalState.set) {
      json['state'] = state.toJson();
    }
    if(city.state == OptionalState.set) {
      json['city'] = city.toJson();
    }
    if(serviceSpecialty.state == OptionalState.set) {
      json['serviceSpecialty'] = serviceSpecialty.toJson();
    }
    if(approvalStatus.state == OptionalState.set) {
      json['approvalStatus'] = approvalStatus.toJson();
    }
    if(isActive.state == OptionalState.set) {
      json['isActive'] = isActive.toJson();
    }
    if(markup.state == OptionalState.set) {
      json['markup'] = markup.toJson();
    }
    if(fee.state == OptionalState.set) {
      json['fee'] = fee.toJson();
    }
    if(csat.state == OptionalState.set) {
      json['csat'] = csat.toJson();
    }
    if(tier.state == OptionalState.set) {
      json['tier'] = tier.toJson();
    }
    return json;
  }

  CreateVendorVariables({
    required this.userId,
    required this.companyName,
    required this.email,
    required this.phone,
    required this.photoUrl,
    required this.address,
    required this.billingAddress,
    required this.timezone,
    required this.legalName,
    required this.doingBusinessAs,
    required this.region,
    required this.state,
    required this.city,
    required this.serviceSpecialty,
    required this.approvalStatus,
    required this.isActive,
    required this.markup,
    required this.fee,
    required this.csat,
    required this.tier,
  });
}

