BidiGenerateContentRealtimeInput.fromJson constructor

BidiGenerateContentRealtimeInput.fromJson(
  1. Object? j
)

Implementation

factory BidiGenerateContentRealtimeInput.fromJson(Object? j) {
  final json = j as Map<String, Object?>;
  return BidiGenerateContentRealtimeInput(
    mediaChunks: switch (json['mediaChunks']) {
      null => [],
      List<Object?> $1 => [for (final i in $1) Blob.fromJson(i)],
      _ => throw const FormatException('"mediaChunks" is not a list'),
    },
    audio: switch (json['audio']) {
      null => null,
      Object $1 => Blob.fromJson($1),
    },
    audioStreamEnd: switch (json['audioStreamEnd']) {
      null => null,
      Object $1 => decodeBool($1),
    },
    video: switch (json['video']) {
      null => null,
      Object $1 => Blob.fromJson($1),
    },
    text: switch (json['text']) {
      null => null,
      Object $1 => decodeString($1),
    },
    activityStart: switch (json['activityStart']) {
      null => null,
      Object $1 => BidiGenerateContentRealtimeInput_ActivityStart.fromJson(
        $1,
      ),
    },
    activityEnd: switch (json['activityEnd']) {
      null => null,
      Object $1 => BidiGenerateContentRealtimeInput_ActivityEnd.fromJson($1),
    },
  );
}