part of 'generated.dart';

class UpdateStaffDocumentVariablesBuilder {
  String staffId;
  String documentId;
  Optional<DocumentStatus> _status = Optional.optional((data) => DocumentStatus.values.byName(data), enumSerializer);
  Optional<String> _documentUrl = Optional.optional(nativeFromJson, nativeToJson);
  Optional<Timestamp> _expiryDate = Optional.optional((json) => json['expiryDate'] = Timestamp.fromJson(json['expiryDate']), defaultSerializer);

  final FirebaseDataConnect _dataConnect;  UpdateStaffDocumentVariablesBuilder status(DocumentStatus? t) {
   _status.value = t;
   return this;
  }
  UpdateStaffDocumentVariablesBuilder documentUrl(String? t) {
   _documentUrl.value = t;
   return this;
  }
  UpdateStaffDocumentVariablesBuilder expiryDate(Timestamp? t) {
   _expiryDate.value = t;
   return this;
  }

  UpdateStaffDocumentVariablesBuilder(this._dataConnect, {required  this.staffId,required  this.documentId,});
  Deserializer<UpdateStaffDocumentData> dataDeserializer = (dynamic json)  => UpdateStaffDocumentData.fromJson(jsonDecode(json));
  Serializer<UpdateStaffDocumentVariables> varsSerializer = (UpdateStaffDocumentVariables vars) => jsonEncode(vars.toJson());
  Future<OperationResult<UpdateStaffDocumentData, UpdateStaffDocumentVariables>> execute() {
    return ref().execute();
  }

  MutationRef<UpdateStaffDocumentData, UpdateStaffDocumentVariables> ref() {
    UpdateStaffDocumentVariables vars= UpdateStaffDocumentVariables(staffId: staffId,documentId: documentId,status: _status,documentUrl: _documentUrl,expiryDate: _expiryDate,);
    return _dataConnect.mutation("updateStaffDocument", dataDeserializer, varsSerializer, vars);
  }
}

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

    final UpdateStaffDocumentStaffDocumentUpdate otherTyped = other as UpdateStaffDocumentStaffDocumentUpdate;
    return staffId == otherTyped.staffId && 
    documentId == otherTyped.documentId;
    
  }
  @override
  int get hashCode => Object.hashAll([staffId.hashCode, documentId.hashCode]);
  

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

  UpdateStaffDocumentStaffDocumentUpdate({
    required this.staffId,
    required this.documentId,
  });
}

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

    final UpdateStaffDocumentData otherTyped = other as UpdateStaffDocumentData;
    return staffDocument_update == otherTyped.staffDocument_update;
    
  }
  @override
  int get hashCode => staffDocument_update.hashCode;
  

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

  UpdateStaffDocumentData({
    this.staffDocument_update,
  });
}

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

    final UpdateStaffDocumentVariables otherTyped = other as UpdateStaffDocumentVariables;
    return staffId == otherTyped.staffId && 
    documentId == otherTyped.documentId && 
    status == otherTyped.status && 
    documentUrl == otherTyped.documentUrl && 
    expiryDate == otherTyped.expiryDate;
    
  }
  @override
  int get hashCode => Object.hashAll([staffId.hashCode, documentId.hashCode, status.hashCode, documentUrl.hashCode, expiryDate.hashCode]);
  

  Map<String, dynamic> toJson() {
    Map<String, dynamic> json = {};
    json['staffId'] = nativeToJson<String>(staffId);
    json['documentId'] = nativeToJson<String>(documentId);
    if(status.state == OptionalState.set) {
      json['status'] = status.toJson();
    }
    if(documentUrl.state == OptionalState.set) {
      json['documentUrl'] = documentUrl.toJson();
    }
    if(expiryDate.state == OptionalState.set) {
      json['expiryDate'] = expiryDate.toJson();
    }
    return json;
  }

  UpdateStaffDocumentVariables({
    required this.staffId,
    required this.documentId,
    required this.status,
    required this.documentUrl,
    required this.expiryDate,
  });
}

