part of 'generated.dart';

class UpdateShiftVariablesBuilder {
  String id;
  Optional<String> _title = Optional.optional(nativeFromJson, nativeToJson);
  Optional<String> _orderId = Optional.optional(nativeFromJson, nativeToJson);
  Optional<Timestamp> _date = Optional.optional((json) => json['date'] = Timestamp.fromJson(json['date']), defaultSerializer);
  Optional<Timestamp> _startTime = Optional.optional((json) => json['startTime'] = Timestamp.fromJson(json['startTime']), defaultSerializer);
  Optional<Timestamp> _endTime = Optional.optional((json) => json['endTime'] = Timestamp.fromJson(json['endTime']), defaultSerializer);
  Optional<double> _hours = Optional.optional(nativeFromJson, nativeToJson);
  Optional<double> _cost = Optional.optional(nativeFromJson, nativeToJson);
  Optional<String> _location = Optional.optional(nativeFromJson, nativeToJson);
  Optional<String> _locationAddress = Optional.optional(nativeFromJson, nativeToJson);
  Optional<double> _latitude = Optional.optional(nativeFromJson, nativeToJson);
  Optional<double> _longitude = Optional.optional(nativeFromJson, nativeToJson);
  Optional<String> _placeId = Optional.optional(nativeFromJson, nativeToJson);
  Optional<String> _city = Optional.optional(nativeFromJson, nativeToJson);
  Optional<String> _state = Optional.optional(nativeFromJson, nativeToJson);
  Optional<String> _street = Optional.optional(nativeFromJson, nativeToJson);
  Optional<String> _country = Optional.optional(nativeFromJson, nativeToJson);
  Optional<String> _description = Optional.optional(nativeFromJson, nativeToJson);
  Optional<ShiftStatus> _status = Optional.optional((data) => ShiftStatus.values.byName(data), enumSerializer);
  Optional<int> _workersNeeded = Optional.optional(nativeFromJson, nativeToJson);
  Optional<int> _filled = Optional.optional(nativeFromJson, nativeToJson);
  Optional<Timestamp> _filledAt = Optional.optional((json) => json['filledAt'] = Timestamp.fromJson(json['filledAt']), defaultSerializer);
  Optional<List<AnyValue>> _managers = Optional.optional(listDeserializer(AnyValue.fromJson), listSerializer(defaultSerializer));
  Optional<int> _durationDays = Optional.optional(nativeFromJson, nativeToJson);

  final FirebaseDataConnect _dataConnect;  UpdateShiftVariablesBuilder title(String? t) {
   _title.value = t;
   return this;
  }
  UpdateShiftVariablesBuilder orderId(String? t) {
   _orderId.value = t;
   return this;
  }
  UpdateShiftVariablesBuilder date(Timestamp? t) {
   _date.value = t;
   return this;
  }
  UpdateShiftVariablesBuilder startTime(Timestamp? t) {
   _startTime.value = t;
   return this;
  }
  UpdateShiftVariablesBuilder endTime(Timestamp? t) {
   _endTime.value = t;
   return this;
  }
  UpdateShiftVariablesBuilder hours(double? t) {
   _hours.value = t;
   return this;
  }
  UpdateShiftVariablesBuilder cost(double? t) {
   _cost.value = t;
   return this;
  }
  UpdateShiftVariablesBuilder location(String? t) {
   _location.value = t;
   return this;
  }
  UpdateShiftVariablesBuilder locationAddress(String? t) {
   _locationAddress.value = t;
   return this;
  }
  UpdateShiftVariablesBuilder latitude(double? t) {
   _latitude.value = t;
   return this;
  }
  UpdateShiftVariablesBuilder longitude(double? t) {
   _longitude.value = t;
   return this;
  }
  UpdateShiftVariablesBuilder placeId(String? t) {
   _placeId.value = t;
   return this;
  }
  UpdateShiftVariablesBuilder city(String? t) {
   _city.value = t;
   return this;
  }
  UpdateShiftVariablesBuilder state(String? t) {
   _state.value = t;
   return this;
  }
  UpdateShiftVariablesBuilder street(String? t) {
   _street.value = t;
   return this;
  }
  UpdateShiftVariablesBuilder country(String? t) {
   _country.value = t;
   return this;
  }
  UpdateShiftVariablesBuilder description(String? t) {
   _description.value = t;
   return this;
  }
  UpdateShiftVariablesBuilder status(ShiftStatus? t) {
   _status.value = t;
   return this;
  }
  UpdateShiftVariablesBuilder workersNeeded(int? t) {
   _workersNeeded.value = t;
   return this;
  }
  UpdateShiftVariablesBuilder filled(int? t) {
   _filled.value = t;
   return this;
  }
  UpdateShiftVariablesBuilder filledAt(Timestamp? t) {
   _filledAt.value = t;
   return this;
  }
  UpdateShiftVariablesBuilder managers(List<AnyValue>? t) {
   _managers.value = t;
   return this;
  }
  UpdateShiftVariablesBuilder durationDays(int? t) {
   _durationDays.value = t;
   return this;
  }

