SpeechToTextV2.viaThirdPartyAuthenticator constructor
SpeechToTextV2.viaThirdPartyAuthenticator(})
Creates a SpeechToTextV2 interface using a third party authenticator. Don't worry about updating the access token, the package does it automatically. Example: final SpeechToTextV2 = SpeechToTextV2.viaThirdPartyAuthenticator( ThirdPartyAuthenticator( obtainCredentialsFromThirdParty: () async { // request api to get token final json = await requestCredentialFromMyApi(); return AccessCredentials.fromJson(json); }, ), );
Implementation
factory SpeechToTextV2.viaThirdPartyAuthenticator(
ThirdPartyAuthenticator thirdPartyAuthenticator, {
required String projectId,
String? cloudSpeechEndpoint,
Map<String, String>? metadata,
}) =>
SpeechToTextV2._(
thirdPartyAuthenticator.toCallOptions
.mergedWith(CallOptions(metadata: metadata ?? {})),
projectId: projectId,
cloudSpeechEndpoint: cloudSpeechEndpoint);