part of 'generated.dart';

class ListClientFeedbacksByBusinessAndVendorVariablesBuilder {
  String businessId;
  String vendorId;
  Optional<int> _offset = Optional.optional(nativeFromJson, nativeToJson);
  Optional<int> _limit = Optional.optional(nativeFromJson, nativeToJson);

  final FirebaseDataConnect _dataConnect;  ListClientFeedbacksByBusinessAndVendorVariablesBuilder offset(int? t) {
   _offset.value = t;
   return this;
  }
  ListClientFeedbacksByBusinessAndVendorVariablesBuilder limit(int? t) {
   _limit.value = t;
   return this;
  }

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

  QueryRef<ListClientFeedbacksByBusinessAndVendorData, ListClientFeedbacksByBusinessAndVendorVariables> ref() {
    ListClientFeedbacksByBusinessAndVendorVariables vars= ListClientFeedbacksByBusinessAndVendorVariables(businessId: businessId,vendorId: vendorId,offset: _offset,limit: _limit,);
    return _dataConnect.query("listClientFeedbacksByBusinessAndVendor", dataDeserializer, varsSerializer, vars);
  }
}

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

    final ListClientFeedbacksByBusinessAndVendorClientFeedbacks otherTyped = other as ListClientFeedbacksByBusinessAndVendorClientFeedbacks;
    return id == otherTyped.id && 
    businessId == otherTyped.businessId && 
    vendorId == otherTyped.vendorId && 
    rating == otherTyped.rating && 
    comment == otherTyped.comment && 
    date == otherTyped.date && 
    createdAt == otherTyped.createdAt && 
    business == otherTyped.business && 
    vendor == otherTyped.vendor;
    
  }
  @override
  int get hashCode => Object.hashAll([id.hashCode, businessId.hashCode, vendorId.hashCode, rating.hashCode, comment.hashCode, date.hashCode, createdAt.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();
    }
    if (createdAt != null) {
      json['createdAt'] = createdAt!.toJson();
    }
    json['business'] = business.toJson();
    json['vendor'] = vendor.toJson();
    return json;
  }

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

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

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

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

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

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

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

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

@immutable
class ListClientFeedbacksByBusinessAndVendorVariables {
  final String businessId;
  final String vendorId;
  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.')
  ListClientFeedbacksByBusinessAndVendorVariables.fromJson(Map<String, dynamic> json):
  
  businessId = nativeFromJson<String>(json['businessId']),
  vendorId = nativeFromJson<String>(json['vendorId']) {
  
  
  
  
    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 ListClientFeedbacksByBusinessAndVendorVariables otherTyped = other as ListClientFeedbacksByBusinessAndVendorVariables;
    return businessId == otherTyped.businessId && 
    vendorId == otherTyped.vendorId && 
    offset == otherTyped.offset && 
    limit == otherTyped.limit;
    
  }
  @override
  int get hashCode => Object.hashAll([businessId.hashCode, vendorId.hashCode, offset.hashCode, limit.hashCode]);
  

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

  ListClientFeedbacksByBusinessAndVendorVariables({
    required this.businessId,
    required this.vendorId,
    required this.offset,
    required this.limit,
  });
}

