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

CaptchaImgEntity $CaptchaImgEntityFromJson(Map<String, dynamic> json) {
  final CaptchaImgEntity captchaImgEntity = CaptchaImgEntity();
  final bool? sensitive = jsonConvert.convert<bool>(json['sensitive']);
  if (sensitive != null) {
    captchaImgEntity.sensitive = sensitive;
  }
  final String? key = jsonConvert.convert<String>(json['key']);
  if (key != null) {
    captchaImgEntity.key = key;
  }
  final String? img = jsonConvert.convert<String>(json['img']);
  if (img != null) {
    captchaImgEntity.img = img;
  }
  return captchaImgEntity;
}

Map<String, dynamic> $CaptchaImgEntityToJson(CaptchaImgEntity entity) {
  final Map<String, dynamic> data = <String, dynamic>{};
  data['sensitive'] = entity.sensitive;
  data['key'] = entity.key;
  data['img'] = entity.img;
  return data;
}

extension CaptchaImgEntityExtension on CaptchaImgEntity {
  CaptchaImgEntity copyWith({
    bool? sensitive,
    String? key,
    String? img,
  }) {
    return CaptchaImgEntity()
      ..sensitive = sensitive ?? this.sensitive
      ..key = key ?? this.key
      ..img = img ?? this.img;
  }
}