Part.fromJson constructor

Part.fromJson(
  1. Object? j
)

Implementation

factory Part.fromJson(Object? j) {
  final json = j as Map<String, Object?>;
  return Part(
    text: switch (json['text']) {
      null => null,
      Object $1 => decodeString($1),
    },
    inlineData: switch (json['inlineData']) {
      null => null,
      Object $1 => Blob.fromJson($1),
    },
    functionCall: switch (json['functionCall']) {
      null => null,
      Object $1 => FunctionCall.fromJson($1),
    },
    functionResponse: switch (json['functionResponse']) {
      null => null,
      Object $1 => FunctionResponse.fromJson($1),
    },
    fileData: switch (json['fileData']) {
      null => null,
      Object $1 => FileData.fromJson($1),
    },
    executableCode: switch (json['executableCode']) {
      null => null,
      Object $1 => ExecutableCode.fromJson($1),
    },
    codeExecutionResult: switch (json['codeExecutionResult']) {
      null => null,
      Object $1 => CodeExecutionResult.fromJson($1),
    },
    videoMetadata: switch (json['videoMetadata']) {
      null => null,
      Object $1 => VideoMetadata.fromJson($1),
    },
    thought: switch (json['thought']) {
      null => false,
      Object $1 => decodeBool($1),
    },
    thoughtSignature: switch (json['thoughtSignature']) {
      null => Uint8List(0),
      Object $1 => decodeBytes($1),
    },
    partMetadata: switch (json['partMetadata']) {
      null => null,
      Object $1 => Struct.fromJson($1),
    },
  );
}