part of 'generated.dart';

class ListDocumentsVariablesBuilder {
  
  final FirebaseDataConnect _dataConnect;
  ListDocumentsVariablesBuilder(this._dataConnect, );
  Deserializer<ListDocumentsData> dataDeserializer = (dynamic json)  => ListDocumentsData.fromJson(jsonDecode(json));
  
  Future<QueryResult<ListDocumentsData, void>> execute() {
    return ref().execute();
  }

  QueryRef<ListDocumentsData, void> ref() {
    
    return _dataConnect.query("listDocuments", dataDeserializer, emptySerializer, null);
  }
}

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

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

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

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

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

    final ListDocumentsData otherTyped = other as ListDocumentsData;
    return documents == otherTyped.documents;
    
  }
  @override
  int get hashCode => documents.hashCode;
  

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

  ListDocumentsData({
    required this.documents,
  });
}

