part of 'generated.dart';

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

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

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

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

@immutable
class ListStaffAvailabilitiesStaffAvailabilities {
  final String id;
  final String staffId;
  final EnumValue<DayOfWeek> day;
  final EnumValue<AvailabilitySlot> slot;
  final EnumValue<AvailabilityStatus> status;
  final String? notes;
  final Timestamp? createdAt;
  final Timestamp? updatedAt;
  final String? createdBy;
  final ListStaffAvailabilitiesStaffAvailabilitiesStaff staff;
  ListStaffAvailabilitiesStaffAvailabilities.fromJson(dynamic json):
  
  id = nativeFromJson<String>(json['id']),
  staffId = nativeFromJson<String>(json['staffId']),
  day = dayOfWeekDeserializer(json['day']),
  slot = availabilitySlotDeserializer(json['slot']),
  status = availabilityStatusDeserializer(json['status']),
  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']),
  staff = ListStaffAvailabilitiesStaffAvailabilitiesStaff.fromJson(json['staff']);
  @override
  bool operator ==(Object other) {
    if(identical(this, other)) {
      return true;
    }
    if(other.runtimeType != runtimeType) {
      return false;
    }

    final ListStaffAvailabilitiesStaffAvailabilities otherTyped = other as ListStaffAvailabilitiesStaffAvailabilities;
    return id == otherTyped.id && 
    staffId == otherTyped.staffId && 
    day == otherTyped.day && 
    slot == otherTyped.slot && 
    status == otherTyped.status && 
    notes == otherTyped.notes && 
    createdAt == otherTyped.createdAt && 
    updatedAt == otherTyped.updatedAt && 
    createdBy == otherTyped.createdBy && 
    staff == otherTyped.staff;
    
  }
  @override
  int get hashCode => Object.hashAll([id.hashCode, staffId.hashCode, day.hashCode, slot.hashCode, status.hashCode, notes.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);
    json['day'] = 
    dayOfWeekSerializer(day)
    ;
    json['slot'] = 
    availabilitySlotSerializer(slot)
    ;
    json['status'] = 
    availabilityStatusSerializer(status)
    ;
    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);
    }
    json['staff'] = staff.toJson();
    return json;
  }

  ListStaffAvailabilitiesStaffAvailabilities({
    required this.id,
    required this.staffId,
    required this.day,
    required this.slot,
    required this.status,
    this.notes,
    this.createdAt,
    this.updatedAt,
    this.createdBy,
    required this.staff,
  });
}

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

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

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

    final ListStaffAvailabilitiesData otherTyped = other as ListStaffAvailabilitiesData;
    return staffAvailabilities == otherTyped.staffAvailabilities;
    
  }
  @override
  int get hashCode => staffAvailabilities.hashCode;
  

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

  ListStaffAvailabilitiesData({
    required this.staffAvailabilities,
  });
}

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

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

