part of 'generated.dart';

class UpdateVendorRateVariablesBuilder {
  String id;
  Optional<String> _vendorId = Optional.optional(nativeFromJson, nativeToJson);
  Optional<String> _roleName = Optional.optional(nativeFromJson, nativeToJson);
  Optional<CategoryType> _category = Optional.optional((data) => CategoryType.values.byName(data), enumSerializer);
  Optional<double> _clientRate = Optional.optional(nativeFromJson, nativeToJson);
  Optional<double> _employeeWage = Optional.optional(nativeFromJson, nativeToJson);
  Optional<double> _markupPercentage = Optional.optional(nativeFromJson, nativeToJson);
  Optional<double> _vendorFeePercentage = Optional.optional(nativeFromJson, nativeToJson);
  Optional<bool> _isActive = Optional.optional(nativeFromJson, nativeToJson);
  Optional<String> _notes = Optional.optional(nativeFromJson, nativeToJson);

  final FirebaseDataConnect _dataConnect;  UpdateVendorRateVariablesBuilder vendorId(String? t) {
   _vendorId.value = t;
   return this;
  }
  UpdateVendorRateVariablesBuilder roleName(String? t) {
   _roleName.value = t;
   return this;
  }
  UpdateVendorRateVariablesBuilder category(CategoryType? t) {
   _category.value = t;
   return this;
  }
  UpdateVendorRateVariablesBuilder clientRate(double? t) {
   _clientRate.value = t;
   return this;
  }
  UpdateVendorRateVariablesBuilder employeeWage(double? t) {
   _employeeWage.value = t;
   return this;
  }
  UpdateVendorRateVariablesBuilder markupPercentage(double? t) {
   _markupPercentage.value = t;
   return this;
  }
  UpdateVendorRateVariablesBuilder vendorFeePercentage(double? t) {
   _vendorFeePercentage.value = t;
   return this;
  }
  UpdateVendorRateVariablesBuilder isActive(bool? t) {
   _isActive.value = t;
   return this;
  }
  UpdateVendorRateVariablesBuilder notes(String? t) {
   _notes.value = t;
   return this;
  }

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

  MutationRef<UpdateVendorRateData, UpdateVendorRateVariables> ref() {
    UpdateVendorRateVariables vars= UpdateVendorRateVariables(id: id,vendorId: _vendorId,roleName: _roleName,category: _category,clientRate: _clientRate,employeeWage: _employeeWage,markupPercentage: _markupPercentage,vendorFeePercentage: _vendorFeePercentage,isActive: _isActive,notes: _notes,);
    return _dataConnect.mutation("updateVendorRate", dataDeserializer, varsSerializer, vars);
  }
}

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

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

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

    final UpdateVendorRateData otherTyped = other as UpdateVendorRateData;
    return vendorRate_update == otherTyped.vendorRate_update;
    
  }
  @override
  int get hashCode => vendorRate_update.hashCode;
  

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

  UpdateVendorRateData({
    this.vendorRate_update,
  });
}

@immutable
class UpdateVendorRateVariables {
  final String id;
  late final Optional<String>vendorId;
  late final Optional<String>roleName;
  late final Optional<CategoryType>category;
  late final Optional<double>clientRate;
  late final Optional<double>employeeWage;
  late final Optional<double>markupPercentage;
  late final Optional<double>vendorFeePercentage;
  late final Optional<bool>isActive;
  late final Optional<String>notes;
  @Deprecated('fromJson is deprecated for Variable classes as they are no longer required for deserialization.')
  UpdateVendorRateVariables.fromJson(Map<String, dynamic> json):
  
  id = nativeFromJson<String>(json['id']) {
  
  
  
    vendorId = Optional.optional(nativeFromJson, nativeToJson);
    vendorId.value = json['vendorId'] == null ? null : nativeFromJson<String>(json['vendorId']);
  
  
    roleName = Optional.optional(nativeFromJson, nativeToJson);
    roleName.value = json['roleName'] == null ? null : nativeFromJson<String>(json['roleName']);
  
  
    category = Optional.optional((data) => CategoryType.values.byName(data), enumSerializer);
    category.value = json['category'] == null ? null : CategoryType.values.byName(json['category']);
  
  
    clientRate = Optional.optional(nativeFromJson, nativeToJson);
    clientRate.value = json['clientRate'] == null ? null : nativeFromJson<double>(json['clientRate']);
  
  
    employeeWage = Optional.optional(nativeFromJson, nativeToJson);
    employeeWage.value = json['employeeWage'] == null ? null : nativeFromJson<double>(json['employeeWage']);
  
  
    markupPercentage = Optional.optional(nativeFromJson, nativeToJson);
    markupPercentage.value = json['markupPercentage'] == null ? null : nativeFromJson<double>(json['markupPercentage']);
  
  
    vendorFeePercentage = Optional.optional(nativeFromJson, nativeToJson);
    vendorFeePercentage.value = json['vendorFeePercentage'] == null ? null : nativeFromJson<double>(json['vendorFeePercentage']);
  
  
    isActive = Optional.optional(nativeFromJson, nativeToJson);
    isActive.value = json['isActive'] == null ? null : nativeFromJson<bool>(json['isActive']);
  
  
    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 UpdateVendorRateVariables otherTyped = other as UpdateVendorRateVariables;
    return id == otherTyped.id && 
    vendorId == otherTyped.vendorId && 
    roleName == otherTyped.roleName && 
    category == otherTyped.category && 
    clientRate == otherTyped.clientRate && 
    employeeWage == otherTyped.employeeWage && 
    markupPercentage == otherTyped.markupPercentage && 
    vendorFeePercentage == otherTyped.vendorFeePercentage && 
    isActive == otherTyped.isActive && 
    notes == otherTyped.notes;
    
  }
  @override
  int get hashCode => Object.hashAll([id.hashCode, vendorId.hashCode, roleName.hashCode, category.hashCode, clientRate.hashCode, employeeWage.hashCode, markupPercentage.hashCode, vendorFeePercentage.hashCode, isActive.hashCode, notes.hashCode]);
  

  Map<String, dynamic> toJson() {
    Map<String, dynamic> json = {};
    json['id'] = nativeToJson<String>(id);
    if(vendorId.state == OptionalState.set) {
      json['vendorId'] = vendorId.toJson();
    }
    if(roleName.state == OptionalState.set) {
      json['roleName'] = roleName.toJson();
    }
    if(category.state == OptionalState.set) {
      json['category'] = category.toJson();
    }
    if(clientRate.state == OptionalState.set) {
      json['clientRate'] = clientRate.toJson();
    }
    if(employeeWage.state == OptionalState.set) {
      json['employeeWage'] = employeeWage.toJson();
    }
    if(markupPercentage.state == OptionalState.set) {
      json['markupPercentage'] = markupPercentage.toJson();
    }
    if(vendorFeePercentage.state == OptionalState.set) {
      json['vendorFeePercentage'] = vendorFeePercentage.toJson();
    }
    if(isActive.state == OptionalState.set) {
      json['isActive'] = isActive.toJson();
    }
    if(notes.state == OptionalState.set) {
      json['notes'] = notes.toJson();
    }
    return json;
  }

  UpdateVendorRateVariables({
    required this.id,
    required this.vendorId,
    required this.roleName,
    required this.category,
    required this.clientRate,
    required this.employeeWage,
    required this.markupPercentage,
    required this.vendorFeePercentage,
    required this.isActive,
    required this.notes,
  });
}

