part of 'generated.dart';

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

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

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

  QueryRef<ListShiftRolesByShiftIdData, ListShiftRolesByShiftIdVariables> ref() {
    ListShiftRolesByShiftIdVariables vars= ListShiftRolesByShiftIdVariables(shiftId: shiftId,offset: _offset,limit: _limit,);
    return _dataConnect.query("listShiftRolesByShiftId", dataDeserializer, varsSerializer, vars);
  }
}

@immutable
class ListShiftRolesByShiftIdShiftRoles {
  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 ListShiftRolesByShiftIdShiftRolesRole role;
  final ListShiftRolesByShiftIdShiftRolesShift shift;
  ListShiftRolesByShiftIdShiftRoles.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 = ListShiftRolesByShiftIdShiftRolesRole.fromJson(json['role']),
  shift = ListShiftRolesByShiftIdShiftRolesShift.fromJson(json['shift']);
  @override
  bool operator ==(Object other) {
    if(identical(this, other)) {
      return true;
    }
    if(other.runtimeType != runtimeType) {
      return false;
    }

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

  ListShiftRolesByShiftIdShiftRoles({
    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 ListShiftRolesByShiftIdShiftRolesRole {
  final String id;
  final String name;
  final double costPerHour;
  ListShiftRolesByShiftIdShiftRolesRole.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 ListShiftRolesByShiftIdShiftRolesRole otherTyped = other as ListShiftRolesByShiftIdShiftRolesRole;
    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;
  }

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

@immutable
class ListShiftRolesByShiftIdShiftRolesShift {
  final String? location;
  final String? locationAddress;
  final String? description;
  final String orderId;
  final ListShiftRolesByShiftIdShiftRolesShiftOrder order;
  ListShiftRolesByShiftIdShiftRolesShift.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 = ListShiftRolesByShiftIdShiftRolesShiftOrder.fromJson(json['order']);
  @override
  bool operator ==(Object other) {
    if(identical(this, other)) {
      return true;
    }
    if(other.runtimeType != runtimeType) {
      return false;
    }

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

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

@immutable
class ListShiftRolesByShiftIdShiftRolesShiftOrder {
  final AnyValue? recurringDays;
  final AnyValue? permanentDays;
  final String? notes;
  final ListShiftRolesByShiftIdShiftRolesShiftOrderBusiness business;
  final ListShiftRolesByShiftIdShiftRolesShiftOrderVendor? vendor;
  ListShiftRolesByShiftIdShiftRolesShiftOrder.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 = ListShiftRolesByShiftIdShiftRolesShiftOrderBusiness.fromJson(json['business']),
  vendor = json['vendor'] == null ? null : ListShiftRolesByShiftIdShiftRolesShiftOrderVendor.fromJson(json['vendor']);
  @override
  bool operator ==(Object other) {
    if(identical(this, other)) {
      return true;
    }
    if(other.runtimeType != runtimeType) {
      return false;
    }

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

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

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

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

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

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

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

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

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

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

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

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

