PregeneratedTokenCredential constructor

PregeneratedTokenCredential({
  1. required Uri uri,
  2. required TokenInfo tokenInfo,
  3. required String referer,
})

Creates an instance of a PregeneratedTokenCredential.

Parameters:

  • uri — The URL of the token-secured resource.
  • tokenInfo — The TokenInfo used to access secured resources.
  • referer — The referer that was used to generate the TokenInfo.

Implementation

factory PregeneratedTokenCredential({
  required Uri uri,
  required TokenInfo tokenInfo,
  required String referer,
}) {
  _initializeArcGISEnvironmentIfNeeded();
  final coreURI = _CString(uri.toString());
  final coreReferer = _CString(referer);
  final handle = _withThrowingErrorHandler((errorHandler) {
    return runtimecore.RT_PregeneratedTokenCredential_create(
      coreURI.bytes,
      tokenInfo._handle,
      coreReferer.bytes,
      errorHandler,
    );
  });
  final PregeneratedTokenCredential object =
      PregeneratedTokenCredential._withHandle(handle);
  object._tokenInfo.cache(tokenInfo);
  return object;
}