part of 'generated.dart';

class ListShiftRolesByShiftIdAndTimeRangeVariablesBuilder {
  String shiftId;
  Timestamp start;
  Timestamp end;
  Optional<int> _offset = Optional.optional(nativeFromJson, nativeToJson);
  Optional<int> _limit = Optional.optional(nativeFromJson, nativeToJson);

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

  ListShiftRolesByShiftIdAndTimeRangeVariablesBuilder(this._dataConnect, {required  this.shiftId,required  this.start,required  this.end,});
  Deserializer<ListShiftRolesByShiftIdAndTimeRangeData> dataDeserializer = (dynamic json)  => ListShiftRolesByShiftIdAndTimeRangeData.fromJson(jsonDecode(json));
  Serializer<ListShiftRolesByShiftIdAndTimeRangeVariables> varsSerializer = (ListShiftRolesByShiftIdAndTimeRangeVariables vars) => jsonEncode(vars.toJson());
  Future<QueryResult<ListShiftRolesByShiftIdAndTimeRangeData, ListShiftRolesByShiftIdAndTimeRangeVariables>> execute() {
    return ref().execute();
  }

  QueryRef<ListShiftRolesByShiftIdAndTimeRangeData, ListShiftRolesByShiftIdAndTimeRangeVariables> ref() {
    ListShiftRolesByShiftIdAndTimeRangeVariables vars= ListShiftRolesByShiftIdAndTimeRangeVariables(shiftId: shiftId,start: start,end: end,offset: _offset,limit: _limit,);
    return _dataConnect.query("listShiftRolesByShiftIdAndTimeRange", dataDeserializer, varsSerializer, vars);
  }
}

@immutable
class ListShiftRolesByShiftIdAndTimeRangeShiftRoles {
  final String id;
  final String shiftId;
  final String roleId;
  final int count;
  final int? assigned;
  final Timestamp? startTime;
  final Timestamp? endTime;
  final double? hours;
  final String? department;
  final String? uniform;
  final EnumValue<BreakDuration>? breakType;
  final double? totalValue;
  final Timestamp? createdAt;
  final ListShiftRolesByShiftIdAndTimeRangeShiftRolesRole role;
  final ListShiftRolesByShiftIdAndTimeRangeShiftRolesShift shift;
  ListShiftRolesByShiftIdAndTimeRangeShiftRoles.fromJson(dynamic json):
  
  id = nativeFromJson<String>(json['id']),
  shiftId = nativeFromJson<String>(json['shiftId']),
  roleId = nativeFromJson<String>(json['roleId']),
  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']),
  department = json['department'] == null ? null : nativeFromJson<String>(json['department']),
  uniform = json['uniform'] == null ? null : nativeFromJson<String>(json['uniform']),
  breakType = json['breakType'] == null ? null : breakDurationDeserializer(json['breakType']),
  totalValue = json['totalValue'] == null ? null : nativeFromJson<double>(json['totalValue']),
  createdAt = json['createdAt'] == null ? null : Timestamp.fromJson(json['createdAt']),
  role = ListShiftRolesByShiftIdAndTimeRangeShiftRolesRole.fromJson(json['role']),
  shift = ListShiftRolesByShiftIdAndTimeRangeShiftRolesShift.fromJson(json['shift']);
  @override
  bool operator ==(Object other) {
    if(identical(this, other)) {
      return true;
    }
    if(other.runtimeType != runtimeType) {
      return false;
    }

    final ListShiftRolesByShiftIdAndTimeRangeShiftRoles otherTyped = other as ListShiftRolesByShiftIdAndTimeRangeShiftRoles;
    return id == otherTyped.id && 
    shiftId == otherTyped.shiftId && 
    roleId == otherTyped.roleId && 
    count == otherTyped.count && 
    assigned == otherTyped.assigned && 
    startTime == otherTyped.startTime && 
    endTime == otherTyped.endTime && 
    hours == otherTyped.hours && 
    department == otherTyped.department && 
    uniform == otherTyped.uniform && 
    breakType == otherTyped.breakType && 
    totalValue == otherTyped.totalValue && 
    createdAt == otherTyped.createdAt && 
    role == otherTyped.role && 
    shift == otherTyped.shift;
    
  }
  @override
  int get hashCode => Object.hashAll([id.hashCode, shiftId.hashCode, roleId.hashCode, count.hashCode, assigned.hashCode, startTime.hashCode, endTime.hashCode, hours.hashCode, department.hashCode, uniform.hashCode, breakType.hashCode, totalValue.hashCode, createdAt.hashCode, role.hashCode, shift.hashCode]);
  

  Map<String, dynamic> toJson() {
    Map<String, dynamic> json = {};
    json['id'] = nativeToJson<String>(id);
    json['shiftId'] = nativeToJson<String>(shiftId);
    json['roleId'] = nativeToJson<String>(roleId);
    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 (department != null) {
      json['department'] = nativeToJson<String?>(department);
    }
    if (uniform != null) {
      json['uniform'] = nativeToJson<String?>(uniform);
    }
    if (breakType != null) {
      json['breakType'] = 
    breakDurationSerializer(breakType!)
    ;
    }
    if (totalValue != null) {
      json['totalValue'] = nativeToJson<double?>(totalValue);
    }
    if (createdAt != null) {
      json['createdAt'] = createdAt!.toJson();
    }
    json['role'] = role.toJson();
    json['shift'] = shift.toJson();
    return json;
  }

