part of 'generated.dart';

class CreateStaffDocumentVariablesBuilder {
  String staffId;
  String staffName;
  String documentId;
  DocumentStatus status;
  Optional<String> _documentUrl = Optional.optional(nativeFromJson, nativeToJson);
  Optional<Timestamp> _expiryDate = Optional.optional((json) => json['expiryDate'] = Timestamp.fromJson(json['expiryDate']), defaultSerializer);

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

  CreateStaffDocumentVariablesBuilder(this._dataConnect, {required  this.staffId,required  this.staffName,required  this.documentId,required  this.status,});
  Deserializer<CreateStaffDocumentData> dataDeserializer = (dynamic json)  => CreateStaffDocumentData.fromJson(jsonDecode(json));
  Serializer<CreateStaffDocumentVariables> varsSerializer = (CreateStaffDocumentVariables vars) => jsonEncode(vars.toJson());
  Future<OperationResult<CreateStaffDocumentData, CreateStaffDocumentVariables>> execute() {
    return ref().execute();
  }

  MutationRef<CreateStaffDocumentData, CreateStaffDocumentVariables> ref() {
    CreateStaffDocumentVariables vars= CreateStaffDocumentVariables(staffId: staffId,staffName: staffName,documentId: documentId,status: status,documentUrl: _documentUrl,expiryDate: _expiryDate,);
    return _dataConnect.mutation("createStaffDocument", dataDeserializer, varsSerializer, vars);
  }
}

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

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

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

    final CreateStaffDocumentData otherTyped = other as CreateStaffDocumentData;
    return staffDocument_insert == otherTyped.staffDocument_insert;
    
  }
  @override
  int get hashCode => staffDocument_insert.hashCode;
  

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

  CreateStaffDocumentData({
    required this.staffDocument_insert,
  });
}

@immutable
class CreateStaffDocumentVariables {
  final String staffId;
  final String staffName;
  final String documentId;
  final 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.')
  CreateStaffDocumentVariables.fromJson(Map<String, dynamic> json):
  
  staffId = nativeFromJson<String>(json['staffId']),
  staffName = nativeFromJson<String>(json['staffName']),
  documentId = nativeFromJson<String>(json['documentId']),
  status = 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 CreateStaffDocumentVariables otherTyped = other as CreateStaffDocumentVariables;
    return staffId == otherTyped.staffId && 
    staffName == otherTyped.staffName && 
    documentId == otherTyped.documentId && 
    status == otherTyped.status && 
    documentUrl == otherTyped.documentUrl && 
    expiryDate == otherTyped.expiryDate;
    
  }
  @override
  int get hashCode => Object.hashAll([staffId.hashCode, staffName.hashCode, documentId.hashCode, status.hashCode, documentUrl.hashCode, expiryDate.hashCode]);
  

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

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

