part of 'generated.dart';

class ListStaffDocumentsByStaffIdVariablesBuilder {
  String staffId;
  Optional<int> _offset = Optional.optional(nativeFromJson, nativeToJson);
  Optional<int> _limit = Optional.optional(nativeFromJson, nativeToJson);

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

  ListStaffDocumentsByStaffIdVariablesBuilder(this._dataConnect, {required  this.staffId,});
  Deserializer<ListStaffDocumentsByStaffIdData> dataDeserializer = (dynamic json)  => ListStaffDocumentsByStaffIdData.fromJson(jsonDecode(json));
  Serializer<ListStaffDocumentsByStaffIdVariables> varsSerializer = (ListStaffDocumentsByStaffIdVariables vars) => jsonEncode(vars.toJson());
  Future<QueryResult<ListStaffDocumentsByStaffIdData, ListStaffDocumentsByStaffIdVariables>> execute() {
    return ref().execute();
  }

  QueryRef<ListStaffDocumentsByStaffIdData, ListStaffDocumentsByStaffIdVariables> ref() {
    ListStaffDocumentsByStaffIdVariables vars= ListStaffDocumentsByStaffIdVariables(staffId: staffId,offset: _offset,limit: _limit,);
    return _dataConnect.query("listStaffDocumentsByStaffId", dataDeserializer, varsSerializer, vars);
  }
}

@immutable
class ListStaffDocumentsByStaffIdStaffDocuments {
  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 ListStaffDocumentsByStaffIdStaffDocumentsDocument document;
  ListStaffDocumentsByStaffIdStaffDocuments.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 = ListStaffDocumentsByStaffIdStaffDocumentsDocument.fromJson(json['document']);
  @override
  bool operator ==(Object other) {
    if(identical(this, other)) {
      return true;
    }
    if(other.runtimeType != runtimeType) {
      return false;
    }

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

  ListStaffDocumentsByStaffIdStaffDocuments({
    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 ListStaffDocumentsByStaffIdStaffDocumentsDocument {
  final String id;
  final String name;
  final EnumValue<DocumentType> documentType;
  ListStaffDocumentsByStaffIdStaffDocumentsDocument.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 ListStaffDocumentsByStaffIdStaffDocumentsDocument otherTyped = other as ListStaffDocumentsByStaffIdStaffDocumentsDocument;
    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;
  }

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

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

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

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

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

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

  ListStaffDocumentsByStaffIdVariables({
    required this.staffId,
    required this.offset,
    required this.limit,
  });
}

