part of 'generated.dart';

class GetConversationByIdVariablesBuilder {
  String id;

  final FirebaseDataConnect _dataConnect;
  GetConversationByIdVariablesBuilder(this._dataConnect, {required  this.id,});
  Deserializer<GetConversationByIdData> dataDeserializer = (dynamic json)  => GetConversationByIdData.fromJson(jsonDecode(json));
  Serializer<GetConversationByIdVariables> varsSerializer = (GetConversationByIdVariables vars) => jsonEncode(vars.toJson());
  Future<QueryResult<GetConversationByIdData, GetConversationByIdVariables>> execute() {
    return ref().execute();
  }

  QueryRef<GetConversationByIdData, GetConversationByIdVariables> ref() {
    GetConversationByIdVariables vars= GetConversationByIdVariables(id: id,);
    return _dataConnect.query("getConversationById", dataDeserializer, varsSerializer, vars);
  }
}

@immutable
class GetConversationByIdConversation {
  final String id;
  final String? subject;
  final EnumValue<ConversationStatus>? status;
  final EnumValue<ConversationType>? conversationType;
  final bool? isGroup;
  final String? groupName;
  final String? lastMessage;
  final Timestamp? lastMessageAt;
  final Timestamp? createdAt;
  GetConversationByIdConversation.fromJson(dynamic json):
  
  id = nativeFromJson<String>(json['id']),
  subject = json['subject'] == null ? null : nativeFromJson<String>(json['subject']),
  status = json['status'] == null ? null : conversationStatusDeserializer(json['status']),
  conversationType = json['conversationType'] == null ? null : conversationTypeDeserializer(json['conversationType']),
  isGroup = json['isGroup'] == null ? null : nativeFromJson<bool>(json['isGroup']),
  groupName = json['groupName'] == null ? null : nativeFromJson<String>(json['groupName']),
  lastMessage = json['lastMessage'] == null ? null : nativeFromJson<String>(json['lastMessage']),
  lastMessageAt = json['lastMessageAt'] == null ? null : Timestamp.fromJson(json['lastMessageAt']),
  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 GetConversationByIdConversation otherTyped = other as GetConversationByIdConversation;
    return id == otherTyped.id && 
    subject == otherTyped.subject && 
    status == otherTyped.status && 
    conversationType == otherTyped.conversationType && 
    isGroup == otherTyped.isGroup && 
    groupName == otherTyped.groupName && 
    lastMessage == otherTyped.lastMessage && 
    lastMessageAt == otherTyped.lastMessageAt && 
    createdAt == otherTyped.createdAt;
    
  }
  @override
  int get hashCode => Object.hashAll([id.hashCode, subject.hashCode, status.hashCode, conversationType.hashCode, isGroup.hashCode, groupName.hashCode, lastMessage.hashCode, lastMessageAt.hashCode, createdAt.hashCode]);
  

  Map<String, dynamic> toJson() {
    Map<String, dynamic> json = {};
    json['id'] = nativeToJson<String>(id);
    if (subject != null) {
      json['subject'] = nativeToJson<String?>(subject);
    }
    if (status != null) {
      json['status'] = 
    conversationStatusSerializer(status!)
    ;
    }
    if (conversationType != null) {
      json['conversationType'] = 
    conversationTypeSerializer(conversationType!)
    ;
    }
    if (isGroup != null) {
      json['isGroup'] = nativeToJson<bool?>(isGroup);
    }
    if (groupName != null) {
      json['groupName'] = nativeToJson<String?>(groupName);
    }
    if (lastMessage != null) {
      json['lastMessage'] = nativeToJson<String?>(lastMessage);
    }
    if (lastMessageAt != null) {
      json['lastMessageAt'] = lastMessageAt!.toJson();
    }
    if (createdAt != null) {
      json['createdAt'] = createdAt!.toJson();
    }
    return json;
  }

  GetConversationByIdConversation({
    required this.id,
    this.subject,
    this.status,
    this.conversationType,
    this.isGroup,
    this.groupName,
    this.lastMessage,
    this.lastMessageAt,
    this.createdAt,
  });
}

@immutable
class GetConversationByIdData {
  final GetConversationByIdConversation? conversation;
  GetConversationByIdData.fromJson(dynamic json):
  
  conversation = json['conversation'] == null ? null : GetConversationByIdConversation.fromJson(json['conversation']);
  @override
  bool operator ==(Object other) {
    if(identical(this, other)) {
      return true;
    }
    if(other.runtimeType != runtimeType) {
      return false;
    }

    final GetConversationByIdData otherTyped = other as GetConversationByIdData;
    return conversation == otherTyped.conversation;
    
  }
  @override
  int get hashCode => conversation.hashCode;
  

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

  GetConversationByIdData({
    this.conversation,
  });
}

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

    final GetConversationByIdVariables otherTyped = other as GetConversationByIdVariables;
    return id == otherTyped.id;
    
  }
  @override
  int get hashCode => id.hashCode;
  

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

  GetConversationByIdVariables({
    required this.id,
  });
}

