part of 'generated.dart';

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

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

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

  QueryRef<ListClientFeedbacksData, ListClientFeedbacksVariables> ref() {
    ListClientFeedbacksVariables vars= ListClientFeedbacksVariables(offset: _offset,limit: _limit,);
    return _dataConnect.query("listClientFeedbacks", dataDeserializer, varsSerializer, vars);
  }
}

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

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

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

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

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

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

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

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

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

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

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

  ListClientFeedbacksVariables({
    required this.offset,
    required this.limit,
  });
}

