RealtimeTranslationClientSecretCreateResponse.fromJson constructor

RealtimeTranslationClientSecretCreateResponse.fromJson(
  1. Map<String, dynamic> json
)

Creates from JSON.

Implementation

factory RealtimeTranslationClientSecretCreateResponse.fromJson(
  Map<String, dynamic> json,
) {
  if (json['value'] == null ||
      json['expires_at'] == null ||
      json['session'] == null) {
    throw const FormatException(
      'RealtimeTranslationClientSecretCreateResponse.fromJson missing one or '
      'more required fields (value, expires_at, session)',
    );
  }
  return RealtimeTranslationClientSecretCreateResponse(
    value: json['value'] as String,
    expiresAt: json['expires_at'] as int,
    session: RealtimeTranslationSession.fromJson(
      json['session'] as Map<String, dynamic>,
    ),
  );
}