38 lines
867 B
Dart
38 lines
867 B
Dart
import 'package:json_annotation/json_annotation.dart';
|
|
|
|
import '../../../api_params.dart';
|
|
|
|
part 'get_chat_params.g.dart';
|
|
|
|
@JsonSerializable(explicitToJson: true, includeIfNull: false)
|
|
class GetChatParams extends ApiParams {
|
|
GetChatParamsSwitch lookIntoFuture;
|
|
int? limit;
|
|
int? lastKnownMessageId;
|
|
int? lastCommonReadId;
|
|
int? timeout;
|
|
GetChatParamsSwitch? setReadMarker;
|
|
GetChatParamsSwitch? includeLastKnown;
|
|
|
|
GetChatParams({
|
|
required this.lookIntoFuture,
|
|
this.limit,
|
|
this.lastKnownMessageId,
|
|
this.lastCommonReadId,
|
|
this.timeout,
|
|
this.setReadMarker,
|
|
this.includeLastKnown,
|
|
});
|
|
|
|
factory GetChatParams.fromJson(Map<String, dynamic> json) =>
|
|
_$GetChatParamsFromJson(json);
|
|
Map<String, dynamic> toJson() => _$GetChatParamsToJson(this);
|
|
}
|
|
|
|
enum GetChatParamsSwitch {
|
|
@JsonValue(1)
|
|
on,
|
|
@JsonValue(0)
|
|
off,
|
|
}
|