import 'package:freezed_annotation/freezed_annotation.dart'; part 'yandex_profile_model.freezed.dart'; part 'yandex_profile_model.g.dart'; @freezed abstract class YandexProfileModel with _$YandexProfileModel { factory YandexProfileModel({ required String id, required String login, required String birthday, @JsonKey(name: 'client_id') required String clientId, @JsonKey(name: 'display_name') required String displayName, @JsonKey(name: 'real_name') required String realName, @JsonKey(name: 'first_name') required String firstName, @JsonKey(name: 'last_name') required String lastName, @JsonKey(name: 'sex') required String sex, @JsonKey(name: 'default_email') required String defaultEmail, @JsonKey(name: 'default_phone') required YandexPhoneData defaultPhone, }) = _YandexProfileModel; factory YandexProfileModel.fromJson(Map json) => _$YandexProfileModelFromJson(json); } @freezed abstract class YandexPhoneData with _$YandexPhoneData { factory YandexPhoneData({required int id, required String number}) = _YandexPhoneData; factory YandexPhoneData.fromJson(Map json) => _$YandexPhoneDataFromJson(json); }