part of 'generated.dart';

class ListShiftRolesByBusinessAndDateRangeVariablesBuilder {
  String businessId;
  Timestamp start;
  Timestamp end;
  Optional<int> _offset = Optional.optional(nativeFromJson, nativeToJson);
  Optional<int> _limit = Optional.optional(nativeFromJson, nativeToJson);
  Optional<ShiftStatus> _status = Optional.optional((data) => ShiftStatus.values.byName(data), enumSerializer);

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

  ListShiftRolesByBusinessAndDateRangeVariablesBuilder(this._dataConnect, {required  this.businessId,required  this.start,required  this.end,});
  Deserializer<ListShiftRolesByBusinessAndDateRangeData> dataDeserializer = (dynamic json)  => ListShiftRolesByBusinessAndDateRangeData.fromJson(jsonDecode(json));
  Serializer<ListShiftRolesByBusinessAndDateRangeVariables> varsSerializer = (ListShiftRolesByBusinessAndDateRangeVariables vars) => jsonEncode(vars.toJson());
  Future<QueryResult<ListShiftRolesByBusinessAndDateRangeData, ListShiftRolesByBusinessAndDateRangeVariables>> execute() {
    return ref().execute();
  }

  QueryRef<ListShiftRolesByBusinessAndDateRangeData, ListShiftRolesByBusinessAndDateRangeVariables> ref() {
    ListShiftRolesByBusinessAndDateRangeVariables vars= ListShiftRolesByBusinessAndDateRangeVariables(businessId: businessId,start: start,end: end,offset: _offset,limit: _limit,status: _status,);
    return _dataConnect.query("listShiftRolesByBusinessAndDateRange", dataDeserializer, varsSerializer, vars);
  }
}

@immutable
class ListShiftRolesByBusinessAndDateRangeShiftRoles {
  final String shiftId;
  final String roleId;
  final int count;
  final int? assigned;
  final double? hours;
  final Timestamp? startTime;
  final Timestamp? endTime;
  final double? totalValue;
  final ListShiftRolesByBusinessAndDateRangeShiftRolesRole role;
  final ListShiftRolesByBusinessAndDateRangeShiftRolesShift shift;
  ListShiftRolesByBusinessAndDateRangeShiftRoles.fromJson(dynamic json):
  
  shiftId = nativeFromJson<String>(json['shiftId']),
  roleId = nativeFromJson<String>(json['roleId']),
  count = nativeFromJson<int>(json['count']),
  assigned = json['assigned'] == null ? null : nativeFromJson<int>(json['assigned']),
  hours = json['hours'] == null ? null : nativeFromJson<double>(json['hours']),
  startTime = json['startTime'] == null ? null : Timestamp.fromJson(json['startTime']),
  endTime = json['endTime'] == null ? null : Timestamp.fromJson(json['endTime']),
  totalValue = json['totalValue'] == null ? null : nativeFromJson<double>(json['totalValue']),
  role = ListShiftRolesByBusinessAndDateRangeShiftRolesRole.fromJson(json['role']),
  shift = ListShiftRolesByBusinessAndDateRangeShiftRolesShift.fromJson(json['shift']);
  @override
  bool operator ==(Object other) {
    if(identical(this, other)) {
      return true;
    }
    if(other.runtimeType != runtimeType) {
      return false;
    }

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

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

  ListShiftRolesByBusinessAndDateRangeShiftRoles({
    required this.shiftId,
    required this.roleId,
    required this.count,
    this.assigned,
    this.hours,
    this.startTime,
    this.endTime,
    this.totalValue,
    required this.role,
    required this.shift,
  });
}

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

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

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

  ListShiftRolesByBusinessAndDateRangeShiftRolesRole({
    required this.id,
    required this.name,
  });
}

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

    final ListShiftRolesByBusinessAndDateRangeShiftRolesShift otherTyped = other as ListShiftRolesByBusinessAndDateRangeShiftRolesShift;
    return id == otherTyped.id && 
    date == otherTyped.date && 
    location == otherTyped.location && 
    locationAddress == otherTyped.locationAddress && 
    title == otherTyped.title && 
    status == otherTyped.status && 
    order == otherTyped.order;
    
  }
  @override
  int get hashCode => Object.hashAll([id.hashCode, date.hashCode, location.hashCode, locationAddress.hashCode, title.hashCode, status.hashCode, order.hashCode]);
  

  Map<String, dynamic> toJson() {
    Map<String, dynamic> json = {};
    json['id'] = nativeToJson<String>(id);
    if (date != null) {
      json['date'] = date!.toJson();
    }
    if (location != null) {
      json['location'] = nativeToJson<String?>(location);
    }
    if (locationAddress != null) {
      json['locationAddress'] = nativeToJson<String?>(locationAddress);
    }
    json['title'] = nativeToJson<String>(title);
    if (status != null) {
      json['status'] = 
    shiftStatusSerializer(status!)
    ;
    }
    json['order'] = order.toJson();
    return json;
  }

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

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

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

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

  ListShiftRolesByBusinessAndDateRangeShiftRolesShiftOrder({
    required this.id,
    this.eventName,
  });
}

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

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

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

@immutable
class ListShiftRolesByBusinessAndDateRangeVariables {
  final String businessId;
  final Timestamp start;
  final Timestamp end;
  late final Optional<int>offset;
  late final Optional<int>limit;
  late final Optional<ShiftStatus>status;
  @Deprecated('fromJson is deprecated for Variable classes as they are no longer required for deserialization.')
  ListShiftRolesByBusinessAndDateRangeVariables.fromJson(Map<String, dynamic> json):
  
  businessId = nativeFromJson<String>(json['businessId']),
  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']);
  
  
    status = Optional.optional((data) => ShiftStatus.values.byName(data), enumSerializer);
    status.value = json['status'] == null ? null : ShiftStatus.values.byName(json['status']);
  
  }
  @override
  bool operator ==(Object other) {
    if(identical(this, other)) {
      return true;
    }
    if(other.runtimeType != runtimeType) {
      return false;
    }

    final ListShiftRolesByBusinessAndDateRangeVariables otherTyped = other as ListShiftRolesByBusinessAndDateRangeVariables;
    return businessId == otherTyped.businessId && 
    start == otherTyped.start && 
    end == otherTyped.end && 
    offset == otherTyped.offset && 
    limit == otherTyped.limit && 
    status == otherTyped.status;
    
  }
  @override
  int get hashCode => Object.hashAll([businessId.hashCode, start.hashCode, end.hashCode, offset.hashCode, limit.hashCode, status.hashCode]);
  

  Map<String, dynamic> toJson() {
    Map<String, dynamic> json = {};
    json['businessId'] = nativeToJson<String>(businessId);
    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();
    }
    if(status.state == OptionalState.set) {
      json['status'] = status.toJson();
    }
    return json;
  }

  ListShiftRolesByBusinessAndDateRangeVariables({
    required this.businessId,
    required this.start,
    required this.end,
    required this.offset,
    required this.limit,
    required this.status,
  });
}

