part of 'generated.dart';

class ListClientFeedbackRatingsByVendorIdVariablesBuilder {
  String vendorId;
  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);

  final FirebaseDataConnect _dataConnect;  ListClientFeedbackRatingsByVendorIdVariablesBuilder dateFrom(Timestamp? t) {
   _dateFrom.value = t;
   return this;
  }
  ListClientFeedbackRatingsByVendorIdVariablesBuilder dateTo(Timestamp? t) {
   _dateTo.value = t;
   return this;
  }

  ListClientFeedbackRatingsByVendorIdVariablesBuilder(this._dataConnect, {required  this.vendorId,});
  Deserializer<ListClientFeedbackRatingsByVendorIdData> dataDeserializer = (dynamic json)  => ListClientFeedbackRatingsByVendorIdData.fromJson(jsonDecode(json));
  Serializer<ListClientFeedbackRatingsByVendorIdVariables> varsSerializer = (ListClientFeedbackRatingsByVendorIdVariables vars) => jsonEncode(vars.toJson());
  Future<QueryResult<ListClientFeedbackRatingsByVendorIdData, ListClientFeedbackRatingsByVendorIdVariables>> execute() {
    return ref().execute();
  }

  QueryRef<ListClientFeedbackRatingsByVendorIdData, ListClientFeedbackRatingsByVendorIdVariables> ref() {
    ListClientFeedbackRatingsByVendorIdVariables vars= ListClientFeedbackRatingsByVendorIdVariables(vendorId: vendorId,dateFrom: _dateFrom,dateTo: _dateTo,);
    return _dataConnect.query("listClientFeedbackRatingsByVendorId", dataDeserializer, varsSerializer, vars);
  }
}

@immutable
class ListClientFeedbackRatingsByVendorIdClientFeedbacks {
  final String id;
  final int? rating;
  final String? comment;
  final Timestamp? date;
  final ListClientFeedbackRatingsByVendorIdClientFeedbacksBusiness business;
  final ListClientFeedbackRatingsByVendorIdClientFeedbacksVendor vendor;
  ListClientFeedbackRatingsByVendorIdClientFeedbacks.fromJson(dynamic json):
  
  id = nativeFromJson<String>(json['id']),
  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 = ListClientFeedbackRatingsByVendorIdClientFeedbacksBusiness.fromJson(json['business']),
  vendor = ListClientFeedbackRatingsByVendorIdClientFeedbacksVendor.fromJson(json['vendor']);
  @override
  bool operator ==(Object other) {
    if(identical(this, other)) {
      return true;
    }
    if(other.runtimeType != runtimeType) {
      return false;
    }

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

  Map<String, dynamic> toJson() {
    Map<String, dynamic> json = {};
    json['id'] = nativeToJson<String>(id);
    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;
  }

  ListClientFeedbackRatingsByVendorIdClientFeedbacks({
    required this.id,
    this.rating,
    this.comment,
    this.date,
    required this.business,
    required this.vendor,
  });
}

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

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

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

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

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

    final ListClientFeedbackRatingsByVendorIdData otherTyped = other as ListClientFeedbackRatingsByVendorIdData;
    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;
  }

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

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

    final ListClientFeedbackRatingsByVendorIdVariables otherTyped = other as ListClientFeedbackRatingsByVendorIdVariables;
    return vendorId == otherTyped.vendorId && 
    dateFrom == otherTyped.dateFrom && 
    dateTo == otherTyped.dateTo;
    
  }
  @override
  int get hashCode => Object.hashAll([vendorId.hashCode, dateFrom.hashCode, dateTo.hashCode]);
  

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

  ListClientFeedbackRatingsByVendorIdVariables({
    required this.vendorId,
    required this.dateFrom,
    required this.dateTo,
  });
}

