part of 'generated.dart';

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

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

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

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

@immutable
class ListStaffAvailabilityStatsStaffAvailabilityStatss {
  final String id;
  final String staffId;
  final int? needWorkIndex;
  final int? utilizationPercentage;
  final int? predictedAvailabilityScore;
  final int? scheduledHoursThisPeriod;
  final int? desiredHoursThisPeriod;
  final Timestamp? lastShiftDate;
  final int? acceptanceRate;
  final Timestamp? createdAt;
  final Timestamp? updatedAt;
  final String? createdBy;
  final ListStaffAvailabilityStatsStaffAvailabilityStatssStaff staff;
  ListStaffAvailabilityStatsStaffAvailabilityStatss.fromJson(dynamic json):
  
  id = nativeFromJson<String>(json['id']),
  staffId = nativeFromJson<String>(json['staffId']),
  needWorkIndex = json['needWorkIndex'] == null ? null : nativeFromJson<int>(json['needWorkIndex']),
  utilizationPercentage = json['utilizationPercentage'] == null ? null : nativeFromJson<int>(json['utilizationPercentage']),
  predictedAvailabilityScore = json['predictedAvailabilityScore'] == null ? null : nativeFromJson<int>(json['predictedAvailabilityScore']),
  scheduledHoursThisPeriod = json['scheduledHoursThisPeriod'] == null ? null : nativeFromJson<int>(json['scheduledHoursThisPeriod']),
  desiredHoursThisPeriod = json['desiredHoursThisPeriod'] == null ? null : nativeFromJson<int>(json['desiredHoursThisPeriod']),
  lastShiftDate = json['lastShiftDate'] == null ? null : Timestamp.fromJson(json['lastShiftDate']),
  acceptanceRate = json['acceptanceRate'] == null ? null : nativeFromJson<int>(json['acceptanceRate']),
  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']),
  staff = ListStaffAvailabilityStatsStaffAvailabilityStatssStaff.fromJson(json['staff']);
  @override
  bool operator ==(Object other) {
    if(identical(this, other)) {
      return true;
    }
    if(other.runtimeType != runtimeType) {
      return false;
    }

    final ListStaffAvailabilityStatsStaffAvailabilityStatss otherTyped = other as ListStaffAvailabilityStatsStaffAvailabilityStatss;
    return id == otherTyped.id && 
    staffId == otherTyped.staffId && 
    needWorkIndex == otherTyped.needWorkIndex && 
    utilizationPercentage == otherTyped.utilizationPercentage && 
    predictedAvailabilityScore == otherTyped.predictedAvailabilityScore && 
    scheduledHoursThisPeriod == otherTyped.scheduledHoursThisPeriod && 
    desiredHoursThisPeriod == otherTyped.desiredHoursThisPeriod && 
    lastShiftDate == otherTyped.lastShiftDate && 
    acceptanceRate == otherTyped.acceptanceRate && 
    createdAt == otherTyped.createdAt && 
    updatedAt == otherTyped.updatedAt && 
    createdBy == otherTyped.createdBy && 
    staff == otherTyped.staff;
    
  }
  @override
  int get hashCode => Object.hashAll([id.hashCode, staffId.hashCode, needWorkIndex.hashCode, utilizationPercentage.hashCode, predictedAvailabilityScore.hashCode, scheduledHoursThisPeriod.hashCode, desiredHoursThisPeriod.hashCode, lastShiftDate.hashCode, acceptanceRate.hashCode, createdAt.hashCode, updatedAt.hashCode, createdBy.hashCode, staff.hashCode]);
  

  Map<String, dynamic> toJson() {
    Map<String, dynamic> json = {};
    json['id'] = nativeToJson<String>(id);
    json['staffId'] = nativeToJson<String>(staffId);
    if (needWorkIndex != null) {
      json['needWorkIndex'] = nativeToJson<int?>(needWorkIndex);
    }
    if (utilizationPercentage != null) {
      json['utilizationPercentage'] = nativeToJson<int?>(utilizationPercentage);
    }
    if (predictedAvailabilityScore != null) {
      json['predictedAvailabilityScore'] = nativeToJson<int?>(predictedAvailabilityScore);
    }
    if (scheduledHoursThisPeriod != null) {
      json['scheduledHoursThisPeriod'] = nativeToJson<int?>(scheduledHoursThisPeriod);
    }
    if (desiredHoursThisPeriod != null) {
      json['desiredHoursThisPeriod'] = nativeToJson<int?>(desiredHoursThisPeriod);
    }
    if (lastShiftDate != null) {
      json['lastShiftDate'] = lastShiftDate!.toJson();
    }
    if (acceptanceRate != null) {
      json['acceptanceRate'] = nativeToJson<int?>(acceptanceRate);
    }
    if (createdAt != null) {
      json['createdAt'] = createdAt!.toJson();
    }
    if (updatedAt != null) {
      json['updatedAt'] = updatedAt!.toJson();
    }
    if (createdBy != null) {
      json['createdBy'] = nativeToJson<String?>(createdBy);
    }
    json['staff'] = staff.toJson();
    return json;
  }

  ListStaffAvailabilityStatsStaffAvailabilityStatss({
    required this.id,
    required this.staffId,
    this.needWorkIndex,
    this.utilizationPercentage,
    this.predictedAvailabilityScore,
    this.scheduledHoursThisPeriod,
    this.desiredHoursThisPeriod,
    this.lastShiftDate,
    this.acceptanceRate,
    this.createdAt,
    this.updatedAt,
    this.createdBy,
    required this.staff,
  });
}

@immutable
class ListStaffAvailabilityStatsStaffAvailabilityStatssStaff {
  final String id;
  final String fullName;
  ListStaffAvailabilityStatsStaffAvailabilityStatssStaff.fromJson(dynamic json):
  
  id = nativeFromJson<String>(json['id']),
  fullName = nativeFromJson<String>(json['fullName']);
  @override
  bool operator ==(Object other) {
    if(identical(this, other)) {
      return true;
    }
    if(other.runtimeType != runtimeType) {
      return false;
    }

    final ListStaffAvailabilityStatsStaffAvailabilityStatssStaff otherTyped = other as ListStaffAvailabilityStatsStaffAvailabilityStatssStaff;
    return id == otherTyped.id && 
    fullName == otherTyped.fullName;
    
  }
  @override
  int get hashCode => Object.hashAll([id.hashCode, fullName.hashCode]);
  

  Map<String, dynamic> toJson() {
    Map<String, dynamic> json = {};
    json['id'] = nativeToJson<String>(id);
    json['fullName'] = nativeToJson<String>(fullName);
    return json;
  }

  ListStaffAvailabilityStatsStaffAvailabilityStatssStaff({
    required this.id,
    required this.fullName,
  });
}

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

    final ListStaffAvailabilityStatsData otherTyped = other as ListStaffAvailabilityStatsData;
    return staffAvailabilityStatss == otherTyped.staffAvailabilityStatss;
    
  }
  @override
  int get hashCode => staffAvailabilityStatss.hashCode;
  

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

  ListStaffAvailabilityStatsData({
    required this.staffAvailabilityStatss,
  });
}

@immutable
class ListStaffAvailabilityStatsVariables {
  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.')
  ListStaffAvailabilityStatsVariables.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 ListStaffAvailabilityStatsVariables otherTyped = other as ListStaffAvailabilityStatsVariables;
    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;
  }

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

