part of 'generated.dart';

class UpdateApplicationStatusVariablesBuilder {
  String id;
  Optional<String> _shiftId = Optional.optional(nativeFromJson, nativeToJson);
  Optional<String> _staffId = Optional.optional(nativeFromJson, nativeToJson);
  Optional<ApplicationStatus> _status = Optional.optional((data) => ApplicationStatus.values.byName(data), enumSerializer);
  Optional<Timestamp> _checkInTime = Optional.optional((json) => json['checkInTime'] = Timestamp.fromJson(json['checkInTime']), defaultSerializer);
  Optional<Timestamp> _checkOutTime = Optional.optional((json) => json['checkOutTime'] = Timestamp.fromJson(json['checkOutTime']), defaultSerializer);
  String roleId;

  final FirebaseDataConnect _dataConnect;  UpdateApplicationStatusVariablesBuilder shiftId(String? t) {
   _shiftId.value = t;
   return this;
  }
  UpdateApplicationStatusVariablesBuilder staffId(String? t) {
   _staffId.value = t;
   return this;
  }
  UpdateApplicationStatusVariablesBuilder status(ApplicationStatus? t) {
   _status.value = t;
   return this;
  }
  UpdateApplicationStatusVariablesBuilder checkInTime(Timestamp? t) {
   _checkInTime.value = t;
   return this;
  }
  UpdateApplicationStatusVariablesBuilder checkOutTime(Timestamp? t) {
   _checkOutTime.value = t;
   return this;
  }

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

  MutationRef<UpdateApplicationStatusData, UpdateApplicationStatusVariables> ref() {
    UpdateApplicationStatusVariables vars= UpdateApplicationStatusVariables(id: id,shiftId: _shiftId,staffId: _staffId,status: _status,checkInTime: _checkInTime,checkOutTime: _checkOutTime,roleId: roleId,);
    return _dataConnect.mutation("updateApplicationStatus", dataDeserializer, varsSerializer, vars);
  }
}

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

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

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

    final UpdateApplicationStatusData otherTyped = other as UpdateApplicationStatusData;
    return application_update == otherTyped.application_update;
    
  }
  @override
  int get hashCode => application_update.hashCode;
  

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

  UpdateApplicationStatusData({
    this.application_update,
  });
}

@immutable
class UpdateApplicationStatusVariables {
  final String id;
  late final Optional<String>shiftId;
  late final Optional<String>staffId;
  late final Optional<ApplicationStatus>status;
  late final Optional<Timestamp>checkInTime;
  late final Optional<Timestamp>checkOutTime;
  final String roleId;
  @Deprecated('fromJson is deprecated for Variable classes as they are no longer required for deserialization.')
  UpdateApplicationStatusVariables.fromJson(Map<String, dynamic> json):
  
  id = nativeFromJson<String>(json['id']),
  roleId = nativeFromJson<String>(json['roleId']) {
  
  
  
    shiftId = Optional.optional(nativeFromJson, nativeToJson);
    shiftId.value = json['shiftId'] == null ? null : nativeFromJson<String>(json['shiftId']);
  
  
    staffId = Optional.optional(nativeFromJson, nativeToJson);
    staffId.value = json['staffId'] == null ? null : nativeFromJson<String>(json['staffId']);
  
  
    status = Optional.optional((data) => ApplicationStatus.values.byName(data), enumSerializer);
    status.value = json['status'] == null ? null : ApplicationStatus.values.byName(json['status']);
  
  
    checkInTime = Optional.optional((json) => json['checkInTime'] = Timestamp.fromJson(json['checkInTime']), defaultSerializer);
    checkInTime.value = json['checkInTime'] == null ? null : Timestamp.fromJson(json['checkInTime']);
  
  
    checkOutTime = Optional.optional((json) => json['checkOutTime'] = Timestamp.fromJson(json['checkOutTime']), defaultSerializer);
    checkOutTime.value = json['checkOutTime'] == null ? null : Timestamp.fromJson(json['checkOutTime']);
  
  
  }
  @override
  bool operator ==(Object other) {
    if(identical(this, other)) {
      return true;
    }
    if(other.runtimeType != runtimeType) {
      return false;
    }

    final UpdateApplicationStatusVariables otherTyped = other as UpdateApplicationStatusVariables;
    return id == otherTyped.id && 
    shiftId == otherTyped.shiftId && 
    staffId == otherTyped.staffId && 
    status == otherTyped.status && 
    checkInTime == otherTyped.checkInTime && 
    checkOutTime == otherTyped.checkOutTime && 
    roleId == otherTyped.roleId;
    
  }
  @override
  int get hashCode => Object.hashAll([id.hashCode, shiftId.hashCode, staffId.hashCode, status.hashCode, checkInTime.hashCode, checkOutTime.hashCode, roleId.hashCode]);
  

  Map<String, dynamic> toJson() {
    Map<String, dynamic> json = {};
    json['id'] = nativeToJson<String>(id);
    if(shiftId.state == OptionalState.set) {
      json['shiftId'] = shiftId.toJson();
    }
    if(staffId.state == OptionalState.set) {
      json['staffId'] = staffId.toJson();
    }
    if(status.state == OptionalState.set) {
      json['status'] = status.toJson();
    }
    if(checkInTime.state == OptionalState.set) {
      json['checkInTime'] = checkInTime.toJson();
    }
    if(checkOutTime.state == OptionalState.set) {
      json['checkOutTime'] = checkOutTime.toJson();
    }
    json['roleId'] = nativeToJson<String>(roleId);
    return json;
  }

  UpdateApplicationStatusVariables({
    required this.id,
    required this.shiftId,
    required this.staffId,
    required this.status,
    required this.checkInTime,
    required this.checkOutTime,
    required this.roleId,
  });
}

