2024-09-16 18:14:23 +00:00
|
|
|
import 'package:json_annotation/json_annotation.dart';
|
2024-09-07 07:36:06 +00:00
|
|
|
|
|
|
|
part 'account_status.g.dart';
|
|
|
|
|
|
|
|
@JsonSerializable()
|
2024-06-26 16:31:03 +00:00
|
|
|
class AccountStatus {
|
|
|
|
bool isDisturbable;
|
|
|
|
bool isOnline;
|
|
|
|
DateTime? lastSeenAt;
|
2024-06-26 17:33:03 +00:00
|
|
|
Status? status;
|
2024-06-26 16:31:03 +00:00
|
|
|
|
|
|
|
AccountStatus({
|
|
|
|
required this.isDisturbable,
|
|
|
|
required this.isOnline,
|
|
|
|
required this.lastSeenAt,
|
|
|
|
required this.status,
|
|
|
|
});
|
|
|
|
|
2024-09-07 07:36:06 +00:00
|
|
|
factory AccountStatus.fromJson(Map<String, dynamic> json) =>
|
|
|
|
_$AccountStatusFromJson(json);
|
2024-06-26 16:31:03 +00:00
|
|
|
|
2024-09-07 07:36:06 +00:00
|
|
|
Map<String, dynamic> toJson() => _$AccountStatusToJson(this);
|
2024-06-26 17:33:03 +00:00
|
|
|
}
|
|
|
|
|
2024-09-07 07:36:06 +00:00
|
|
|
@JsonSerializable()
|
2024-06-26 17:33:03 +00:00
|
|
|
class Status {
|
|
|
|
int id;
|
|
|
|
DateTime createdAt;
|
|
|
|
DateTime updatedAt;
|
|
|
|
DateTime? deletedAt;
|
|
|
|
String type;
|
|
|
|
String label;
|
|
|
|
int attitude;
|
|
|
|
bool isNoDisturb;
|
|
|
|
bool isInvisible;
|
|
|
|
DateTime? clearAt;
|
|
|
|
int accountId;
|
|
|
|
|
|
|
|
Status({
|
|
|
|
required this.id,
|
|
|
|
required this.createdAt,
|
|
|
|
required this.updatedAt,
|
|
|
|
required this.deletedAt,
|
|
|
|
required this.type,
|
|
|
|
required this.label,
|
|
|
|
required this.attitude,
|
|
|
|
required this.isNoDisturb,
|
|
|
|
required this.isInvisible,
|
|
|
|
required this.clearAt,
|
|
|
|
required this.accountId,
|
|
|
|
});
|
|
|
|
|
2024-09-07 07:36:06 +00:00
|
|
|
factory Status.fromJson(Map<String, dynamic> json) => _$StatusFromJson(json);
|
2024-06-26 17:33:03 +00:00
|
|
|
|
2024-09-07 07:36:06 +00:00
|
|
|
Map<String, dynamic> toJson() => _$StatusToJson(this);
|
2024-06-26 16:31:03 +00:00
|
|
|
}
|