listGroupTMRTemporaryKeys method

SealdListedGroupTMRTemporaryKey listGroupTMRTemporaryKeys(
  1. String groupId, {
  2. int page = 1,
  3. bool all = false,
})

List group TMR temporary keys.

groupId The Id of the group for which to list TMR keys. page Page number to fetch. all Should list all pages after page. Returns a SealdListedGroupTMRTemporaryKey instance holding the found temporary keys.

Implementation

SealdListedGroupTMRTemporaryKey listGroupTMRTemporaryKeys(String groupId,
    {int page = 1, bool all = false}) {
  if (_closed) {
    throw SealdException(
        code: "INSTANCE_CLOSED",
        id: "FLUTTER_INSTANCE_CLOSED",
        description: "Instance already closed.");
  }
  final Pointer<Utf8> nativeGroupId = groupId.toNativeUtf8();
  final int allInt = all ? 1 : 0;

  final Pointer<Int> nbPageFound = calloc<Int>();
  final Pointer<Pointer<NativeSealdGroupTMRTemporaryKeysArray>> result =
      calloc<Pointer<NativeSealdGroupTMRTemporaryKeysArray>>();
  final Pointer<Pointer<NativeSealdError>> err =
      calloc<Pointer<NativeSealdError>>();

  final int resultCode = _bindings.SealdSdk_ListGroupTMRTemporaryKeys(
      _ptr.pointer(), nativeGroupId, page, allInt, nbPageFound, result, err);

  calloc.free(nativeGroupId);

  if (resultCode != 0) {
    calloc.free(result);
    throw SealdException._fromCPtr(err);
  } else {
    final SealdListedGroupTMRTemporaryKey gTMRtempKeys =
        SealdListedGroupTMRTemporaryKey._fromC(result.value, nbPageFound);
    calloc.free(result);
    calloc.free(nbPageFound);
    calloc.free(err);
    return gTMRtempKeys;
  }
}