part of 'generated.dart';

class FilterClientFeedbacksVariablesBuilder {
  Optional<String> _businessId = Optional.optional(nativeFromJson, nativeToJson);
  Optional<String> _vendorId = Optional.optional(nativeFromJson, nativeToJson);
  Optional<int> _ratingMin = Optional.optional(nativeFromJson, nativeToJson);
  Optional<int> _ratingMax = Optional.optional(nativeFromJson, nativeToJson);
  Optional<Timestamp> _dateFrom = Optional.optional((json) => json['dateFrom'] = Timestamp.fromJson(json['dateFrom']), defaultSerializer);
  Optional<Timestamp> _dateTo = Optional.optional((json) => json['dateTo'] = Timestamp.fromJson(json['dateTo']), defaultSerializer);
  Optional<int> _offset = Optional.optional(nativeFromJson, nativeToJson);
  Optional<int> _limit = Optional.optional(nativeFromJson, nativeToJson);

  final FirebaseDataConnect _dataConnect;
  FilterClientFeedbacksVariablesBuilder businessId(String? t) {
   _businessId.value = t;
   return this;
  }
  FilterClientFeedbacksVariablesBuilder vendorId(String? t) {
   _vendorId.value = t;
   return this;
  }
  FilterClientFeedbacksVariablesBuilder ratingMin(int? t) {
   _ratingMin.value = t;
   return this;
  }
  FilterClientFeedbacksVariablesBuilder ratingMax(int? t) {
   _ratingMax.value = t;
   return this;
  }
  FilterClientFeedbacksVariablesBuilder dateFrom(Timestamp? t) {
   _dateFrom.value = t;
   return this;
  }
  FilterClientFeedbacksVariablesBuilder dateTo(Timestamp? t) {
   _dateTo.value = t;
   return this;
  }
  FilterClientFeedbacksVariablesBuilder offset(int? t) {
   _offset.value = t;
   return this;
  }
  FilterClientFeedbacksVariablesBuilder limit(int? t) {
   _limit.value = t;
   return this;
  }

  FilterClientFeedbacksVariablesBuilder(this._dataConnect, );
  Deserializer<FilterClientFeedbacksData> dataDeserializer = (dynamic json)  => FilterClientFeedbacksData.fromJson(jsonDecode(json));
  Serializer<FilterClientFeedbacksVariables> varsSerializer = (FilterClientFeedbacksVariables vars) => jsonEncode(vars.toJson());
  Future<QueryResult<FilterClientFeedbacksData, FilterClientFeedbacksVariables>> execute() {
    return ref().execute();
  }

  QueryRef<FilterClientFeedbacksData, FilterClientFeedbacksVariables> ref() {
    FilterClientFeedbacksVariables vars= FilterClientFeedbacksVariables(businessId: _businessId,vendorId: _vendorId,ratingMin: _ratingMin,ratingMax: _ratingMax,dateFrom: _dateFrom,dateTo: _dateTo,offset: _offset,limit: _limit,);
    return _dataConnect.query("filterClientFeedbacks", dataDeserializer, varsSerializer, vars);
  }
}

@immutable
class FilterClientFeedbacksClientFeedbacks {
  final String id;
  final String businessId;
  final String vendorId;
  final int? rating;
  final String? comment;
  final Timestamp? date;
  final FilterClientFeedbacksClientFeedbacksBusiness business;
  final FilterClientFeedbacksClientFeedbacksVendor vendor;
  FilterClientFeedbacksClientFeedbacks.fromJson(dynamic json):
  
