part of 'generated.dart';

class GetStaffDocumentByKeyVariablesBuilder {
  String staffId;
  String documentId;

  final FirebaseDataConnect _dataConnect;
  GetStaffDocumentByKeyVariablesBuilder(this._dataConnect, {required  this.staffId,required  this.documentId,});
  Deserializer<GetStaffDocumentByKeyData> dataDeserializer = (dynamic json)  => GetStaffDocumentByKeyData.fromJson(jsonDecode(json));
  Serializer<GetStaffDocumentByKeyVariables> varsSerializer = (GetStaffDocumentByKeyVariables vars) => jsonEncode(vars.toJson());
  Future<QueryResult<GetStaffDocumentByKeyData, GetStaffDocumentByKeyVariables>> execute() {
    return ref().execute();
  }

  QueryRef<GetStaffDocumentByKeyData, GetStaffDocumentByKeyVariables> ref() {
    GetStaffDocumentByKeyVariables vars= GetStaffDocumentByKeyVariables(staffId: staffId,documentId: documentId,);
    return _dataConnect.query("getStaffDocumentByKey", dataDeserializer, varsSerializer, vars);
  }
}

@immutable
class GetStaffDocumentByKeyStaffDocument {
  final String id;
  final String staffId;
  final String staffName;
  final String documentId;
  final EnumValue<DocumentStatus> status;
  final String? documentUrl;
  final Timestamp? expiryDate;
  final Timestamp? createdAt;
  final Timestamp? updatedAt;
  final GetStaffDocumentByKeyStaffDocumentDocument document;
  GetStaffDocumentByKeyStaffDocument.fromJson(dynamic json):
  
  id = nativeFromJson<String>(json['id']),
  staffId = nativeFromJson<String>(json['staffId']),
  staffName = nativeFromJson<String>(json['staffName']),
  documentId = nativeFromJson<String>(json['documentId']),
  status = documentStatusDeserializer(json['status']),
  documentUrl = json['documentUrl'] == null ? null : nativeFromJson<String>(json['documentUrl']),
  expiryDate = json['expiryDate'] == null ? null : Timestamp.fromJson(json['expiryDate']),
  createdAt = json['createdAt'] == null ? null : Timestamp.fromJson(json['createdAt']),
  updatedAt = json['updatedAt'] == null ? null : Timestamp.fromJson(json['updatedAt']),
  document = GetStaffDocumentByKeyStaffDocumentDocument.fromJson(json['document']);
  @override
  bool operator ==(Object other) {
    if(identical(this, other)) {
      return true;
    }
    if(other.runtimeType != runtimeType) {
      return false;
    }

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

  Map<String, dynamic> toJson() {
    Map<String, dynamic> json = {};
    json['id'] = nativeToJson<String>(id);
    json['staffId'] = nativeToJson<String>(staffId);
    json['staffName'] = nativeToJson<String>(staffName);
    json['documentId'] = nativeToJson<String>(documentId);
    json['status'] = 
    documentStatusSerializer(status)
    ;
    if (documentUrl != null) {
      json['documentUrl'] = nativeToJson<String?>(documentUrl);
    }
    if (expiryDate != null) {
      json['expiryDate'] = expiryDate!.toJson();
    }
    if (createdAt != null) {
      json['createdAt'] = createdAt!.toJson();
    }
    if (updatedAt != null) {
      json['updatedAt'] = updatedAt!.toJson();
    }
    json['document'] = document.toJson();
    return json;
  }

  GetStaffDocumentByKeyStaffDocument({
    required this.id,
    required this.staffId,
    required this.staffName,
    required this.documentId,
    required this.status,
    this.documentUrl,
    this.expiryDate,
    this.createdAt,
    this.updatedAt,
    required this.document,
  });
}

@immutable
class GetStaffDocumentByKeyStaffDocumentDocument {
  final String id;
  final String name;
  final EnumValue<DocumentType> documentType;
  final String? description;
  GetStaffDocumentByKeyStaffDocumentDocument.fromJson(dynamic json):
  
  id = nativeFromJson<String>(json['id']),
  name = nativeFromJson<String>(json['name']),
  documentType = documentTypeDeserializer(json['documentType']),
  description = json['description'] == null ? null : nativeFromJson<String>(json['description']);
  @override
  bool operator ==(Object other) {
    if(identical(this, other)) {
      return true;
    }
    if(other.runtimeType != runtimeType) {
      return false;
    }

    final GetStaffDocumentByKeyStaffDocumentDocument otherTyped = other as GetStaffDocumentByKeyStaffDocumentDocument;
    return id == otherTyped.id && 
    name == otherTyped.name && 
    documentType == otherTyped.documentType && 
    description == otherTyped.description;
    
  }
  @override
  int get hashCode => Object.hashAll([id.hashCode, name.hashCode, documentType.hashCode, description.hashCode]);
  

  Map<String, dynamic> toJson() {
    Map<String, dynamic> json = {};
    json['id'] = nativeToJson<String>(id);
    json['name'] = nativeToJson<String>(name);
    json['documentType'] = 
    documentTypeSerializer(documentType)
    ;
    if (description != null) {
      json['description'] = nativeToJson<String?>(description);
    }
    return json;
  }

  GetStaffDocumentByKeyStaffDocumentDocument({
    required this.id,
    required this.name,
    required this.documentType,
    this.description,
  });
}

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

    final GetStaffDocumentByKeyData otherTyped = other as GetStaffDocumentByKeyData;
    return staffDocument == otherTyped.staffDocument;
    
  }
  @override
  int get hashCode => staffDocument.hashCode;
  

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

  GetStaffDocumentByKeyData({
    this.staffDocument,
  });
}

@immutable
class GetStaffDocumentByKeyVariables {
  final String staffId;
  final String documentId;
  @Deprecated('fromJson is deprecated for Variable classes as they are no longer required for deserialization.')
  GetStaffDocumentByKeyVariables.fromJson(Map<String, 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 GetStaffDocumentByKeyVariables otherTyped = other as GetStaffDocumentByKeyVariables;
    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;
  }

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