  UpdateShiftVariablesBuilder(this._dataConnect, {required  this.id,});
  Deserializer<UpdateShiftData> dataDeserializer = (dynamic json)  => UpdateShiftData.fromJson(jsonDecode(json));
  Serializer<UpdateShiftVariables> varsSerializer = (UpdateShiftVariables vars) => jsonEncode(vars.toJson());
  Future<OperationResult<UpdateShiftData, UpdateShiftVariables>> execute() {
    return ref().execute();
  }

  MutationRef<UpdateShiftData, UpdateShiftVariables> ref() {
    UpdateShiftVariables vars= UpdateShiftVariables(id: id,title: _title,orderId: _orderId,date: _date,startTime: _startTime,endTime: _endTime,hours: _hours,cost: _cost,location: _location,locationAddress: _locationAddress,latitude: _latitude,longitude: _longitude,placeId: _placeId,city: _city,state: _state,street: _street,country: _country,description: _description,status: _status,workersNeeded: _workersNeeded,filled: _filled,filledAt: _filledAt,managers: _managers,durationDays: _durationDays,);
    return _dataConnect.mutation("updateShift", dataDeserializer, varsSerializer, vars);
  }
}

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

    final UpdateShiftShiftUpdate otherTyped = other as UpdateShiftShiftUpdate;
    return id == otherTyped.id;
    
  }
  @override
  int get hashCode => id.hashCode;
  

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

  UpdateShiftShiftUpdate({
    required this.id,
  });
}

@immutable
class UpdateShiftData {
  final UpdateShiftShiftUpdate? shift_update;
  UpdateShiftData.fromJson(dynamic json):
  
  shift_update = json['shift_update'] == null ? null : UpdateShiftShiftUpdate.fromJson(json['shift_update']);
  @override
  bool operator ==(Object other) {
    if(identical(this, other)) {
      return true;
    }
    if(other.runtimeType != runtimeType) {
      return false;
    }

    final UpdateShiftData otherTyped = other as UpdateShiftData;
    return shift_update == otherTyped.shift_update;
    
  }
  @override
  int get hashCode => shift_update.hashCode;
  

  Map<String, dynamic> toJson() {
    Map<String, dynamic> json = {};
    if (shift_update != null) {
      json['shift_update'] = shift_update!.toJson();
    }
    return json;
  }

  UpdateShiftData({
    this.shift_update,
  });
}

@immutable
class UpdateShiftVariables {
  final String id;
  late final Optional<String>title;
  late final Optional<String>orderId;
  late final Optional<Timestamp>date;
  late final Optional<Timestamp>startTime;
  late final Optional<Timestamp>endTime;
  late final Optional<double>hours;
  late final Optional<double>cost;
  late final Optional<String>location;
  late final Optional<String>locationAddress;
  late final Optional<double>latitude;
  late final Optional<double>longitude;
  late final Optional<String>placeId;
  late final Optional<String>city;
  late final Optional<String>state;
  late final Optional<String>street;
  late final Optional<String>country;
  late final Optional<String>description;
  late final Optional<ShiftStatus>status;
  late final Optional<int>workersNeeded;
  late final Optional<int>filled;
  late final Optional<Timestamp>filledAt;
  late final Optional<List<AnyValue>>managers;
  late final Optional<int>durationDays;
  @Deprecated('fromJson is deprecated for Variable classes as they are no longer required for deserialization.')
  UpdateShiftVariables.fromJson(Map<String, dynamic> json):
  
