part of 'generated.dart';

class CreateShiftVariablesBuilder {
  String title;
  String orderId;
  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);
  Optional<String> _createdBy = Optional.optional(nativeFromJson, nativeToJson);

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

  CreateShiftVariablesBuilder(this._dataConnect, {required  this.title,required  this.orderId,});
  Deserializer<CreateShiftData> dataDeserializer = (dynamic json)  => CreateShiftData.fromJson(jsonDecode(json));
  Serializer<CreateShiftVariables> varsSerializer = (CreateShiftVariables vars) => jsonEncode(vars.toJson());
  Future<OperationResult<CreateShiftData, CreateShiftVariables>> execute() {
    return ref().execute();
  }

  MutationRef<CreateShiftData, CreateShiftVariables> ref() {
    CreateShiftVariables vars= CreateShiftVariables(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,createdBy: _createdBy,);
    return _dataConnect.mutation("createShift", dataDeserializer, varsSerializer, vars);
  }
}

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

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

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

    final CreateShiftData otherTyped = other as CreateShiftData;
    return shift_insert == otherTyped.shift_insert;
    
  }
  @override
  int get hashCode => shift_insert.hashCode;
  

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

  CreateShiftData({
    required this.shift_insert,
  });
}

@immutable
class CreateShiftVariables {
  final String title;
  final 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;
  late final Optional<String>createdBy;
  @Deprecated('fromJson is deprecated for Variable classes as they are no longer required for deserialization.')
  CreateShiftVariables.fromJson(Map<String, dynamic> json):
  
  title = nativeFromJson<String>(json['title']),
  orderId = 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']);
  
  
    createdBy = Optional.optional(nativeFromJson, nativeToJson);
    createdBy.value = json['createdBy'] == null ? null : nativeFromJson<String>(json['createdBy']);
  
  }
  @override
  bool operator ==(Object other) {
    if(identical(this, other)) {
      return true;
    }
    if(other.runtimeType != runtimeType) {
      return false;
    }

    final CreateShiftVariables otherTyped = other as CreateShiftVariables;
    return 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 && 
    createdBy == otherTyped.createdBy;
    
  }
  @override
  int get hashCode => Object.hashAll([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, createdBy.hashCode]);
  

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

  CreateShiftVariables({
    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,
    required this.createdBy,
  });
}

