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

RewardsHomeTestEntity $RewardsHomeTestEntityFromJson(Map<String, dynamic> json) {
  final RewardsHomeTestEntity rewardsHomeTestEntity = RewardsHomeTestEntity();
  final int? id = jsonConvert.convert<int>(json['id']);
  if (id != null) {
    rewardsHomeTestEntity.id = id;
  }
  final String? name = jsonConvert.convert<String>(json['name']);
  if (name != null) {
    rewardsHomeTestEntity.name = name;
  }
  final List<dynamic>? rewards = (json['rewards'] as List<dynamic>?)?.map(
          (e) => e).toList();
  if (rewards != null) {
    rewardsHomeTestEntity.rewards = rewards;
  }
  return rewardsHomeTestEntity;
}

Map<String, dynamic> $RewardsHomeTestEntityToJson(RewardsHomeTestEntity entity) {
  final Map<String, dynamic> data = <String, dynamic>{};
  data['id'] = entity.id;
  data['name'] = entity.name;
  data['rewards'] = entity.rewards;
  return data;
}

extension RewardsHomeTestEntityExtension on RewardsHomeTestEntity {
  RewardsHomeTestEntity copyWith({
    int? id,
    String? name,
    List<dynamic>? rewards,
  }) {
    return RewardsHomeTestEntity()
      ..id = id ?? this.id
      ..name = name ?? this.name
      ..rewards = rewards ?? this.rewards;
  }
}