part of 'generated.dart';

class ListStaffDocumentsByDocumentTypeVariablesBuilder {
  DocumentType documentType;
  Optional<int> _offset = Optional.optional(nativeFromJson, nativeToJson);
  Optional<int> _limit = Optional.optional(nativeFromJson, nativeToJson);

  final FirebaseDataConnect _dataConnect;  ListStaffDocumentsByDocumentTypeVariablesBuilder offset(int? t) {
   _offset.value = t;
   return this;
  }
  ListStaffDocumentsByDocumentTypeVariablesBuilder limit(int? t) {
   _limit.value = t;
   return this;
  }

  ListStaffDocumentsByDocumentTypeVariablesBuilder(this._dataConnect, {required  this.documentType,});
  Deserializer<ListStaffDocumentsByDocumentTypeData> dataDeserializer = (dynamic json)  => ListStaffDocumentsByDocumentTypeData.fromJson(jsonDecode(json));
  Serializer<ListStaffDocumentsByDocumentTypeVariables> varsSerializer = (ListStaffDocumentsByDocumentTypeVariables vars) => jsonEncode(vars.toJson());
  Future<QueryResult<ListStaffDocumentsByDocumentTypeData, ListStaffDocumentsByDocumentTypeVariables>> execute() {
    return ref().execute();
  }

  QueryRef<ListStaffDocumentsByDocumentTypeData, ListStaffDocumentsByDocumentTypeVariables> ref() {
    ListStaffDocumentsByDocumentTypeVariables vars= ListStaffDocumentsByDocumentTypeVariables(documentType: documentType,offset: _offset,limit: _limit,);
    return _dataConnect.query("listStaffDocumentsByDocumentType", dataDeserializer, varsSerializer, vars);
  }
}

@immutable
class ListStaffDocumentsByDocumentTypeStaffDocuments {
  final String id;
  final String staffId;
  final String staffName;
  final String documentId;
  final EnumValue<DocumentStatus> status;
  final String? documentUrl;
  final Timestamp? expiryDate;
  final ListStaffDocumentsByDocumentTypeStaffDocumentsDocument document;
  ListStaffDocumentsByDocumentTypeStaffDocuments.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']),
  document = ListStaffDocumentsByDocumentTypeStaffDocumentsDocument.fromJson(json['document']);
  @override
  bool operator ==(Object other) {
    if(identical(this, other)) {
      return true;
    }
    if(other.runtimeType != runtimeType) {
      return false;
    }

    final ListStaffDocumentsByDocumentTypeStaffDocuments otherTyped = other as ListStaffDocumentsByDocumentTypeStaffDocuments;
    return id == otherTyped.id && 
    staffId == otherTyped.staffId && 
    staffName == otherTyped.staffName && 
    documentId == otherTyped.documentId && 
    status == otherTyped.status && 
    documentUrl == otherTyped.documentUrl && 
    expiryDate == otherTyped.expiryDate && 
    document == otherTyped.document;
    
  }
  @override
  int get hashCode => Object.hashAll([id.hashCode, staffId.hashCode, staffName.hashCode, documentId.hashCode, status.hashCode, documentUrl.hashCode, expiryDate.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();
    }
    json['document'] = document.toJson();
    return json;
  }

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

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

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

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

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

@immutable
class ListStaffDocumentsByDocumentTypeData {
  final List<ListStaffDocumentsByDocumentTypeStaffDocuments> staffDocuments;
  ListStaffDocumentsByDocumentTypeData.fromJson(dynamic json):
  
  staffDocuments = (json['staffDocuments'] as List<dynamic>)
        .map((e) => ListStaffDocumentsByDocumentTypeStaffDocuments.fromJson(e))
        .toList();
  @override
  bool operator ==(Object other) {
    if(identical(this, other)) {
      return true;
    }
    if(other.runtimeType != runtimeType) {
      return false;
    }

    final ListStaffDocumentsByDocumentTypeData otherTyped = other as ListStaffDocumentsByDocumentTypeData;
    return staffDocuments == otherTyped.staffDocuments;
    
  }
  @override
  int get hashCode => staffDocuments.hashCode;
  

  Map<String, dynamic> toJson() {
    Map<String, dynamic> json = {};
    json['staffDocuments'] = staffDocuments.map((e) => e.toJson()).toList();
    return json;
  }

  ListStaffDocumentsByDocumentTypeData({
    required this.staffDocuments,
  });
}

@immutable
class ListStaffDocumentsByDocumentTypeVariables {
  final DocumentType documentType;
  late final Optional<int>offset;
  late final Optional<int>limit;
  @Deprecated('fromJson is deprecated for Variable classes as they are no longer required for deserialization.')
  ListStaffDocumentsByDocumentTypeVariables.fromJson(Map<String, dynamic> json):
  
  documentType = DocumentType.values.byName(json['documentType']) {
  
  
  
    offset = Optional.optional(nativeFromJson, nativeToJson);
    offset.value = json['offset'] == null ? null : nativeFromJson<int>(json['offset']);
  
  
    limit = Optional.optional(nativeFromJson, nativeToJson);
    limit.value = json['limit'] == null ? null : nativeFromJson<int>(json['limit']);
  
  }
  @override
  bool operator ==(Object other) {
    if(identical(this, other)) {
      return true;
    }
    if(other.runtimeType != runtimeType) {
      return false;
    }

    final ListStaffDocumentsByDocumentTypeVariables otherTyped = other as ListStaffDocumentsByDocumentTypeVariables;
    return documentType == otherTyped.documentType && 
    offset == otherTyped.offset && 
    limit == otherTyped.limit;
    
  }
  @override
  int get hashCode => Object.hashAll([documentType.hashCode, offset.hashCode, limit.hashCode]);
  

  Map<String, dynamic> toJson() {
    Map<String, dynamic> json = {};
    json['documentType'] = 
    documentType.name
    ;
    if(offset.state == OptionalState.set) {
      json['offset'] = offset.toJson();
    }
    if(limit.state == OptionalState.set) {
      json['limit'] = limit.toJson();
    }
    return json;
  }

  ListStaffDocumentsByDocumentTypeVariables({
    required this.documentType,
    required this.offset,
    required this.limit,
  });
}