  id = nativeFromJson<String>(json['id']) {
  
  
  
    title = Optional.optional(nativeFromJson, nativeToJson);
    title.value = json['title'] == null ? null : nativeFromJson<String>(json['title']);
  
  
    orderId = Optional.optional(nativeFromJson, nativeToJson);
    orderId.value = json['orderId'] == null ? null : nativeFromJson<String>(json['orderId']);
  
  
    date = Optional.optional((json) => json['date'] = Timestamp.fromJson(json['date']), defaultSerializer);
    date.value = json['date'] == null ? null : Timestamp.fromJson(json['date']);
  
  
    startTime = Optional.optional((json) => json['startTime'] = Timestamp.fromJson(json['startTime']), defaultSerializer);
    startTime.value = json['startTime'] == null ? null : Timestamp.fromJson(json['startTime']);
  
  
    endTime = Optional.optional((json) => json['endTime'] = Timestamp.fromJson(json['endTime']), defaultSerializer);
    endTime.value = json['endTime'] == null ? null : Timestamp.fromJson(json['endTime']);
  
  
    hours = Optional.optional(nativeFromJson, nativeToJson);
    hours.value = json['hours'] == null ? null : nativeFromJson<double>(json['hours']);
  
  
    cost = Optional.optional(nativeFromJson, nativeToJson);
    cost.value = json['cost'] == null ? null : nativeFromJson<double>(json['cost']);
  
  
    location = Optional.optional(nativeFromJson, nativeToJson);
    location.value = json['location'] == null ? null : nativeFromJson<String>(json['location']);
  
  
    locationAddress = Optional.optional(nativeFromJson, nativeToJson);
    locationAddress.value = json['locationAddress'] == null ? null : nativeFromJson<String>(json['locationAddress']);
  
  
    latitude = Optional.optional(nativeFromJson, nativeToJson);
    latitude.value = json['latitude'] == null ? null : nativeFromJson<double>(json['latitude']);
  
  
    longitude = Optional.optional(nativeFromJson, nativeToJson);
    longitude.value = json['longitude'] == null ? null : nativeFromJson<double>(json['longitude']);
  
  
    placeId = Optional.optional(nativeFromJson, nativeToJson);
    placeId.value = json['placeId'] == null ? null : nativeFromJson<String>(json['placeId']);
  
  
    city = Optional.optional(nativeFromJson, nativeToJson);
    city.value = json['city'] == null ? null : nativeFromJson<String>(json['city']);
  
  
    state = Optional.optional(nativeFromJson, nativeToJson);
    state.value = json['state'] == null ? null : nativeFromJson<String>(json['state']);
  
  
    street = Optional.optional(nativeFromJson, nativeToJson);
    street.value = json['street'] == null ? null : nativeFromJson<String>(json['street']);
  
  
    country = Optional.optional(nativeFromJson, nativeToJson);
    country.value = json['country'] == null ? null : nativeFromJson<String>(json['country']);
  
  
    description = Optional.optional(nativeFromJson, nativeToJson);
    description.value = json['description'] == null ? null : nativeFromJson<String>(json['description']);
  
  
    status = Optional.optional((data) => ShiftStatus.values.byName(data), enumSerializer);
    status.value = json['status'] == null ? null : ShiftStatus.values.byName(json['status']);
  
  
    workersNeeded = Optional.optional(nativeFromJson, nativeToJson);
    workersNeeded.value = json['workersNeeded'] == null ? null : nativeFromJson<int>(json['workersNeeded']);
  
  
    filled = Optional.optional(nativeFromJson, nativeToJson);
    filled.value = json['filled'] == null ? null : nativeFromJson<int>(json['filled']);
  
  
    filledAt = Optional.optional((json) => json['filledAt'] = Timestamp.fromJson(json['filledAt']), defaultSerializer);
    filledAt.value = json['filledAt'] == null ? null : Timestamp.fromJson(json['filledAt']);
  
  
    managers = Optional.optional(listDeserializer(AnyValue.fromJson), listSerializer(defaultSerializer));
    managers.value = json['managers'] == null ? null : (json['managers'] as List<dynamic>)
        .map((e) => AnyValue.fromJson(e))
        .toList();
  
  
    durationDays = Optional.optional(nativeFromJson, nativeToJson);
    durationDays.value = json['durationDays'] == null ? null : nativeFromJson<int>(json['durationDays']);
  
  }
  @override
  bool operator ==(Object other) {
    if(identical(this, other)) {
      return true;
    }
    if(other.runtimeType != runtimeType) {
      return false;
    }

    final UpdateShiftVariables otherTyped = other as UpdateShiftVariables;
    return id == otherTyped.id && 
    title == otherTyped.title && 
    orderId == otherTyped.orderId && 
    date == otherTyped.date && 
    startTime == otherTyped.startTime && 
    endTime == otherTyped.endTime && 
    hours == otherTyped.hours && 
    cost == otherTyped.cost && 
    location == otherTyped.location && 
    locationAddress == otherTyped.locationAddress && 
    latitude == otherTyped.latitude && 
    longitude == otherTyped.longitude && 
    placeId == otherTyped.placeId && 
    city == otherTyped.city && 
    state == otherTyped.state && 
    street == otherTyped.street && 
    country == otherTyped.country && 
    description == otherTyped.description && 
    status == otherTyped.status && 
    workersNeeded == otherTyped.workersNeeded && 
    filled == otherTyped.filled && 
    filledAt == otherTyped.filledAt && 
    managers == otherTyped.managers && 
    durationDays == otherTyped.durationDays;
    
  }
  @override
  int get hashCode => Object.hashAll([id.hashCode, title.hashCode, orderId.hashCode, date.hashCode, startTime.hashCode, endTime.hashCode, hours.hashCode, cost.hashCode, location.hashCode, locationAddress.hashCode, latitude.hashCode, longitude.hashCode, placeId.hashCode, city.hashCode, state.hashCode, street.hashCode, country.hashCode, description.hashCode, status.hashCode, workersNeeded.hashCode, filled.hashCode, filledAt.hashCode, managers.hashCode, durationDays.hashCode]);
  

