1@dmx('model', {'equality': false, 'toString': false})
2class Profile {
3 const Profile({required this.id});
4
5 final String id;
6
7 //#region
8 static Result<Profile, DecodeError> fromJson(Object? json, [String path = 'Profile']) =>
9 switch (json) {
10 {
11 'id': final String id,
12 } =>
13 Ok(Profile(
14 id: id,
15 )),
16 _ => Err(DecodeError(path, 'Profile', json)),
17 };
18
19 Map<String, dynamic> toJson() => <String, dynamic>{
20 'id': id,
21 };
22
23 Profile copyWith({
24 String? id,
25 }) =>
26 Profile(
27 id: id ?? this.id,
28 );
29 //#endregion
30}