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

NoticeBoardAnnounDetailEntity $NoticeBoardAnnounDetailEntityFromJson(Map<String, dynamic> json) {
  final NoticeBoardAnnounDetailEntity noticeBoardAnnounDetailEntity = NoticeBoardAnnounDetailEntity();
  final int? id = jsonConvert.convert<int>(json['id']);
  if (id != null) {
    noticeBoardAnnounDetailEntity.id = id;
  }
  final String? title = jsonConvert.convert<String>(json['title']);
  if (title != null) {
    noticeBoardAnnounDetailEntity.title = title;
  }
  final String? content = jsonConvert.convert<String>(json['content']);
  if (content != null) {
    noticeBoardAnnounDetailEntity.content = content;
  }
  final List<dynamic>? resources = (json['resources'] as List<dynamic>?)?.map(
          (e) => e).toList();
  if (resources != null) {
    noticeBoardAnnounDetailEntity.resources = resources;
  }
  final String? createdAt = jsonConvert.convert<String>(json['created_at']);
  if (createdAt != null) {
    noticeBoardAnnounDetailEntity.createdAt = createdAt;
  }
  return noticeBoardAnnounDetailEntity;
}

Map<String, dynamic> $NoticeBoardAnnounDetailEntityToJson(NoticeBoardAnnounDetailEntity entity) {
  final Map<String, dynamic> data = <String, dynamic>{};
  data['id'] = entity.id;
  data['title'] = entity.title;
  data['content'] = entity.content;
  data['resources'] = entity.resources;
  data['created_at'] = entity.createdAt;
  return data;
}

extension NoticeBoardAnnounDetailEntityExtension on NoticeBoardAnnounDetailEntity {
  NoticeBoardAnnounDetailEntity copyWith({
    int? id,
    String? title,
    String? content,
    List<dynamic>? resources,
    String? createdAt,
  }) {
    return NoticeBoardAnnounDetailEntity()
      ..id = id ?? this.id
      ..title = title ?? this.title
      ..content = content ?? this.content
      ..resources = resources ?? this.resources
      ..createdAt = createdAt ?? this.createdAt;
  }
}