RealtimeTranslationSessionCreatedEvent.fromJson constructor
Creates from JSON.
Implementation
factory RealtimeTranslationSessionCreatedEvent.fromJson(
Map<String, dynamic> json,
) {
if (json['type'] != 'session.created') {
throw FormatException(
'RealtimeTranslationSessionCreatedEvent.fromJson expected type '
'"session.created", got ${json['type']}',
);
}
return RealtimeTranslationSessionCreatedEvent(
eventId: json['event_id'] as String,
session: RealtimeTranslationSession.fromJson(
json['session'] as Map<String, dynamic>,
),
);
}