part of 'generated.dart';

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

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

  ListAssignmentsByWorkforceIdVariablesBuilder(this._dataConnect, {required  this.workforceId,});
  Deserializer<ListAssignmentsByWorkforceIdData> dataDeserializer = (dynamic json)  => ListAssignmentsByWorkforceIdData.fromJson(jsonDecode(json));
  Serializer<ListAssignmentsByWorkforceIdVariables> varsSerializer = (ListAssignmentsByWorkforceIdVariables vars) => jsonEncode(vars.toJson());
  Future<QueryResult<ListAssignmentsByWorkforceIdData, ListAssignmentsByWorkforceIdVariables>> execute() {
    return ref().execute();
  }

  QueryRef<ListAssignmentsByWorkforceIdData, ListAssignmentsByWorkforceIdVariables> ref() {
    ListAssignmentsByWorkforceIdVariables vars= ListAssignmentsByWorkforceIdVariables(workforceId: workforceId,offset: _offset,limit: _limit,);
    return _dataConnect.query("listAssignmentsByWorkforceId", dataDeserializer, varsSerializer, vars);
  }
}

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

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

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

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

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

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

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

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

@immutable
class ListAssignmentsByWorkforceIdAssignmentsShiftRole {
  final String id;
  final Timestamp? startTime;
  final Timestamp? endTime;
  final double? hours;
  final double? totalValue;
  final ListAssignmentsByWorkforceIdAssignmentsShiftRoleRole role;
  final ListAssignmentsByWorkforceIdAssignmentsShiftRoleShift shift;
  ListAssignmentsByWorkforceIdAssignmentsShiftRole.fromJson(dynamic json):
  
  id = nativeFromJson<String>(json['id']),
  startTime = json['startTime'] == null ? null : Timestamp.fromJson(json['startTime']),
  endTime = json['endTime'] == null ? null : Timestamp.fromJson(json['endTime']),
  hours = json['hours'] == null ? null : nativeFromJson<double>(json['hours']),
  totalValue = json['totalValue'] == null ? null : nativeFromJson<double>(json['totalValue']),
  role = ListAssignmentsByWorkforceIdAssignmentsShiftRoleRole.fromJson(json['role']),
  shift = ListAssignmentsByWorkforceIdAssignmentsShiftRoleShift.fromJson(json['shift']);
  @override
  bool operator ==(Object other) {
    if(identical(this, other)) {
      return true;
    }
    if(other.runtimeType != runtimeType) {
      return false;
    }

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

  Map<String, dynamic> toJson() {
    Map<String, dynamic> json = {};
    json['id'] = nativeToJson<String>(id);
    if (startTime != null) {
      json['startTime'] = startTime!.toJson();
    }
    if (endTime != null) {
      json['endTime'] = endTime!.toJson();
    }
    if (hours != null) {
      json['hours'] = nativeToJson<double?>(hours);
    }
    if (totalValue != null) {
      json['totalValue'] = nativeToJson<double?>(totalValue);
    }
    json['role'] = role.toJson();
    json['shift'] = shift.toJson();
    return json;
  }

  ListAssignmentsByWorkforceIdAssignmentsShiftRole({
    required this.id,
    this.startTime,
    this.endTime,
    this.hours,
    this.totalValue,
    required this.role,
    required this.shift,
  });
}

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

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

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

  ListAssignmentsByWorkforceIdAssignmentsShiftRoleRole({
    required this.id,
    required this.name,
    required this.costPerHour,
  });
}

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

    final ListAssignmentsByWorkforceIdAssignmentsShiftRoleShift otherTyped = other as ListAssignmentsByWorkforceIdAssignmentsShiftRoleShift;
    return id == otherTyped.id && 
    title == otherTyped.title && 
    date == otherTyped.date && 
    location == otherTyped.location && 
    status == otherTyped.status && 
    order == otherTyped.order;
    
  }
  @override
  int get hashCode => Object.hashAll([id.hashCode, title.hashCode, date.hashCode, location.hashCode, status.hashCode, order.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!)
    ;
    }
    json['order'] = order.toJson();
    return json;
  }

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

@immutable
class ListAssignmentsByWorkforceIdAssignmentsShiftRoleShiftOrder {
  final String id;
  final String? eventName;
  final ListAssignmentsByWorkforceIdAssignmentsShiftRoleShiftOrderBusiness business;
  final ListAssignmentsByWorkforceIdAssignmentsShiftRoleShiftOrderVendor? vendor;
  ListAssignmentsByWorkforceIdAssignmentsShiftRoleShiftOrder.fromJson(dynamic json):
  
  id = nativeFromJson<String>(json['id']),
  eventName = json['eventName'] == null ? null : nativeFromJson<String>(json['eventName']),
  business = ListAssignmentsByWorkforceIdAssignmentsShiftRoleShiftOrderBusiness.fromJson(json['business']),
  vendor = json['vendor'] == null ? null : ListAssignmentsByWorkforceIdAssignmentsShiftRoleShiftOrderVendor.fromJson(json['vendor']);
  @override
  bool operator ==(Object other) {
    if(identical(this, other)) {
      return true;
    }
    if(other.runtimeType != runtimeType) {
      return false;
    }

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

  Map<String, dynamic> toJson() {
    Map<String, dynamic> json = {};
    json['id'] = nativeToJson<String>(id);
    if (eventName != null) {
      json['eventName'] = nativeToJson<String?>(eventName);
    }
    json['business'] = business.toJson();
    if (vendor != null) {
      json['vendor'] = vendor!.toJson();
    }
    return json;
  }

  ListAssignmentsByWorkforceIdAssignmentsShiftRoleShiftOrder({
    required this.id,
    this.eventName,
    required this.business,
    this.vendor,
  });
}

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

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

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

  ListAssignmentsByWorkforceIdAssignmentsShiftRoleShiftOrderBusiness({
    required this.id,
    required this.businessName,
  });
}

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

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

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

  ListAssignmentsByWorkforceIdAssignmentsShiftRoleShiftOrderVendor({
    required this.id,
    required this.companyName,
  });
}

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

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

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

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

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

  ListAssignmentsByWorkforceIdVariables({
    required this.workforceId,
    required this.offset,
    required this.limit,
  });
}

