BidiGenerateContentServerContent.fromJson constructor

BidiGenerateContentServerContent.fromJson(
  1. Object? j
)

Implementation

factory BidiGenerateContentServerContent.fromJson(Object? j) {
  final json = j as Map<String, Object?>;
  return BidiGenerateContentServerContent(
    modelTurn: switch (json['modelTurn']) {
      null => null,
      Object $1 => Content.fromJson($1),
    },
    generationComplete: switch (json['generationComplete']) {
      null => false,
      Object $1 => decodeBool($1),
    },
    turnComplete: switch (json['turnComplete']) {
      null => false,
      Object $1 => decodeBool($1),
    },
    interrupted: switch (json['interrupted']) {
      null => false,
      Object $1 => decodeBool($1),
    },
    groundingMetadata: switch (json['groundingMetadata']) {
      null => null,
      Object $1 => GroundingMetadata.fromJson($1),
    },
    inputTranscription: switch (json['inputTranscription']) {
      null => null,
      Object $1 => BidiGenerateContentTranscription.fromJson($1),
    },
    outputTranscription: switch (json['outputTranscription']) {
      null => null,
      Object $1 => BidiGenerateContentTranscription.fromJson($1),
    },
    urlContextMetadata: switch (json['urlContextMetadata']) {
      null => null,
      Object $1 => UrlContextMetadata.fromJson($1),
    },
    waitingForInput: switch (json['waitingForInput']) {
      null => false,
      Object $1 => decodeBool($1),
    },
  );
}