  ListShiftRolesByShiftIdAndTimeRangeShiftRoles({
    required this.id,
    required this.shiftId,
    required this.roleId,
    required this.count,
    this.assigned,
    this.startTime,
    this.endTime,
    this.hours,
    this.department,
    this.uniform,
    this.breakType,
    this.totalValue,
    this.createdAt,
    required this.role,
    required this.shift,
  });
}

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

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

@immutable
class ListShiftRolesByShiftIdAndTimeRangeShiftRolesShift {
  final String? location;
  final String? locationAddress;
  final String? description;
  final String orderId;
  final ListShiftRolesByShiftIdAndTimeRangeShiftRolesShiftOrder order;
  ListShiftRolesByShiftIdAndTimeRangeShiftRolesShift.fromJson(dynamic json):
  
  location = json['location'] == null ? null : nativeFromJson<String>(json['location']),
  locationAddress = json['locationAddress'] == null ? null : nativeFromJson<String>(json['locationAddress']),
  description = json['description'] == null ? null : nativeFromJson<String>(json['description']),
  orderId = nativeFromJson<String>(json['orderId']),
  order = ListShiftRolesByShiftIdAndTimeRangeShiftRolesShiftOrder.fromJson(json['order']);
  @override
  bool operator ==(Object other) {
    if(identical(this, other)) {
      return true;
    }
    if(other.runtimeType != runtimeType) {
      return false;
    }

    final ListShiftRolesByShiftIdAndTimeRangeShiftRolesShift otherTyped = other as ListShiftRolesByShiftIdAndTimeRangeShiftRolesShift;
    return location == otherTyped.location && 
    locationAddress == otherTyped.locationAddress && 
    description == otherTyped.description && 
    orderId == otherTyped.orderId && 
    order == otherTyped.order;
    
  }
  @override
  int get hashCode => Object.hashAll([location.hashCode, locationAddress.hashCode, description.hashCode, orderId.hashCode, order.hashCode]);
  

  Map<String, dynamic> toJson() {
    Map<String, dynamic> json = {};
    if (location != null) {
      json['location'] = nativeToJson<String?>(location);
    }
    if (locationAddress != null) {
      json['locationAddress'] = nativeToJson<String?>(locationAddress);
    }
    if (description != null) {
      json['description'] = nativeToJson<String?>(description);
    }
    json['orderId'] = nativeToJson<String>(orderId);
    json['order'] = order.toJson();
    return json;
  }

  ListShiftRolesByShiftIdAndTimeRangeShiftRolesShift({
    this.location,
    this.locationAddress,
    this.description,
    required this.orderId,
    required this.order,
  });
}

@immutable
class ListShiftRolesByShiftIdAndTimeRangeShiftRolesShiftOrder {
  final AnyValue? recurringDays;
  final AnyValue? permanentDays;
  final String? notes;
  final ListShiftRolesByShiftIdAndTimeRangeShiftRolesShiftOrderBusiness business;
  final ListShiftRolesByShiftIdAndTimeRangeShiftRolesShiftOrderVendor? vendor;
  ListShiftRolesByShiftIdAndTimeRangeShiftRolesShiftOrder.fromJson(dynamic json):
  
  recurringDays = json['recurringDays'] == null ? null : AnyValue.fromJson(json['recurringDays']),
  permanentDays = json['permanentDays'] == null ? null : AnyValue.fromJson(json['permanentDays']),
  notes = json['notes'] == null ? null : nativeFromJson<String>(json['notes']),
  business = ListShiftRolesByShiftIdAndTimeRangeShiftRolesShiftOrderBusiness.fromJson(json['business']),
  vendor = json['vendor'] == null ? null : ListShiftRolesByShiftIdAndTimeRangeShiftRolesShiftOrderVendor.fromJson(json['vendor']);
  @override
  bool operator ==(Object other) {
    if(identical(this, other)) {
      return true;
    }
    if(other.runtimeType != runtimeType) {
      return false;
    }

    final ListShiftRolesByShiftIdAndTimeRangeShiftRolesShiftOrder otherTyped = other as ListShiftRolesByShiftIdAndTimeRangeShiftRolesShiftOrder;
    return recurringDays == otherTyped.recurringDays && 
    permanentDays == otherTyped.permanentDays && 
    notes == otherTyped.notes && 
    business == otherTyped.business && 
    vendor == otherTyped.vendor;
    
  }
  @override
  int get hashCode => Object.hashAll([recurringDays.hashCode, permanentDays.hashCode, notes.hashCode, business.hashCode, vendor.hashCode]);
  

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

  ListShiftRolesByShiftIdAndTimeRangeShiftRolesShiftOrder({
    this.recurringDays,
    this.permanentDays,
    this.notes,
    required this.business,
    this.vendor,
  });
}

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

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

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

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

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

    final ListShiftRolesByShiftIdAndTimeRangeData otherTyped = other as ListShiftRolesByShiftIdAndTimeRangeData;
    return shiftRoles == otherTyped.shiftRoles;
    
  }
  @override
  int get hashCode => shiftRoles.hashCode;
  

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

  ListShiftRolesByShiftIdAndTimeRangeData({
    required this.shiftRoles,
  });
}

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

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

  ListShiftRolesByShiftIdAndTimeRangeVariables({
    required this.shiftId,
    required this.start,
    required this.end,
    required this.offset,
    required this.limit,
  });
}

