readStorageObject method

  1. @override
Future<StorageObject> readStorageObject({
  1. required Session session,
  2. String? collection,
  3. String? key,
  4. String? userId,
})
override

Implementation

@override
Future<StorageObject> readStorageObject({
  required model.Session session,
  String? collection,
  String? key,
  String? userId,
}) async {
  _session = session;

  final res = await _api.nakamaReadStorageObjects(
    body: ApiReadStorageObjectsRequest(
      objectIds: [
        ApiReadStorageObjectId(
          collection: collection,
          key: key,
          userId: userId,
        ),
      ],
    ),
  );

  final result = StorageObjects()..mergeFromProto3Json(res.body!.toJson());
  return result.objects.first;
}