part of 'generated.dart';

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

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

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

  QueryRef<ListOrdersByBusinessAndTeamHubData, ListOrdersByBusinessAndTeamHubVariables> ref() {
    ListOrdersByBusinessAndTeamHubVariables vars= ListOrdersByBusinessAndTeamHubVariables(businessId: businessId,teamHubId: teamHubId,offset: _offset,limit: _limit,);
    return _dataConnect.query("listOrdersByBusinessAndTeamHub", dataDeserializer, varsSerializer, vars);
  }
}

@immutable
class ListOrdersByBusinessAndTeamHubOrders {
  final String id;
  final String? eventName;
  final EnumValue<OrderType> orderType;
  final EnumValue<OrderStatus> status;
  final EnumValue<OrderDuration>? duration;
  final String businessId;
  final String? vendorId;
  final String teamHubId;
  final Timestamp? date;
  final Timestamp? startDate;
  final Timestamp? endDate;
  final int? requested;
  final double? total;
  final String? notes;
  final Timestamp? createdAt;
  final Timestamp? updatedAt;
  final String? createdBy;
  ListOrdersByBusinessAndTeamHubOrders.fromJson(dynamic json):
  
  id = nativeFromJson<String>(json['id']),
  eventName = json['eventName'] == null ? null : nativeFromJson<String>(json['eventName']),
  orderType = orderTypeDeserializer(json['orderType']),
  status = orderStatusDeserializer(json['status']),
  duration = json['duration'] == null ? null : orderDurationDeserializer(json['duration']),
  businessId = nativeFromJson<String>(json['businessId']),
  vendorId = json['vendorId'] == null ? null : nativeFromJson<String>(json['vendorId']),
  teamHubId = nativeFromJson<String>(json['teamHubId']),
  date = json['date'] == null ? null : Timestamp.fromJson(json['date']),
  startDate = json['startDate'] == null ? null : Timestamp.fromJson(json['startDate']),
  endDate = json['endDate'] == null ? null : Timestamp.fromJson(json['endDate']),
  requested = json['requested'] == null ? null : nativeFromJson<int>(json['requested']),
  total = json['total'] == null ? null : nativeFromJson<double>(json['total']),
  notes = json['notes'] == null ? null : nativeFromJson<String>(json['notes']),
  createdAt = json['createdAt'] == null ? null : Timestamp.fromJson(json['createdAt']),
  updatedAt = json['updatedAt'] == null ? null : Timestamp.fromJson(json['updatedAt']),
  createdBy = json['createdBy'] == null ? null : nativeFromJson<String>(json['createdBy']);
  @override
  bool operator ==(Object other) {
    if(identical(this, other)) {
      return true;
    }
    if(other.runtimeType != runtimeType) {
      return false;
    }

    final ListOrdersByBusinessAndTeamHubOrders otherTyped = other as ListOrdersByBusinessAndTeamHubOrders;
    return id == otherTyped.id && 
    eventName == otherTyped.eventName && 
    orderType == otherTyped.orderType && 
    status == otherTyped.status && 
    duration == otherTyped.duration && 
    businessId == otherTyped.businessId && 
    vendorId == otherTyped.vendorId && 
    teamHubId == otherTyped.teamHubId && 
    date == otherTyped.date && 
    startDate == otherTyped.startDate && 
    endDate == otherTyped.endDate && 
    requested == otherTyped.requested && 
    total == otherTyped.total && 
    notes == otherTyped.notes && 
    createdAt == otherTyped.createdAt && 
    updatedAt == otherTyped.updatedAt && 
    createdBy == otherTyped.createdBy;
    
  }
  @override
  int get hashCode => Object.hashAll([id.hashCode, eventName.hashCode, orderType.hashCode, status.hashCode, duration.hashCode, businessId.hashCode, vendorId.hashCode, teamHubId.hashCode, date.hashCode, startDate.hashCode, endDate.hashCode, requested.hashCode, total.hashCode, notes.hashCode, createdAt.hashCode, updatedAt.hashCode, createdBy.hashCode]);
  

  Map<String, dynamic> toJson() {
    Map<String, dynamic> json = {};
    json['id'] = nativeToJson<String>(id);
    if (eventName != null) {
      json['eventName'] = nativeToJson<String?>(eventName);
    }
    json['orderType'] = 
    orderTypeSerializer(orderType)
    ;
    json['status'] = 
    orderStatusSerializer(status)
    ;
    if (duration != null) {
      json['duration'] = 
    orderDurationSerializer(duration!)
    ;
    }
    json['businessId'] = nativeToJson<String>(businessId);
    if (vendorId != null) {
      json['vendorId'] = nativeToJson<String?>(vendorId);
    }
    json['teamHubId'] = nativeToJson<String>(teamHubId);
    if (date != null) {
      json['date'] = date!.toJson();
    }
    if (startDate != null) {
      json['startDate'] = startDate!.toJson();
    }
    if (endDate != null) {
      json['endDate'] = endDate!.toJson();
    }
    if (requested != null) {
      json['requested'] = nativeToJson<int?>(requested);
    }
    if (total != null) {
      json['total'] = nativeToJson<double?>(total);
    }
    if (notes != null) {
      json['notes'] = nativeToJson<String?>(notes);
    }
    if (createdAt != null) {
      json['createdAt'] = createdAt!.toJson();
    }
    if (updatedAt != null) {
      json['updatedAt'] = updatedAt!.toJson();
    }
    if (createdBy != null) {
      json['createdBy'] = nativeToJson<String?>(createdBy);
    }
    return json;
  }

  ListOrdersByBusinessAndTeamHubOrders({
    required this.id,
    this.eventName,
    required this.orderType,
    required this.status,
    this.duration,
    required this.businessId,
    this.vendorId,
    required this.teamHubId,
    this.date,
    this.startDate,
    this.endDate,
    this.requested,
    this.total,
    this.notes,
    this.createdAt,
    this.updatedAt,
    this.createdBy,
  });
}

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

    final ListOrdersByBusinessAndTeamHubData otherTyped = other as ListOrdersByBusinessAndTeamHubData;
    return orders == otherTyped.orders;
    
  }
  @override
  int get hashCode => orders.hashCode;
  

  Map<String, dynamic> toJson() {
    Map<String, dynamic> json = {};
    json['orders'] = orders.map((e) => e.toJson()).toList();
    return json;
  }

  ListOrdersByBusinessAndTeamHubData({
    required this.orders,
  });
}

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

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

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

