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

AuthLoginEntity $AuthLoginEntityFromJson(Map<String, dynamic> json) {
  final AuthLoginEntity authLoginEntity = AuthLoginEntity();
  final String? name = jsonConvert.convert<String>(json['name']);
  if (name != null) {
    authLoginEntity.name = name;
  }
  final String? email = jsonConvert.convert<String>(json['email']);
  if (email != null) {
    authLoginEntity.email = email;
  }
  final String? token = jsonConvert.convert<String>(json['token']);
  if (token != null) {
    authLoginEntity.token = token;
  }
  return authLoginEntity;
}

Map<String, dynamic> $AuthLoginEntityToJson(AuthLoginEntity entity) {
  final Map<String, dynamic> data = <String, dynamic>{};
  data['name'] = entity.name;
  data['email'] = entity.email;
  data['token'] = entity.token;
  return data;
}

extension AuthLoginEntityExtension on AuthLoginEntity {
  AuthLoginEntity copyWith({
    String? name,
    String? email,
    String? token,
  }) {
    return AuthLoginEntity()
      ..name = name ?? this.name
      ..email = email ?? this.email
      ..token = token ?? this.token;
  }
}