part of 'generated.dart';

class MarkConversationAsReadVariablesBuilder {
  String conversationId;
  String userId;
  Optional<Timestamp> _lastReadAt = Optional.optional((json) => json['lastReadAt'] = Timestamp.fromJson(json['lastReadAt']), defaultSerializer);

  final FirebaseDataConnect _dataConnect;  MarkConversationAsReadVariablesBuilder lastReadAt(Timestamp? t) {
   _lastReadAt.value = t;
   return this;
  }

  MarkConversationAsReadVariablesBuilder(this._dataConnect, {required  this.conversationId,required  this.userId,});
  Deserializer<MarkConversationAsReadData> dataDeserializer = (dynamic json)  => MarkConversationAsReadData.fromJson(jsonDecode(json));
  Serializer<MarkConversationAsReadVariables> varsSerializer = (MarkConversationAsReadVariables vars) => jsonEncode(vars.toJson());
  Future<OperationResult<MarkConversationAsReadData, MarkConversationAsReadVariables>> execute() {
    return ref().execute();
  }

  MutationRef<MarkConversationAsReadData, MarkConversationAsReadVariables> ref() {
    MarkConversationAsReadVariables vars= MarkConversationAsReadVariables(conversationId: conversationId,userId: userId,lastReadAt: _lastReadAt,);
    return _dataConnect.mutation("markConversationAsRead", dataDeserializer, varsSerializer, vars);
  }
}

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

    final MarkConversationAsReadUserConversationUpdate otherTyped = other as MarkConversationAsReadUserConversationUpdate;
    return conversationId == otherTyped.conversationId && 
    userId == otherTyped.userId;
    
  }
  @override
  int get hashCode => Object.hashAll([conversationId.hashCode, userId.hashCode]);
  

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

  MarkConversationAsReadUserConversationUpdate({
    required this.conversationId,
    required this.userId,
  });
}

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

    final MarkConversationAsReadData otherTyped = other as MarkConversationAsReadData;
    return userConversation_update == otherTyped.userConversation_update;
    
  }
  @override
  int get hashCode => userConversation_update.hashCode;
  

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

  MarkConversationAsReadData({
    this.userConversation_update,
  });
}

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

    final MarkConversationAsReadVariables otherTyped = other as MarkConversationAsReadVariables;
    return conversationId == otherTyped.conversationId && 
    userId == otherTyped.userId && 
    lastReadAt == otherTyped.lastReadAt;
    
  }
  @override
  int get hashCode => Object.hashAll([conversationId.hashCode, userId.hashCode, lastReadAt.hashCode]);
  

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

  MarkConversationAsReadVariables({
    required this.conversationId,
    required this.userId,
    required this.lastReadAt,
  });
}

