part of 'generated.dart';

class ListStaffDocumentsByStatusVariablesBuilder {
  DocumentStatus status;
  Optional<int> _offset = Optional.optional(nativeFromJson, nativeToJson);
  Optional<int> _limit = Optional.optional(nativeFromJson, nativeToJson);

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

  ListStaffDocumentsByStatusVariablesBuilder(this._dataConnect, {required  this.status,});
  Deserializer<ListStaffDocumentsByStatusData> dataDeserializer = (dynamic json)  => ListStaffDocumentsByStatusData.fromJson(jsonDecode(json));
  Serializer<ListStaffDocumentsByStatusVariables> varsSerializer = (ListStaffDocumentsByStatusVariables vars) => jsonEncode(vars.toJson());
  Future<QueryResult<ListStaffDocumentsByStatusData, ListStaffDocumentsByStatusVariables>> execute() {
    return ref().execute();
  }

  QueryRef<ListStaffDocumentsByStatusData, ListStaffDocumentsByStatusVariables> ref() {
    ListStaffDocumentsByStatusVariables vars= ListStaffDocumentsByStatusVariables(status: status,offset: _offset,limit: _limit,);
    return _dataConnect.query("listStaffDocumentsByStatus", dataDeserializer, varsSerializer, vars);
  }
}

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

    final ListStaffDocumentsByStatusStaffDocuments otherTyped = other as ListStaffDocumentsByStatusStaffDocuments;
    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;
  }

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

@immutable
class ListStaffDocumentsByStatusStaffDocumentsDocument {
  final String id;
  final String name;
  final EnumValue<DocumentType> documentType;
  ListStaffDocumentsByStatusStaffDocumentsDocument.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 ListStaffDocumentsByStatusStaffDocumentsDocument otherTyped = other as ListStaffDocumentsByStatusStaffDocumentsDocument;
    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;
  }

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

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

    final ListStaffDocumentsByStatusData otherTyped = other as ListStaffDocumentsByStatusData;
    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;
  }

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

@immutable
class ListStaffDocumentsByStatusVariables {
  final DocumentStatus status;
  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.')
  ListStaffDocumentsByStatusVariables.fromJson(Map<String, dynamic> json):
  
  status = DocumentStatus.values.byName(json['status']) {
  
  
  
    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 ListStaffDocumentsByStatusVariables otherTyped = other as ListStaffDocumentsByStatusVariables;
    return status == otherTyped.status && 
    offset == otherTyped.offset && 
    limit == otherTyped.limit;
    
  }
  @override
  int get hashCode => Object.hashAll([status.hashCode, offset.hashCode, limit.hashCode]);
  

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

  ListStaffDocumentsByStatusVariables({
    required this.status,
    required this.offset,
    required this.limit,
  });
}

