part of 'generated.dart';

class ListShiftsForPerformanceByVendorVariablesBuilder {
  String vendorId;
  Timestamp startDate;
  Timestamp endDate;

  final FirebaseDataConnect _dataConnect;
  ListShiftsForPerformanceByVendorVariablesBuilder(this._dataConnect, {required  this.vendorId,required  this.startDate,required  this.endDate,});
  Deserializer<ListShiftsForPerformanceByVendorData> dataDeserializer = (dynamic json)  => ListShiftsForPerformanceByVendorData.fromJson(jsonDecode(json));
  Serializer<ListShiftsForPerformanceByVendorVariables> varsSerializer = (ListShiftsForPerformanceByVendorVariables vars) => jsonEncode(vars.toJson());
  Future<QueryResult<ListShiftsForPerformanceByVendorData, ListShiftsForPerformanceByVendorVariables>> execute() {
    return ref().execute();
  }

  QueryRef<ListShiftsForPerformanceByVendorData, ListShiftsForPerformanceByVendorVariables> ref() {
    ListShiftsForPerformanceByVendorVariables vars= ListShiftsForPerformanceByVendorVariables(vendorId: vendorId,startDate: startDate,endDate: endDate,);
    return _dataConnect.query("listShiftsForPerformanceByVendor", dataDeserializer, varsSerializer, vars);
  }
}

@immutable
class ListShiftsForPerformanceByVendorShifts {
  final String id;
  final int? workersNeeded;
  final int? filled;
  final EnumValue<ShiftStatus>? status;
  final Timestamp? createdAt;
  final Timestamp? filledAt;
  ListShiftsForPerformanceByVendorShifts.fromJson(dynamic json):
  
  id = nativeFromJson<String>(json['id']),
  workersNeeded = json['workersNeeded'] == null ? null : nativeFromJson<int>(json['workersNeeded']),
  filled = json['filled'] == null ? null : nativeFromJson<int>(json['filled']),
  status = json['status'] == null ? null : shiftStatusDeserializer(json['status']),
  createdAt = json['createdAt'] == null ? null : Timestamp.fromJson(json['createdAt']),
  filledAt = json['filledAt'] == null ? null : Timestamp.fromJson(json['filledAt']);
  @override
  bool operator ==(Object other) {
    if(identical(this, other)) {
      return true;
    }
    if(other.runtimeType != runtimeType) {
      return false;
    }

    final ListShiftsForPerformanceByVendorShifts otherTyped = other as ListShiftsForPerformanceByVendorShifts;
    return id == otherTyped.id && 
    workersNeeded == otherTyped.workersNeeded && 
    filled == otherTyped.filled && 
    status == otherTyped.status && 
    createdAt == otherTyped.createdAt && 
    filledAt == otherTyped.filledAt;
    
  }
  @override
  int get hashCode => Object.hashAll([id.hashCode, workersNeeded.hashCode, filled.hashCode, status.hashCode, createdAt.hashCode, filledAt.hashCode]);
  

  Map<String, dynamic> toJson() {
    Map<String, dynamic> json = {};
    json['id'] = nativeToJson<String>(id);
    if (workersNeeded != null) {
      json['workersNeeded'] = nativeToJson<int?>(workersNeeded);
    }
    if (filled != null) {
      json['filled'] = nativeToJson<int?>(filled);
    }
    if (status != null) {
      json['status'] = 
    shiftStatusSerializer(status!)
    ;
    }
    if (createdAt != null) {
      json['createdAt'] = createdAt!.toJson();
    }
    if (filledAt != null) {
      json['filledAt'] = filledAt!.toJson();
    }
    return json;
  }

  ListShiftsForPerformanceByVendorShifts({
    required this.id,
    this.workersNeeded,
    this.filled,
    this.status,
    this.createdAt,
    this.filledAt,
  });
}

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

    final ListShiftsForPerformanceByVendorData otherTyped = other as ListShiftsForPerformanceByVendorData;
    return shifts == otherTyped.shifts;
    
  }
  @override
  int get hashCode => shifts.hashCode;
  

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

  ListShiftsForPerformanceByVendorData({
    required this.shifts,
  });
}

@immutable
class ListShiftsForPerformanceByVendorVariables {
  final String vendorId;
  final Timestamp startDate;
  final Timestamp endDate;
  @Deprecated('fromJson is deprecated for Variable classes as they are no longer required for deserialization.')
  ListShiftsForPerformanceByVendorVariables.fromJson(Map<String, dynamic> json):
  
  vendorId = nativeFromJson<String>(json['vendorId']),
  startDate = Timestamp.fromJson(json['startDate']),
  endDate = Timestamp.fromJson(json['endDate']);
  @override
  bool operator ==(Object other) {
    if(identical(this, other)) {
      return true;
    }
    if(other.runtimeType != runtimeType) {
      return false;
    }

    final ListShiftsForPerformanceByVendorVariables otherTyped = other as ListShiftsForPerformanceByVendorVariables;
    return vendorId == otherTyped.vendorId && 
    startDate == otherTyped.startDate && 
    endDate == otherTyped.endDate;
    
  }
  @override
  int get hashCode => Object.hashAll([vendorId.hashCode, startDate.hashCode, endDate.hashCode]);
  

  Map<String, dynamic> toJson() {
    Map<String, dynamic> json = {};
    json['vendorId'] = nativeToJson<String>(vendorId);
    json['startDate'] = startDate.toJson();
    json['endDate'] = endDate.toJson();
    return json;
  }

  ListShiftsForPerformanceByVendorVariables({
    required this.vendorId,
    required this.startDate,
    required this.endDate,
  });
}

