part of 'generated.dart';

class UpdateOrderVariablesBuilder {
  String id;
  Optional<String> _vendorId = Optional.optional(nativeFromJson, nativeToJson);
  Optional<String> _businessId = Optional.optional(nativeFromJson, nativeToJson);
  Optional<String> _location = Optional.optional(nativeFromJson, nativeToJson);
  Optional<OrderStatus> _status = Optional.optional((data) => OrderStatus.values.byName(data), enumSerializer);
  Optional<Timestamp> _date = Optional.optional((json) => json['date'] = Timestamp.fromJson(json['date']), defaultSerializer);
  Optional<Timestamp> _startDate = Optional.optional((json) => json['startDate'] = Timestamp.fromJson(json['startDate']), defaultSerializer);
  Optional<Timestamp> _endDate = Optional.optional((json) => json['endDate'] = Timestamp.fromJson(json['endDate']), defaultSerializer);
  Optional<double> _total = Optional.optional(nativeFromJson, nativeToJson);
  Optional<String> _eventName = Optional.optional(nativeFromJson, nativeToJson);
  Optional<AnyValue> _assignedStaff = Optional.optional(AnyValue.fromJson, defaultSerializer);
  Optional<AnyValue> _shifts = Optional.optional(AnyValue.fromJson, defaultSerializer);
  Optional<int> _requested = Optional.optional(nativeFromJson, nativeToJson);
  Optional<String> _hub = Optional.optional(nativeFromJson, nativeToJson);
  Optional<AnyValue> _recurringDays = Optional.optional(AnyValue.fromJson, defaultSerializer);
  Optional<AnyValue> _permanentDays = Optional.optional(AnyValue.fromJson, defaultSerializer);
  Optional<String> _notes = Optional.optional(nativeFromJson, nativeToJson);
  Optional<AnyValue> _detectedConflicts = Optional.optional(AnyValue.fromJson, defaultSerializer);
  Optional<String> _poReference = Optional.optional(nativeFromJson, nativeToJson);

  final FirebaseDataConnect _dataConnect;  UpdateOrderVariablesBuilder vendorId(String? t) {
   _vendorId.value = t;
   return this;
  }
  UpdateOrderVariablesBuilder businessId(String? t) {
   _businessId.value = t;
   return this;
  }
  UpdateOrderVariablesBuilder location(String? t) {
   _location.value = t;
   return this;
  }
  UpdateOrderVariablesBuilder status(OrderStatus? t) {
   _status.value = t;
   return this;
  }
  UpdateOrderVariablesBuilder date(Timestamp? t) {
   _date.value = t;
   return this;
  }
  UpdateOrderVariablesBuilder startDate(Timestamp? t) {
   _startDate.value = t;
   return this;
  }
  UpdateOrderVariablesBuilder endDate(Timestamp? t) {
   _endDate.value = t;
   return this;
  }
  UpdateOrderVariablesBuilder total(double? t) {
   _total.value = t;
   return this;
  }
  UpdateOrderVariablesBuilder eventName(String? t) {
   _eventName.value = t;
   return this;
  }
  UpdateOrderVariablesBuilder assignedStaff(AnyValue? t) {
   _assignedStaff.value = t;
   return this;
  }
  UpdateOrderVariablesBuilder shifts(AnyValue? t) {
   _shifts.value = t;
   return this;
  }
  UpdateOrderVariablesBuilder requested(int? t) {
   _requested.value = t;
   return this;
  }
  UpdateOrderVariablesBuilder hub(String? t) {
   _hub.value = t;
   return this;
  }
  UpdateOrderVariablesBuilder recurringDays(AnyValue? t) {
   _recurringDays.value = t;
   return this;
  }
  UpdateOrderVariablesBuilder permanentDays(AnyValue? t) {
   _permanentDays.value = t;
   return this;
  }
  UpdateOrderVariablesBuilder notes(String? t) {
   _notes.value = t;
   return this;
  }
  UpdateOrderVariablesBuilder detectedConflicts(AnyValue? t) {
   _detectedConflicts.value = t;
   return this;
  }
  UpdateOrderVariablesBuilder poReference(String? t) {
   _poReference.value = t;
   return this;
  }

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

