diff --git a/lib/src/generated/api.dart b/lib/src/generated/api.dart index 72d386f..d242181 100644 --- a/lib/src/generated/api.dart +++ b/lib/src/generated/api.dart @@ -98,10 +98,7 @@ class Api { /// [from] A pagination token from a previous result. If specified, `max_depth` and `suggested_only` cannot /// be changed from the first request. Future getSpaceHierarchy(String roomId, - {bool? suggestedOnly, - double? limit, - double? maxDepth, - String? from}) async { + {bool? suggestedOnly, int? limit, int? maxDepth, String? from}) async { final requestUri = Uri( path: '_matrix/client/v1/rooms/${Uri.encodeComponent(roomId)}/hierarchy', diff --git a/lib/src/generated/model.dart b/lib/src/generated/model.dart index db8cb05..1428c56 100644 --- a/lib/src/generated/model.dart +++ b/lib/src/generated/model.dart @@ -169,9 +169,10 @@ class SpaceRoomsChunkBase { SpaceRoomsChunkBase.fromJson(Map json) : childrenState = (json['children_state'] as List) - .map((v) => MatrixEvent.fromJson(v)) + .map((v) => MatrixEvent.fromJson((v as Map) + ..putIfAbsent('event_id', () => 'invalid'))) .toList(), - roomType = json['room_type'] as String; + roomType = json['room_type'] as String?; Map toJson() => { 'children_state': childrenState.map((v) => v.toJson()).toList(), 'room_type': roomType, @@ -184,7 +185,7 @@ class SpaceRoomsChunkBase { List childrenState; /// The `type` of room (from [`m.room.create`](https://spec.matrix.org/unstable/client-server-api/#mroomcreate)), if any. - String roomType; + String? roomType; } @_NameSource('rule override generated') @@ -216,9 +217,10 @@ class SpaceRoomsChunk implements PublicRoomsChunk, SpaceRoomsChunkBase { topic = ((v) => v != null ? v as String : null)(json['topic']), worldReadable = json['world_readable'] as bool, childrenState = (json['children_state'] as List) - .map((v) => MatrixEvent.fromJson(v)) + .map((v) => MatrixEvent.fromJson((v as Map) + ..putIfAbsent('event_id', () => 'invalid'))) .toList(), - roomType = json['room_type'] as String; + roomType = json['room_type'] as String?; Map toJson() { final avatarUrl = this.avatarUrl; final canonicalAlias = this.canonicalAlias; @@ -277,7 +279,7 @@ class SpaceRoomsChunk implements PublicRoomsChunk, SpaceRoomsChunkBase { List childrenState; /// The `type` of room (from [`m.room.create`](https://spec.matrix.org/unstable/client-server-api/#mroomcreate)), if any. - String roomType; + String? roomType; } @_NameSource('generated')