part of 'generated.dart';

class UpdateClientFeedbackVariablesBuilder {
  String id;
  Optional<String> _businessId = Optional.optional(nativeFromJson, nativeToJson);
  Optional<String> _vendorId = Optional.optional(nativeFromJson, nativeToJson);
  Optional<int> _rating = Optional.optional(nativeFromJson, nativeToJson);
  Optional<String> _comment = Optional.optional(nativeFromJson, nativeToJson);
  Optional<Timestamp> _date = Optional.optional((json) => json['date'] = Timestamp.fromJson(json['date']), defaultSerializer);
  Optional<String> _createdBy = Optional.optional(nativeFromJson, nativeToJson);

  final FirebaseDataConnect _dataConnect;  UpdateClientFeedbackVariablesBuilder businessId(String? t) {
   _businessId.value = t;
   return this;
  }
  UpdateClientFeedbackVariablesBuilder vendorId(String? t) {
   _vendorId.value = t;
   return this;
  }
  UpdateClientFeedbackVariablesBuilder rating(int? t) {
   _rating.value = t;
   return this;
  }
  UpdateClientFeedbackVariablesBuilder comment(String? t) {
   _comment.value = t;
   return this;
  }
  UpdateClientFeedbackVariablesBuilder date(Timestamp? t) {
   _date.value = t;
   return this;
  }
  UpdateClientFeedbackVariablesBuilder createdBy(String? t) {
   _createdBy.value = t;
   return this;
  }

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

  MutationRef<UpdateClientFeedbackData, UpdateClientFeedbackVariables> ref() {
    UpdateClientFeedbackVariables vars= UpdateClientFeedbackVariables(id: id,businessId: _businessId,vendorId: _vendorId,rating: _rating,comment: _comment,date: _date,createdBy: _createdBy,);
    return _dataConnect.mutation("updateClientFeedback", dataDeserializer, varsSerializer, vars);
  }
}

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

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

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

    final UpdateClientFeedbackData otherTyped = other as UpdateClientFeedbackData;
    return clientFeedback_update == otherTyped.clientFeedback_update;
    
  }
  @override
  int get hashCode => clientFeedback_update.hashCode;
  

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

  UpdateClientFeedbackData({
    this.clientFeedback_update,
  });
}

@immutable
class UpdateClientFeedbackVariables {
  final String id;
  late final Optional<String>businessId;
  late final Optional<String>vendorId;
  late final Optional<int>rating;
  late final Optional<String>comment;
  late final Optional<Timestamp>date;
  late final Optional<String>createdBy;
  @Deprecated('fromJson is deprecated for Variable classes as they are no longer required for deserialization.')
  UpdateClientFeedbackVariables.fromJson(Map<String, dynamic> json):
  
  id = nativeFromJson<String>(json['id']) {
  
  
  
    businessId = Optional.optional(nativeFromJson, nativeToJson);
    businessId.value = json['businessId'] == null ? null : nativeFromJson<String>(json['businessId']);
  
  
    vendorId = Optional.optional(nativeFromJson, nativeToJson);
    vendorId.value = json['vendorId'] == null ? null : nativeFromJson<String>(json['vendorId']);
  
  
    rating = Optional.optional(nativeFromJson, nativeToJson);
    rating.value = json['rating'] == null ? null : nativeFromJson<int>(json['rating']);
  
  
    comment = Optional.optional(nativeFromJson, nativeToJson);
    comment.value = json['comment'] == null ? null : nativeFromJson<String>(json['comment']);
  
  
    date = Optional.optional((json) => json['date'] = Timestamp.fromJson(json['date']), defaultSerializer);
    date.value = json['date'] == null ? null : Timestamp.fromJson(json['date']);
  
  
    createdBy = Optional.optional(nativeFromJson, nativeToJson);
    createdBy.value = json['createdBy'] == null ? null : nativeFromJson<String>(json['createdBy']);
  
  }
  @override
  bool operator ==(Object other) {
    if(identical(this, other)) {
      return true;
    }
    if(other.runtimeType != runtimeType) {
      return false;
    }

    final UpdateClientFeedbackVariables otherTyped = other as UpdateClientFeedbackVariables;
    return id == otherTyped.id && 
    businessId == otherTyped.businessId && 
    vendorId == otherTyped.vendorId && 
    rating == otherTyped.rating && 
    comment == otherTyped.comment && 
    date == otherTyped.date && 
    createdBy == otherTyped.createdBy;
    
  }
  @override
  int get hashCode => Object.hashAll([id.hashCode, businessId.hashCode, vendorId.hashCode, rating.hashCode, comment.hashCode, date.hashCode, createdBy.hashCode]);
  

  Map<String, dynamic> toJson() {
    Map<String, dynamic> json = {};
    json['id'] = nativeToJson<String>(id);
    if(businessId.state == OptionalState.set) {
      json['businessId'] = businessId.toJson();
    }
    if(vendorId.state == OptionalState.set) {
      json['vendorId'] = vendorId.toJson();
    }
    if(rating.state == OptionalState.set) {
      json['rating'] = rating.toJson();
    }
    if(comment.state == OptionalState.set) {
      json['comment'] = comment.toJson();
    }
    if(date.state == OptionalState.set) {
      json['date'] = date.toJson();
    }
    if(createdBy.state == OptionalState.set) {
      json['createdBy'] = createdBy.toJson();
    }
    return json;
  }

  UpdateClientFeedbackVariables({
    required this.id,
    required this.businessId,
    required this.vendorId,
    required this.rating,
    required this.comment,
    required this.date,
    required this.createdBy,
  });
}

