SpeechToTextV2.viaToken constructor

SpeechToTextV2.viaToken(
  1. String typeToken,
  2. String token, {
  3. required String projectId,
  4. String? cloudSpeechEndpoint,
  5. Map<String, String>? metadata,
})

Creates a SpeechToTextV2 interface using a token. You are responsible for updating the token when it expires.

Implementation

factory SpeechToTextV2.viaToken(
  String typeToken,
  String token, {
  required String projectId,
  String? cloudSpeechEndpoint,
  Map<String, String>? metadata,
}) =>
    SpeechToTextV2._(
        CallOptions(metadata: {
          'authorization': '$typeToken $token',
          ...?metadata,
        }),
        projectId: projectId,
        cloudSpeechEndpoint: cloudSpeechEndpoint);