part of 'generated.dart';

class GetMessagesByConversationIdVariablesBuilder {
  String conversationId;

  final FirebaseDataConnect _dataConnect;
  GetMessagesByConversationIdVariablesBuilder(this._dataConnect, {required  this.conversationId,});
  Deserializer<GetMessagesByConversationIdData> dataDeserializer = (dynamic json)  => GetMessagesByConversationIdData.fromJson(jsonDecode(json));
  Serializer<GetMessagesByConversationIdVariables> varsSerializer = (GetMessagesByConversationIdVariables vars) => jsonEncode(vars.toJson());
  Future<QueryResult<GetMessagesByConversationIdData, GetMessagesByConversationIdVariables>> execute() {
    return ref().execute();
  }

  QueryRef<GetMessagesByConversationIdData, GetMessagesByConversationIdVariables> ref() {
    GetMessagesByConversationIdVariables vars= GetMessagesByConversationIdVariables(conversationId: conversationId,);
    return _dataConnect.query("getMessagesByConversationId", dataDeserializer, varsSerializer, vars);
  }
}

@immutable
class GetMessagesByConversationIdMessages {
  final String id;
  final String conversationId;
  final String senderId;
  final String content;
  final bool? isSystem;
  final Timestamp? createdAt;
  final GetMessagesByConversationIdMessagesUser user;
  GetMessagesByConversationIdMessages.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 = GetMessagesByConversationIdMessagesUser.fromJson(json['user']);
  @override
  bool operator ==(Object other) {
    if(identical(this, other)) {
      return true;
    }
    if(other.runtimeType != runtimeType) {
      return false;
    }

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

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

@immutable
class GetMessagesByConversationIdMessagesUser {
  final String? fullName;
  GetMessagesByConversationIdMessagesUser.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 GetMessagesByConversationIdMessagesUser otherTyped = other as GetMessagesByConversationIdMessagesUser;
    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;
  }

  GetMessagesByConversationIdMessagesUser({
    this.fullName,
  });
}

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

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

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

@immutable
class GetMessagesByConversationIdVariables {
  final String conversationId;
  @Deprecated('fromJson is deprecated for Variable classes as they are no longer required for deserialization.')
  GetMessagesByConversationIdVariables.fromJson(Map<String, dynamic> json):
  
  conversationId = nativeFromJson<String>(json['conversationId']);
  @override
  bool operator ==(Object other) {
    if(identical(this, other)) {
      return true;
    }
    if(other.runtimeType != runtimeType) {
      return false;
    }

    final GetMessagesByConversationIdVariables otherTyped = other as GetMessagesByConversationIdVariables;
    return conversationId == otherTyped.conversationId;
    
  }
  @override
  int get hashCode => conversationId.hashCode;
  

  Map<String, dynamic> toJson() {
    Map<String, dynamic> json = {};
    json['conversationId'] = nativeToJson<String>(conversationId);
    return json;
  }

  GetMessagesByConversationIdVariables({
    required this.conversationId,
  });
}

