part of 'generated.dart';

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

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

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

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

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

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

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

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

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

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

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

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

@immutable
class ListAssignmentsAssignmentsShiftRole {
  final String id;
  final int count;
  final int? assigned;
  final Timestamp? startTime;
  final Timestamp? endTime;
  final double? hours;
  final double? totalValue;
  final ListAssignmentsAssignmentsShiftRoleRole role;
  final ListAssignmentsAssignmentsShiftRoleShift shift;
  ListAssignmentsAssignmentsShiftRole.fromJson(dynamic json):
  
  id = nativeFromJson<String>(json['id']),
  count = nativeFromJson<int>(json['count']),
  assigned = json['assigned'] == null ? null : nativeFromJson<int>(json['assigned']),
  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 = ListAssignmentsAssignmentsShiftRoleRole.fromJson(json['role']),
  shift = ListAssignmentsAssignmentsShiftRoleShift.fromJson(json['shift']);
  @override
  bool operator ==(Object other) {
    if(identical(this, other)) {
      return true;
    }
    if(other.runtimeType != runtimeType) {
      return false;
    }

    final ListAssignmentsAssignmentsShiftRole otherTyped = other as ListAssignmentsAssignmentsShiftRole;
    return id == otherTyped.id && 
    count == otherTyped.count && 
    assigned == otherTyped.assigned && 
    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, count.hashCode, assigned.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);
    json['count'] = nativeToJson<int>(count);
    if (assigned != null) {
      json['assigned'] = nativeToJson<int?>(assigned);
    }
    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;
  }

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

@immutable
class ListAssignmentsAssignmentsShiftRoleRole {
  final String id;
  final String name;
  final double costPerHour;
  ListAssignmentsAssignmentsShiftRoleRole.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 ListAssignmentsAssignmentsShiftRoleRole otherTyped = other as ListAssignmentsAssignmentsShiftRoleRole;
    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;
  }

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

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

    final ListAssignmentsAssignmentsShiftRoleShift otherTyped = other as ListAssignmentsAssignmentsShiftRoleShift;
    return id == otherTyped.id && 
    title == otherTyped.title && 
    date == otherTyped.date && 
    location == otherTyped.location && 
    locationAddress == otherTyped.locationAddress && 
    latitude == otherTyped.latitude && 
    longitude == otherTyped.longitude && 
    status == otherTyped.status && 
    order == otherTyped.order;
    
  }
  @override
  int get hashCode => Object.hashAll([id.hashCode, title.hashCode, date.hashCode, location.hashCode, locationAddress.hashCode, latitude.hashCode, longitude.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 (locationAddress != null) {
      json['locationAddress'] = nativeToJson<String?>(locationAddress);
    }
    if (latitude != null) {
      json['latitude'] = nativeToJson<double?>(latitude);
    }
    if (longitude != null) {
      json['longitude'] = nativeToJson<double?>(longitude);
    }
    if (status != null) {
      json['status'] = 
    shiftStatusSerializer(status!)
    ;
    }
    json['order'] = order.toJson();
    return json;
  }

  ListAssignmentsAssignmentsShiftRoleShift({
    required this.id,
    required this.title,
    this.date,
    this.location,
    this.locationAddress,
    this.latitude,
    this.longitude,
    this.status,
    required this.order,
  });
}

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

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

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

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

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

  Map<String, dynamic> toJson() {
    Map<String, dynamic> json = {};
    json['id'] = nativeToJson<String>(id);
    json['businessName'] = nativeToJson<String>(businessName);
    if (email != null) {
      json['email'] = nativeToJson<String?>(email);
    }
    if (contactName != null) {
      json['contactName'] = nativeToJson<String?>(contactName);
    }
    return json;
  }

  ListAssignmentsAssignmentsShiftRoleShiftOrderBusiness({
    required this.id,
    required this.businessName,
    this.email,
    this.contactName,
  });
}

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

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

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

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

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

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

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