  Map<String, dynamic> toJson() {
    Map<String, dynamic> json = {};
    json['id'] = nativeToJson<String>(id);
    if(title.state == OptionalState.set) {
      json['title'] = title.toJson();
    }
    if(orderId.state == OptionalState.set) {
      json['orderId'] = orderId.toJson();
    }
    if(date.state == OptionalState.set) {
      json['date'] = date.toJson();
    }
    if(startTime.state == OptionalState.set) {
      json['startTime'] = startTime.toJson();
    }
    if(endTime.state == OptionalState.set) {
      json['endTime'] = endTime.toJson();
    }
    if(hours.state == OptionalState.set) {
      json['hours'] = hours.toJson();
    }
    if(cost.state == OptionalState.set) {
      json['cost'] = cost.toJson();
    }
    if(location.state == OptionalState.set) {
      json['location'] = location.toJson();
    }
    if(locationAddress.state == OptionalState.set) {
      json['locationAddress'] = locationAddress.toJson();
    }
    if(latitude.state == OptionalState.set) {
      json['latitude'] = latitude.toJson();
    }
    if(longitude.state == OptionalState.set) {
      json['longitude'] = longitude.toJson();
    }
    if(placeId.state == OptionalState.set) {
      json['placeId'] = placeId.toJson();
    }
    if(city.state == OptionalState.set) {
      json['city'] = city.toJson();
    }
    if(state.state == OptionalState.set) {
      json['state'] = state.toJson();
    }
    if(street.state == OptionalState.set) {
      json['street'] = street.toJson();
    }
    if(country.state == OptionalState.set) {
      json['country'] = country.toJson();
    }
    if(description.state == OptionalState.set) {
      json['description'] = description.toJson();
    }
    if(status.state == OptionalState.set) {
      json['status'] = status.toJson();
    }
    if(workersNeeded.state == OptionalState.set) {
      json['workersNeeded'] = workersNeeded.toJson();
    }
    if(filled.state == OptionalState.set) {
      json['filled'] = filled.toJson();
    }
    if(filledAt.state == OptionalState.set) {
      json['filledAt'] = filledAt.toJson();
    }
    if(managers.state == OptionalState.set) {
      json['managers'] = managers.toJson();
    }
    if(durationDays.state == OptionalState.set) {
      json['durationDays'] = durationDays.toJson();
    }
    return json;
  }

  UpdateShiftVariables({
    required this.id,
    required this.title,
    required this.orderId,
    required this.date,
    required this.startTime,
    required this.endTime,
    required this.hours,
    required this.cost,
    required this.location,
    required this.locationAddress,
    required this.latitude,
    required this.longitude,
    required this.placeId,
    required this.city,
    required this.state,
    required this.street,
    required this.country,
    required this.description,
    required this.status,
    required this.workersNeeded,
    required this.filled,
    required this.filledAt,
    required this.managers,
    required this.durationDays,
  });
}

