import 'package:domain/generated/json/base/json_convert_content.dart';
import 'package:domain/entity/newsfeed_comment_publish_entity.dart';

NewsfeedCommentPublishEntity $NewsfeedCommentPublishEntityFromJson(Map<String, dynamic> json) {
  final NewsfeedCommentPublishEntity newsfeedCommentPublishEntity = NewsfeedCommentPublishEntity();
  final int? id = jsonConvert.convert<int>(json['id']);
  if (id != null) {
    newsfeedCommentPublishEntity.id = id;
  }
  final String? content = jsonConvert.convert<String>(json['content']);
  if (content != null) {
    newsfeedCommentPublishEntity.content = content;
  }
  final int? toUserId = jsonConvert.convert<int>(json['to_user_id']);
  if (toUserId != null) {
    newsfeedCommentPublishEntity.toUserId = toUserId;
  }
  return newsfeedCommentPublishEntity;
}

Map<String, dynamic> $NewsfeedCommentPublishEntityToJson(NewsfeedCommentPublishEntity entity) {
  final Map<String, dynamic> data = <String, dynamic>{};
  data['id'] = entity.id;
  data['content'] = entity.content;
  data['to_user_id'] = entity.toUserId;
  return data;
}

extension NewsfeedCommentPublishEntityExtension on NewsfeedCommentPublishEntity {
  NewsfeedCommentPublishEntity copyWith({
    int? id,
    String? content,
    int? toUserId,
  }) {
    return NewsfeedCommentPublishEntity()
      ..id = id ?? this.id
      ..content = content ?? this.content
      ..toUserId = toUserId ?? this.toUserId;
  }
}