part of 'generated.dart';

class ListAssignmentsByShiftRoleVariablesBuilder {
  String shiftId;
  String roleId;
  Optional<int> _offset = Optional.optional(nativeFromJson, nativeToJson);
  Optional<int> _limit = Optional.optional(nativeFromJson, nativeToJson);

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

  ListAssignmentsByShiftRoleVariablesBuilder(this._dataConnect, {required  this.shiftId,required  this.roleId,});
  Deserializer<ListAssignmentsByShiftRoleData> dataDeserializer = (dynamic json)  => ListAssignmentsByShiftRoleData.fromJson(jsonDecode(json));
  Serializer<ListAssignmentsByShiftRoleVariables> varsSerializer = (ListAssignmentsByShiftRoleVariables vars) => jsonEncode(vars.toJson());
  Future<QueryResult<ListAssignmentsByShiftRoleData, ListAssignmentsByShiftRoleVariables>> execute() {
    return ref().execute();
  }

  QueryRef<ListAssignmentsByShiftRoleData, ListAssignmentsByShiftRoleVariables> ref() {
    ListAssignmentsByShiftRoleVariables vars= ListAssignmentsByShiftRoleVariables(shiftId: shiftId,roleId: roleId,offset: _offset,limit: _limit,);
    return _dataConnect.query("listAssignmentsByShiftRole", dataDeserializer, varsSerializer, vars);
  }
}

@immutable
class ListAssignmentsByShiftRoleAssignments {
  final String id;
  final String? title;
  final EnumValue<AssignmentStatus>? status;
  final Timestamp? createdAt;
  final ListAssignmentsByShiftRoleAssignmentsWorkforce workforce;
  ListAssignmentsByShiftRoleAssignments.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 = ListAssignmentsByShiftRoleAssignmentsWorkforce.fromJson(json['workforce']);
  @override
  bool operator ==(Object other) {
    if(identical(this, other)) {
      return true;
    }
    if(other.runtimeType != runtimeType) {
      return false;
    }

    final ListAssignmentsByShiftRoleAssignments otherTyped = other as ListAssignmentsByShiftRoleAssignments;
    return id == otherTyped.id && 
    title == otherTyped.title && 
    status == otherTyped.status && 
    createdAt == otherTyped.createdAt && 
    workforce == otherTyped.workforce;
    
  }
  @override
  int get hashCode => Object.hashAll([id.hashCode, title.hashCode, status.hashCode, createdAt.hashCode, workforce.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();
    return json;
  }

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

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

    final ListAssignmentsByShiftRoleAssignmentsWorkforce otherTyped = other as ListAssignmentsByShiftRoleAssignmentsWorkforce;
    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;
  }

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

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

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

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

    final ListAssignmentsByShiftRoleData otherTyped = other as ListAssignmentsByShiftRoleData;
    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;
  }

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

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

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

  ListAssignmentsByShiftRoleVariables({
    required this.shiftId,
    required this.roleId,
    required this.offset,
    required this.limit,
  });
}

