part of 'generated.dart';

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

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

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

  QueryRef<ListClientFeedbacksByBusinessIdData, ListClientFeedbacksByBusinessIdVariables> ref() {
    ListClientFeedbacksByBusinessIdVariables vars= ListClientFeedbacksByBusinessIdVariables(businessId: businessId,offset: _offset,limit: _limit,);
    return _dataConnect.query("listClientFeedbacksByBusinessId", dataDeserializer, varsSerializer, vars);
  }
}

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

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

  ListClientFeedbacksByBusinessIdClientFeedbacks({
    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 ListClientFeedbacksByBusinessIdClientFeedbacksBusiness {
  final String id;
  final String businessName;
  ListClientFeedbacksByBusinessIdClientFeedbacksBusiness.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 ListClientFeedbacksByBusinessIdClientFeedbacksBusiness otherTyped = other as ListClientFeedbacksByBusinessIdClientFeedbacksBusiness;
    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;
  }

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

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

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

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

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

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

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

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

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

