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


FormSubmittedPageEntity $FormSubmittedPageEntityFromJson(Map<String, dynamic> json) {
  final FormSubmittedPageEntity formSubmittedPageEntity = FormSubmittedPageEntity();
  final int? count = jsonConvert.convert<int>(json['count']);
  if (count != null) {
    formSubmittedPageEntity.count = count;
  }
  final int? page = jsonConvert.convert<int>(json['page']);
  if (page != null) {
    formSubmittedPageEntity.page = page;
  }
  final int? limit = jsonConvert.convert<int>(json['limit']);
  if (limit != null) {
    formSubmittedPageEntity.limit = limit;
  }
  final int? countPage = jsonConvert.convert<int>(json['count_page']);
  if (countPage != null) {
    formSubmittedPageEntity.countPage = countPage;
  }
  final List<FormSubmittedEntity>? list = (json['list'] as List<dynamic>?)?.map(
          (e) => jsonConvert.convert<FormSubmittedEntity>(e) as FormSubmittedEntity).toList();
  if (list != null) {
    formSubmittedPageEntity.list = list;
  }
  return formSubmittedPageEntity;
}

Map<String, dynamic> $FormSubmittedPageEntityToJson(FormSubmittedPageEntity entity) {
  final Map<String, dynamic> data = <String, dynamic>{};
  data['count'] = entity.count;
  data['page'] = entity.page;
  data['limit'] = entity.limit;
  data['count_page'] = entity.countPage;
  data['list'] = entity.list?.map((v) => v.toJson()).toList();
  return data;
}

extension FormSubmittedPageEntityExtension on FormSubmittedPageEntity {
  FormSubmittedPageEntity copyWith({
    int? count,
    int? page,
    int? limit,
    int? countPage,
    List<FormSubmittedEntity>? list,
  }) {
    return FormSubmittedPageEntity()
      ..count = count ?? this.count
      ..page = page ?? this.page
      ..limit = limit ?? this.limit
      ..countPage = countPage ?? this.countPage
      ..list = list ?? this.list;
  }
}