part of 'generated.dart';

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

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

@immutable
class ListMessagesMessages {
  final String id;
  final String conversationId;
  final String senderId;
  final String content;
  final bool? isSystem;
  final Timestamp? createdAt;
  final ListMessagesMessagesUser user;
  ListMessagesMessages.fromJson(dynamic json):
  
  id = nativeFromJson<String>(json['id']),
  conversationId = nativeFromJson<String>(json['conversationId']),
  senderId = nativeFromJson<String>(json['senderId']),
  content = nativeFromJson<String>(json['content']),
  isSystem = json['isSystem'] == null ? null : nativeFromJson<bool>(json['isSystem']),
  createdAt = json['createdAt'] == null ? null : Timestamp.fromJson(json['createdAt']),
  user = ListMessagesMessagesUser.fromJson(json['user']);
  @override
  bool operator ==(Object other) {
    if(identical(this, other)) {
      return true;
    }
    if(other.runtimeType != runtimeType) {
      return false;
    }

    final ListMessagesMessages otherTyped = other as ListMessagesMessages;
    return id == otherTyped.id && 
    conversationId == otherTyped.conversationId && 
    senderId == otherTyped.senderId && 
    content == otherTyped.content && 
    isSystem == otherTyped.isSystem && 
    createdAt == otherTyped.createdAt && 
    user == otherTyped.user;
    
  }
  @override
  int get hashCode => Object.hashAll([id.hashCode, conversationId.hashCode, senderId.hashCode, content.hashCode, isSystem.hashCode, createdAt.hashCode, user.hashCode]);
  

  Map<String, dynamic> toJson() {
    Map<String, dynamic> json = {};
    json['id'] = nativeToJson<String>(id);
    json['conversationId'] = nativeToJson<String>(conversationId);
    json['senderId'] = nativeToJson<String>(senderId);
    json['content'] = nativeToJson<String>(content);
    if (isSystem != null) {
      json['isSystem'] = nativeToJson<bool?>(isSystem);
    }
    if (createdAt != null) {
      json['createdAt'] = createdAt!.toJson();
    }
    json['user'] = user.toJson();
    return json;
  }

  ListMessagesMessages({
    required this.id,
    required this.conversationId,
    required this.senderId,
    required this.content,
    this.isSystem,
    this.createdAt,
    required this.user,
  });
}

@immutable
class ListMessagesMessagesUser {
  final String? fullName;
  ListMessagesMessagesUser.fromJson(dynamic json):
  
  fullName = json['fullName'] == null ? null : nativeFromJson<String>(json['fullName']);
  @override
  bool operator ==(Object other) {
    if(identical(this, other)) {
      return true;
    }
    if(other.runtimeType != runtimeType) {
      return false;
    }

    final ListMessagesMessagesUser otherTyped = other as ListMessagesMessagesUser;
    return fullName == otherTyped.fullName;
    
  }
  @override
  int get hashCode => fullName.hashCode;
  

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

  ListMessagesMessagesUser({
    this.fullName,
  });
}

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

    final ListMessagesData otherTyped = other as ListMessagesData;
    return messages == otherTyped.messages;
    
  }
  @override
  int get hashCode => messages.hashCode;
  

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

  ListMessagesData({
    required this.messages,
  });
}