  id = nativeFromJson<String>(json['id']),
  businessId = nativeFromJson<String>(json['businessId']),
  vendorId = nativeFromJson<String>(json['vendorId']),
  rating = json['rating'] == null ? null : nativeFromJson<int>(json['rating']),
  comment = json['comment'] == null ? null : nativeFromJson<String>(json['comment']),
  date = json['date'] == null ? null : Timestamp.fromJson(json['date']),
  business = FilterClientFeedbacksClientFeedbacksBusiness.fromJson(json['business']),
  vendor = FilterClientFeedbacksClientFeedbacksVendor.fromJson(json['vendor']);
  @override
  bool operator ==(Object other) {
    if(identical(this, other)) {
      return true;
    }
    if(other.runtimeType != runtimeType) {
      return false;
    }

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

  Map<String, dynamic> toJson() {
    Map<String, dynamic> json = {};
    json['id'] = nativeToJson<String>(id);
    json['businessId'] = nativeToJson<String>(businessId);
    json['vendorId'] = nativeToJson<String>(vendorId);
    if (rating != null) {
      json['rating'] = nativeToJson<int?>(rating);
    }
    if (comment != null) {
      json['comment'] = nativeToJson<String?>(comment);
    }
    if (date != null) {
      json['date'] = date!.toJson();
    }
    json['business'] = business.toJson();
    json['vendor'] = vendor.toJson();
    return json;
  }

  FilterClientFeedbacksClientFeedbacks({
    required this.id,
    required this.businessId,
    required this.vendorId,
    this.rating,
    this.comment,
    this.date,
    required this.business,
    required this.vendor,
  });
}

@immutable
class FilterClientFeedbacksClientFeedbacksBusiness {
  final String id;
  final String businessName;
  FilterClientFeedbacksClientFeedbacksBusiness.fromJson(dynamic json):
  
  id = nativeFromJson<String>(json['id']),
  businessName = nativeFromJson<String>(json['businessName']);
  @override
  bool operator ==(Object other) {
    if(identical(this, other)) {
      return true;
    }
    if(other.runtimeType != runtimeType) {
      return false;
    }

    final FilterClientFeedbacksClientFeedbacksBusiness otherTyped = other as FilterClientFeedbacksClientFeedbacksBusiness;
    return id == otherTyped.id && 
    businessName == otherTyped.businessName;
    
  }
  @override
  int get hashCode => Object.hashAll([id.hashCode, businessName.hashCode]);
  

  Map<String, dynamic> toJson() {
    Map<String, dynamic> json = {};
    json['id'] = nativeToJson<String>(id);
    json['businessName'] = nativeToJson<String>(businessName);
    return json;
  }

  FilterClientFeedbacksClientFeedbacksBusiness({
    required this.id,
    required this.businessName,
  });
}

@immutable
class FilterClientFeedbacksClientFeedbacksVendor {
  final String id;
  final String companyName;
  FilterClientFeedbacksClientFeedbacksVendor.fromJson(dynamic json):
  
  id = nativeFromJson<String>(json['id']),
  companyName = nativeFromJson<String>(json['companyName']);
  @override
  bool operator ==(Object other) {
    if(identical(this, other)) {
      return true;
    }
    if(other.runtimeType != runtimeType) {
      return false;
    }

    final FilterClientFeedbacksClientFeedbacksVendor otherTyped = other as FilterClientFeedbacksClientFeedbacksVendor;
    return id == otherTyped.id && 
    companyName == otherTyped.companyName;
    
  }
  @override
  int get hashCode => Object.hashAll([id.hashCode, companyName.hashCode]);
  

  Map<String, dynamic> toJson() {
    Map<String, dynamic> json = {};
    json['id'] = nativeToJson<String>(id);
    json['companyName'] = nativeToJson<String>(companyName);
    return json;
  }

  FilterClientFeedbacksClientFeedbacksVendor({
    required this.id,
    required this.companyName,
  });
}

@immutable
class FilterClientFeedbacksData {
  final List<FilterClientFeedbacksClientFeedbacks> clientFeedbacks;
  FilterClientFeedbacksData.fromJson(dynamic json):
  
  clientFeedbacks = (json['clientFeedbacks'] as List<dynamic>)
        .map((e) => FilterClientFeedbacksClientFeedbacks.fromJson(e))
        .toList();
  @override
  bool operator ==(Object other) {
    if(identical(this, other)) {
      return true;
    }
    if(other.runtimeType != runtimeType) {
      return false;
    }

    final FilterClientFeedbacksData otherTyped = other as FilterClientFeedbacksData;
    return clientFeedbacks == otherTyped.clientFeedbacks;
    
  }
  @override
  int get hashCode => clientFeedbacks.hashCode;
  

