part of 'generated.dart';

class FilterAssignmentsVariablesBuilder {
  List<String> shiftIds;
  List<String> roleIds;
  Optional<AssignmentStatus> _status = Optional.optional((data) => AssignmentStatus.values.byName(data), enumSerializer);
  Optional<int> _offset = Optional.optional(nativeFromJson, nativeToJson);
  Optional<int> _limit = Optional.optional(nativeFromJson, nativeToJson);

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

  FilterAssignmentsVariablesBuilder(this._dataConnect, {required  this.shiftIds,required  this.roleIds,});
  Deserializer<FilterAssignmentsData> dataDeserializer = (dynamic json)  => FilterAssignmentsData.fromJson(jsonDecode(json));
  Serializer<FilterAssignmentsVariables> varsSerializer = (FilterAssignmentsVariables vars) => jsonEncode(vars.toJson());
  Future<QueryResult<FilterAssignmentsData, FilterAssignmentsVariables>> execute() {
    return ref().execute();
  }

  QueryRef<FilterAssignmentsData, FilterAssignmentsVariables> ref() {
    FilterAssignmentsVariables vars= FilterAssignmentsVariables(shiftIds: shiftIds,roleIds: roleIds,status: _status,offset: _offset,limit: _limit,);
    return _dataConnect.query("filterAssignments", dataDeserializer, varsSerializer, vars);
  }
}

@immutable
class FilterAssignmentsAssignments {
  final String id;
  final String? title;
  final EnumValue<AssignmentStatus>? status;
  final Timestamp? createdAt;
  final FilterAssignmentsAssignmentsWorkforce workforce;
  final FilterAssignmentsAssignmentsShiftRole shiftRole;
  FilterAssignmentsAssignments.fromJson(dynamic json):
  
  id = nativeFromJson<String>(json['id']),
  title = json['title'] == null ? null : nativeFromJson<String>(json['title']),
  status = json['status'] == null ? null : assignmentStatusDeserializer(json['status']),
  createdAt = json['createdAt'] == null ? null : Timestamp.fromJson(json['createdAt']),
  workforce = FilterAssignmentsAssignmentsWorkforce.fromJson(json['workforce']),
  shiftRole = FilterAssignmentsAssignmentsShiftRole.fromJson(json['shiftRole']);
  @override
  bool operator ==(Object other) {
    if(identical(this, other)) {
      return true;
    }
    if(other.runtimeType != runtimeType) {
      return false;
    }

    final FilterAssignmentsAssignments otherTyped = other as FilterAssignmentsAssignments;
    return id == otherTyped.id && 
    title == otherTyped.title && 
    status == otherTyped.status && 
    createdAt == otherTyped.createdAt && 
    workforce == otherTyped.workforce && 
    shiftRole == otherTyped.shiftRole;
    
  }
  @override
  int get hashCode => Object.hashAll([id.hashCode, title.hashCode, status.hashCode, createdAt.hashCode, workforce.hashCode, shiftRole.hashCode]);
  

  Map<String, dynamic> toJson() {
    Map<String, dynamic> json = {};
    json['id'] = nativeToJson<String>(id);
    if (title != null) {
      json['title'] = nativeToJson<String?>(title);
    }
    if (status != null) {
      json['status'] = 
    assignmentStatusSerializer(status!)
    ;
    }
    if (createdAt != null) {
      json['createdAt'] = createdAt!.toJson();
    }
    json['workforce'] = workforce.toJson();
    json['shiftRole'] = shiftRole.toJson();
    return json;
  }

  FilterAssignmentsAssignments({
    required this.id,
    this.title,
    this.status,
    this.createdAt,
    required this.workforce,
    required this.shiftRole,
  });
}

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

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

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

  FilterAssignmentsAssignmentsWorkforce({
    required this.id,
    required this.workforceNumber,
    required this.staff,
  });
}

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

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

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

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

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

  FilterAssignmentsAssignmentsShiftRole({
    required this.id,
    required this.role,
    required this.shift,
  });
}

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

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

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

  FilterAssignmentsAssignmentsShiftRoleRole({
    required this.id,
    required this.name,
  });
}

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

    final FilterAssignmentsAssignmentsShiftRoleShift otherTyped = other as FilterAssignmentsAssignmentsShiftRoleShift;
    return id == otherTyped.id && 
    title == otherTyped.title && 
    date == otherTyped.date && 
    location == otherTyped.location && 
    status == otherTyped.status;
    
  }
  @override
  int get hashCode => Object.hashAll([id.hashCode, title.hashCode, date.hashCode, location.hashCode, status.hashCode]);
  

  Map<String, dynamic> toJson() {
    Map<String, dynamic> json = {};
    json['id'] = nativeToJson<String>(id);
    json['title'] = nativeToJson<String>(title);
    if (date != null) {
      json['date'] = date!.toJson();
    }
    if (location != null) {
      json['location'] = nativeToJson<String?>(location);
    }
    if (status != null) {
      json['status'] = 
    shiftStatusSerializer(status!)
    ;
    }
    return json;
  }

  FilterAssignmentsAssignmentsShiftRoleShift({
    required this.id,
    required this.title,
    this.date,
    this.location,
    this.status,
  });
}

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

    final FilterAssignmentsData otherTyped = other as FilterAssignmentsData;
    return assignments == otherTyped.assignments;
    
  }
  @override
  int get hashCode => assignments.hashCode;
  

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

  FilterAssignmentsData({
    required this.assignments,
  });
}

@immutable
class FilterAssignmentsVariables {
  final List<String> shiftIds;
  final List<String> roleIds;
  late final Optional<AssignmentStatus>status;
  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.')
  FilterAssignmentsVariables.fromJson(Map<String, dynamic> json):
  
  shiftIds = (json['shiftIds'] as List<dynamic>)
        .map((e) => nativeFromJson<String>(e))
        .toList(),
  roleIds = (json['roleIds'] as List<dynamic>)
        .map((e) => nativeFromJson<String>(e))
        .toList() {
  
  
  
  
    status = Optional.optional((data) => AssignmentStatus.values.byName(data), enumSerializer);
    status.value = json['status'] == null ? null : AssignmentStatus.values.byName(json['status']);
  
  
    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 FilterAssignmentsVariables otherTyped = other as FilterAssignmentsVariables;
    return shiftIds == otherTyped.shiftIds && 
    roleIds == otherTyped.roleIds && 
    status == otherTyped.status && 
    offset == otherTyped.offset && 
    limit == otherTyped.limit;
    
  }
  @override
  int get hashCode => Object.hashAll([shiftIds.hashCode, roleIds.hashCode, status.hashCode, offset.hashCode, limit.hashCode]);
  

  Map<String, dynamic> toJson() {
    Map<String, dynamic> json = {};
    json['shiftIds'] = shiftIds.map((e) => nativeToJson<String>(e)).toList();
    json['roleIds'] = roleIds.map((e) => nativeToJson<String>(e)).toList();
    if(status.state == OptionalState.set) {
      json['status'] = status.toJson();
    }
    if(offset.state == OptionalState.set) {
      json['offset'] = offset.toJson();
    }
    if(limit.state == OptionalState.set) {
      json['limit'] = limit.toJson();
    }
    return json;
  }

  FilterAssignmentsVariables({
    required this.shiftIds,
    required this.roleIds,
    required this.status,
    required this.offset,
    required this.limit,
  });
}