  MutationRef<UpdateOrderData, UpdateOrderVariables> ref() {
    UpdateOrderVariables vars= UpdateOrderVariables(id: id,vendorId: _vendorId,businessId: _businessId,location: _location,status: _status,date: _date,startDate: _startDate,endDate: _endDate,total: _total,eventName: _eventName,assignedStaff: _assignedStaff,shifts: _shifts,requested: _requested,hub: _hub,recurringDays: _recurringDays,permanentDays: _permanentDays,notes: _notes,detectedConflicts: _detectedConflicts,poReference: _poReference,);
    return _dataConnect.mutation("updateOrder", dataDeserializer, varsSerializer, vars);
  }
}

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

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

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

    final UpdateOrderData otherTyped = other as UpdateOrderData;
    return order_update == otherTyped.order_update;
    
  }
  @override
  int get hashCode => order_update.hashCode;
  

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

  UpdateOrderData({
    this.order_update,
  });
}

@immutable
class UpdateOrderVariables {
  final String id;
  late final Optional<String>vendorId;
  late final Optional<String>businessId;
  late final Optional<String>location;
  late final Optional<OrderStatus>status;
  late final Optional<Timestamp>date;
  late final Optional<Timestamp>startDate;
  late final Optional<Timestamp>endDate;
  late final Optional<double>total;
  late final Optional<String>eventName;
  late final Optional<AnyValue>assignedStaff;
  late final Optional<AnyValue>shifts;
  late final Optional<int>requested;
  late final Optional<String>hub;
  late final Optional<AnyValue>recurringDays;
  late final Optional<AnyValue>permanentDays;
  late final Optional<String>notes;
  late final Optional<AnyValue>detectedConflicts;
  late final Optional<String>poReference;
  @Deprecated('fromJson is deprecated for Variable classes as they are no longer required for deserialization.')
  UpdateOrderVariables.fromJson(Map<String, dynamic> json):
  
  id = nativeFromJson<String>(json['id']) {
  
  
  
    vendorId = Optional.optional(nativeFromJson, nativeToJson);
    vendorId.value = json['vendorId'] == null ? null : nativeFromJson<String>(json['vendorId']);
  
  
    businessId = Optional.optional(nativeFromJson, nativeToJson);
    businessId.value = json['businessId'] == null ? null : nativeFromJson<String>(json['businessId']);
  
  
    location = Optional.optional(nativeFromJson, nativeToJson);
    location.value = json['location'] == null ? null : nativeFromJson<String>(json['location']);
  
  
    status = Optional.optional((data) => OrderStatus.values.byName(data), enumSerializer);
    status.value = json['status'] == null ? null : OrderStatus.values.byName(json['status']);
  
  
    date = Optional.optional((json) => json['date'] = Timestamp.fromJson(json['date']), defaultSerializer);
    date.value = json['date'] == null ? null : Timestamp.fromJson(json['date']);
  
  
    startDate = Optional.optional((json) => json['startDate'] = Timestamp.fromJson(json['startDate']), defaultSerializer);
    startDate.value = json['startDate'] == null ? null : Timestamp.fromJson(json['startDate']);
  
  
    endDate = Optional.optional((json) => json['endDate'] = Timestamp.fromJson(json['endDate']), defaultSerializer);
    endDate.value = json['endDate'] == null ? null : Timestamp.fromJson(json['endDate']);
  
  
    total = Optional.optional(nativeFromJson, nativeToJson);
    total.value = json['total'] == null ? null : nativeFromJson<double>(json['total']);
  
  
    eventName = Optional.optional(nativeFromJson, nativeToJson);
    eventName.value = json['eventName'] == null ? null : nativeFromJson<String>(json['eventName']);
  
  
    assignedStaff = Optional.optional(AnyValue.fromJson, defaultSerializer);
    assignedStaff.value = json['assignedStaff'] == null ? null : AnyValue.fromJson(json['assignedStaff']);
  
  
    shifts = Optional.optional(AnyValue.fromJson, defaultSerializer);
    shifts.value = json['shifts'] == null ? null : AnyValue.fromJson(json['shifts']);
  
  
    requested = Optional.optional(nativeFromJson, nativeToJson);
    requested.value = json['requested'] == null ? null : nativeFromJson<int>(json['requested']);
  
  
    hub = Optional.optional(nativeFromJson, nativeToJson);
    hub.value = json['hub'] == null ? null : nativeFromJson<String>(json['hub']);
  
  
    recurringDays = Optional.optional(AnyValue.fromJson, defaultSerializer);
    recurringDays.value = json['recurringDays'] == null ? null : AnyValue.fromJson(json['recurringDays']);
  
  
    permanentDays = Optional.optional(AnyValue.fromJson, defaultSerializer);
    permanentDays.value = json['permanentDays'] == null ? null : AnyValue.fromJson(json['permanentDays']);
  
  
    notes = Optional.optional(nativeFromJson, nativeToJson);
    notes.value = json['notes'] == null ? null : nativeFromJson<String>(json['notes']);
  
  
    detectedConflicts = Optional.optional(AnyValue.fromJson, defaultSerializer);
    detectedConflicts.value = json['detectedConflicts'] == null ? null : AnyValue.fromJson(json['detectedConflicts']);
  
  
    poReference = Optional.optional(nativeFromJson, nativeToJson);
    poReference.value = json['poReference'] == null ? null : nativeFromJson<String>(json['poReference']);
  
  }
  @override
  bool operator ==(Object other) {
    if(identical(this, other)) {
      return true;
    }
    if(other.runtimeType != runtimeType) {
      return false;
    }

    final UpdateOrderVariables otherTyped = other as UpdateOrderVariables;
    return id == otherTyped.id && 
    vendorId == otherTyped.vendorId && 
    businessId == otherTyped.businessId && 
    location == otherTyped.location && 
    status == otherTyped.status && 
    date == otherTyped.date && 
    startDate == otherTyped.startDate && 
    endDate == otherTyped.endDate && 
    total == otherTyped.total && 
    eventName == otherTyped.eventName && 
    assignedStaff == otherTyped.assignedStaff && 
    shifts == otherTyped.shifts && 
    requested == otherTyped.requested && 
    hub == otherTyped.hub && 
    recurringDays == otherTyped.recurringDays && 
    permanentDays == otherTyped.permanentDays && 
    notes == otherTyped.notes && 
    detectedConflicts == otherTyped.detectedConflicts && 
    poReference == otherTyped.poReference;
    
  }
  @override
  int get hashCode => Object.hashAll([id.hashCode, vendorId.hashCode, businessId.hashCode, location.hashCode, status.hashCode, date.hashCode, startDate.hashCode, endDate.hashCode, total.hashCode, eventName.hashCode, assignedStaff.hashCode, shifts.hashCode, requested.hashCode, hub.hashCode, recurringDays.hashCode, permanentDays.hashCode, notes.hashCode, detectedConflicts.hashCode, poReference.hashCode]);
  

