dart format
This commit is contained in:
@@ -12,10 +12,15 @@ class GetParticipants extends TalkApi<GetParticipantsResponse> {
|
||||
@override
|
||||
GetParticipantsResponse assemble(String raw) {
|
||||
final decoded = jsonDecode(raw) as Map<String, dynamic>;
|
||||
return GetParticipantsResponse.fromJson(decoded['ocs'] as Map<String, dynamic>);
|
||||
return GetParticipantsResponse.fromJson(
|
||||
decoded['ocs'] as Map<String, dynamic>,
|
||||
);
|
||||
}
|
||||
|
||||
@override
|
||||
Future<http.Response> request(Uri uri, Object? body, Map<String, String>? headers) => http.get(uri, headers: headers);
|
||||
|
||||
Future<http.Response> request(
|
||||
Uri uri,
|
||||
Object? body,
|
||||
Map<String, String>? headers,
|
||||
) => http.get(uri, headers: headers);
|
||||
}
|
||||
|
||||
@@ -7,11 +7,11 @@ class GetParticipantsCache extends SimpleCache<GetParticipantsResponse> {
|
||||
required void Function(GetParticipantsResponse) onUpdate,
|
||||
required String chatToken,
|
||||
}) : super(
|
||||
cacheTime: RequestCache.cacheNothing,
|
||||
loader: () => GetParticipants(chatToken).run(),
|
||||
fromJson: GetParticipantsResponse.fromJson,
|
||||
onUpdate: onUpdate,
|
||||
) {
|
||||
cacheTime: RequestCache.cacheNothing,
|
||||
loader: () => GetParticipants(chatToken).run(),
|
||||
fromJson: GetParticipantsResponse.fromJson,
|
||||
onUpdate: onUpdate,
|
||||
) {
|
||||
start('nc-chat-participants-$chatToken');
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,4 +1,3 @@
|
||||
|
||||
import 'package:json_annotation/json_annotation.dart';
|
||||
|
||||
import '../../../api_response.dart';
|
||||
@@ -11,7 +10,8 @@ class GetParticipantsResponse extends ApiResponse {
|
||||
|
||||
GetParticipantsResponse(this.data);
|
||||
|
||||
factory GetParticipantsResponse.fromJson(Map<String, dynamic> json) => _$GetParticipantsResponseFromJson(json);
|
||||
factory GetParticipantsResponse.fromJson(Map<String, dynamic> json) =>
|
||||
_$GetParticipantsResponseFromJson(json);
|
||||
Map<String, dynamic> toJson() => _$GetParticipantsResponseToJson(this);
|
||||
}
|
||||
|
||||
@@ -34,42 +34,55 @@ class GetParticipantsResponseObject {
|
||||
String? roomToken;
|
||||
|
||||
GetParticipantsResponseObject(
|
||||
this.attendeeId,
|
||||
this.actorType,
|
||||
this.actorId,
|
||||
this.displayName,
|
||||
this.participantType,
|
||||
this.lastPing,
|
||||
this.inCall,
|
||||
this.permissions,
|
||||
this.attendeePermissions,
|
||||
this.sessionId,
|
||||
this.sessionIds,
|
||||
this.status,
|
||||
this.statusIcon,
|
||||
this.statusMessage,
|
||||
this.roomToken);
|
||||
this.attendeeId,
|
||||
this.actorType,
|
||||
this.actorId,
|
||||
this.displayName,
|
||||
this.participantType,
|
||||
this.lastPing,
|
||||
this.inCall,
|
||||
this.permissions,
|
||||
this.attendeePermissions,
|
||||
this.sessionId,
|
||||
this.sessionIds,
|
||||
this.status,
|
||||
this.statusIcon,
|
||||
this.statusMessage,
|
||||
this.roomToken,
|
||||
);
|
||||
|
||||
factory GetParticipantsResponseObject.fromJson(Map<String, dynamic> json) => _$GetParticipantsResponseObjectFromJson(json);
|
||||
factory GetParticipantsResponseObject.fromJson(Map<String, dynamic> json) =>
|
||||
_$GetParticipantsResponseObjectFromJson(json);
|
||||
Map<String, dynamic> toJson() => _$GetParticipantsResponseObjectToJson(this);
|
||||
}
|
||||
|
||||
enum GetParticipantsResponseObjectParticipantType {
|
||||
@JsonValue(1) owner('Besitzer'),
|
||||
@JsonValue(2) moderator('Moderator'),
|
||||
@JsonValue(3) user('Teilnehmer'),
|
||||
@JsonValue(4) guest('Gast'),
|
||||
@JsonValue(5) userFollowingPublicLink('Teilnehmer über Link'),
|
||||
@JsonValue(6) guestWithModeratorPermissions('Gast Moderator');
|
||||
@JsonValue(1)
|
||||
owner('Besitzer'),
|
||||
@JsonValue(2)
|
||||
moderator('Moderator'),
|
||||
@JsonValue(3)
|
||||
user('Teilnehmer'),
|
||||
@JsonValue(4)
|
||||
guest('Gast'),
|
||||
@JsonValue(5)
|
||||
userFollowingPublicLink('Teilnehmer über Link'),
|
||||
@JsonValue(6)
|
||||
guestWithModeratorPermissions('Gast Moderator');
|
||||
|
||||
const GetParticipantsResponseObjectParticipantType(this.prettyName);
|
||||
final String prettyName;
|
||||
}
|
||||
|
||||
enum GetParticipantsResponseObjectParticipantsInCallFlags {
|
||||
@JsonValue(0) disconnected,
|
||||
@JsonValue(1) inCall,
|
||||
@JsonValue(2) providesAudio,
|
||||
@JsonValue(3) providesVideo,
|
||||
@JsonValue(4) usesSipDialIn
|
||||
@JsonValue(0)
|
||||
disconnected,
|
||||
@JsonValue(1)
|
||||
inCall,
|
||||
@JsonValue(2)
|
||||
providesAudio,
|
||||
@JsonValue(3)
|
||||
providesVideo,
|
||||
@JsonValue(4)
|
||||
usesSipDialIn,
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user