GenerateVideoResponse.fromJson constructor

GenerateVideoResponse.fromJson(
  1. Object? j
)

Implementation

factory GenerateVideoResponse.fromJson(Object? j) {
  final json = j as Map<String, Object?>;
  return GenerateVideoResponse(
    generatedSamples: switch (json['generatedSamples']) {
      null => [],
      List<Object?> $1 => [for (final i in $1) decodeString(i)],
      _ => throw const FormatException('"generatedSamples" is not a list'),
    },
    raiMediaFilteredCount: switch (json['raiMediaFilteredCount']) {
      null => null,
      Object $1 => decodeInt($1),
    },
    raiMediaFilteredReasons: switch (json['raiMediaFilteredReasons']) {
      null => [],
      List<Object?> $1 => [for (final i in $1) decodeString(i)],
      _ => throw const FormatException(
        '"raiMediaFilteredReasons" is not a list',
      ),
    },
  );
}