EndlessStreamingServiceV2.viaThirdPartyAuthenticator constructor

EndlessStreamingServiceV2.viaThirdPartyAuthenticator(
  1. ThirdPartyAuthenticator thirdPartyAuthenticator, {
  2. required String projectId,
  3. String? cloudSpeechEndpoint,
  4. String? location,
})

Creates a EndlessStreamingServiceV2 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 EndlessStreamingServiceV2.viaThirdPartyAuthenticator(
        ThirdPartyAuthenticator thirdPartyAuthenticator,
        {required String projectId,
        String? cloudSpeechEndpoint,
        String? location}) =>
    EndlessStreamingServiceV2._(thirdPartyAuthenticator.toCallOptions,
        projectId: projectId,
        cloudSpeechEndpoint: cloudSpeechEndpoint,
        location: location);