RealtimeTranscriptionSessionCreateResponse.fromJson constructor
Creates a RealtimeTranscriptionSessionCreateResponse from JSON.
Implementation
factory RealtimeTranscriptionSessionCreateResponse.fromJson(
Map<String, dynamic> json,
) {
if (json['id'] == null ||
json['object'] == null ||
json['type'] == null ||
json['expires_at'] == null) {
throw const FormatException(
'RealtimeTranscriptionSessionCreateResponse.fromJson missing one or more '
'required fields (id, object, type, expires_at)',
);
}
return RealtimeTranscriptionSessionCreateResponse(
id: json['id'] as String,
object: json['object'] as String,
type: json['type'] as String,
expiresAt: json['expires_at'] as int,
audio: json['audio'] != null
? RealtimeTranscriptionSessionAudio.fromJson(
json['audio'] as Map<String, dynamic>,
)
: null,
include: (json['include'] as List<dynamic>?)?.cast<String>(),
);
}