  Map<String, dynamic> toJson() {
    Map<String, dynamic> json = {};
    json['id'] = nativeToJson<String>(id);
    if(vendorId.state == OptionalState.set) {
      json['vendorId'] = vendorId.toJson();
    }
    if(businessId.state == OptionalState.set) {
      json['businessId'] = businessId.toJson();
    }
    if(location.state == OptionalState.set) {
      json['location'] = location.toJson();
    }
    if(status.state == OptionalState.set) {
      json['status'] = status.toJson();
    }
    if(date.state == OptionalState.set) {
      json['date'] = date.toJson();
    }
    if(startDate.state == OptionalState.set) {
      json['startDate'] = startDate.toJson();
    }
    if(endDate.state == OptionalState.set) {
      json['endDate'] = endDate.toJson();
    }
    if(total.state == OptionalState.set) {
      json['total'] = total.toJson();
    }
    if(eventName.state == OptionalState.set) {
      json['eventName'] = eventName.toJson();
    }
    if(assignedStaff.state == OptionalState.set) {
      json['assignedStaff'] = assignedStaff.toJson();
    }
    if(shifts.state == OptionalState.set) {
      json['shifts'] = shifts.toJson();
    }
    if(requested.state == OptionalState.set) {
      json['requested'] = requested.toJson();
    }
    if(hub.state == OptionalState.set) {
      json['hub'] = hub.toJson();
    }
    if(recurringDays.state == OptionalState.set) {
      json['recurringDays'] = recurringDays.toJson();
    }
    if(permanentDays.state == OptionalState.set) {
      json['permanentDays'] = permanentDays.toJson();
    }
    if(notes.state == OptionalState.set) {
      json['notes'] = notes.toJson();
    }
    if(detectedConflicts.state == OptionalState.set) {
      json['detectedConflicts'] = detectedConflicts.toJson();
    }
    if(poReference.state == OptionalState.set) {
      json['poReference'] = poReference.toJson();
    }
    return json;
  }

  UpdateOrderVariables({
    required this.id,
    required this.vendorId,
    required this.businessId,
    required this.location,
    required this.status,
    required this.date,
    required this.startDate,
    required this.endDate,
    required this.total,
    required this.eventName,
    required this.assignedStaff,
    required this.shifts,
    required this.requested,
    required this.hub,
    required this.recurringDays,
    required this.permanentDays,
    required this.notes,
    required this.detectedConflicts,
    required this.poReference,
  });
}