  Map<String, dynamic> toJson() {
    Map<String, dynamic> json = {};
    json['clientFeedbacks'] = clientFeedbacks.map((e) => e.toJson()).toList();
    return json;
  }

  FilterClientFeedbacksData({
    required this.clientFeedbacks,
  });
}

@immutable
class FilterClientFeedbacksVariables {
  late final Optional<String>businessId;
  late final Optional<String>vendorId;
  late final Optional<int>ratingMin;
  late final Optional<int>ratingMax;
  late final Optional<Timestamp>dateFrom;
  late final Optional<Timestamp>dateTo;
  late final Optional<int>offset;
  late final Optional<int>limit;
  @Deprecated('fromJson is deprecated for Variable classes as they are no longer required for deserialization.')
  FilterClientFeedbacksVariables.fromJson(Map<String, dynamic> json) {
  
  
    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']);
  
  
    ratingMin = Optional.optional(nativeFromJson, nativeToJson);
    ratingMin.value = json['ratingMin'] == null ? null : nativeFromJson<int>(json['ratingMin']);
  
  
    ratingMax = Optional.optional(nativeFromJson, nativeToJson);
    ratingMax.value = json['ratingMax'] == null ? null : nativeFromJson<int>(json['ratingMax']);
  
  
    dateFrom = Optional.optional((json) => json['dateFrom'] = Timestamp.fromJson(json['dateFrom']), defaultSerializer);
    dateFrom.value = json['dateFrom'] == null ? null : Timestamp.fromJson(json['dateFrom']);
  
  
    dateTo = Optional.optional((json) => json['dateTo'] = Timestamp.fromJson(json['dateTo']), defaultSerializer);
    dateTo.value = json['dateTo'] == null ? null : Timestamp.fromJson(json['dateTo']);
  
  
    offset = Optional.optional(nativeFromJson, nativeToJson);
    offset.value = json['offset'] == null ? null : nativeFromJson<int>(json['offset']);
  
  
    limit = Optional.optional(nativeFromJson, nativeToJson);
    limit.value = json['limit'] == null ? null : nativeFromJson<int>(json['limit']);
  
  }
  @override
  bool operator ==(Object other) {
    if(identical(this, other)) {
      return true;
    }
    if(other.runtimeType != runtimeType) {
      return false;
    }

    final FilterClientFeedbacksVariables otherTyped = other as FilterClientFeedbacksVariables;
    return businessId == otherTyped.businessId && 
    vendorId == otherTyped.vendorId && 
    ratingMin == otherTyped.ratingMin && 
    ratingMax == otherTyped.ratingMax && 
    dateFrom == otherTyped.dateFrom && 
    dateTo == otherTyped.dateTo && 
    offset == otherTyped.offset && 
    limit == otherTyped.limit;
    
  }
  @override
  int get hashCode => Object.hashAll([businessId.hashCode, vendorId.hashCode, ratingMin.hashCode, ratingMax.hashCode, dateFrom.hashCode, dateTo.hashCode, offset.hashCode, limit.hashCode]);
  

  Map<String, dynamic> toJson() {
    Map<String, dynamic> json = {};
    if(businessId.state == OptionalState.set) {
      json['businessId'] = businessId.toJson();
    }
    if(vendorId.state == OptionalState.set) {
      json['vendorId'] = vendorId.toJson();
    }
    if(ratingMin.state == OptionalState.set) {
      json['ratingMin'] = ratingMin.toJson();
    }
    if(ratingMax.state == OptionalState.set) {
      json['ratingMax'] = ratingMax.toJson();
    }
    if(dateFrom.state == OptionalState.set) {
      json['dateFrom'] = dateFrom.toJson();
    }
    if(dateTo.state == OptionalState.set) {
      json['dateTo'] = dateTo.toJson();
    }
    if(offset.state == OptionalState.set) {
      json['offset'] = offset.toJson();
    }
    if(limit.state == OptionalState.set) {
      json['limit'] = limit.toJson();
    }
    return json;
  }

  FilterClientFeedbacksVariables({
    required this.businessId,
    required this.vendorId,
    required this.ratingMin,
    required this.ratingMax,
    required this.dateFrom,
    required this.dateTo,
    required this.offset,
    required this.limit,
  });
}

