part of 'generated.dart';

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

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

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

  QueryRef<ListClientFeedbacksByVendorIdData, ListClientFeedbacksByVendorIdVariables> ref() {
    ListClientFeedbacksByVendorIdVariables vars= ListClientFeedbacksByVendorIdVariables(vendorId: vendorId,offset: _offset,limit: _limit,);
    return _dataConnect.query("listClientFeedbacksByVendorId", dataDeserializer, varsSerializer, vars);
  }
}

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

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

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

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

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

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

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

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

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

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

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

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

