AugmentPromptRequest.fromJson constructor

AugmentPromptRequest.fromJson(
  1. Object? j
)

Implementation

factory AugmentPromptRequest.fromJson(Object? j) {
  final json = j as Map<String, Object?>;
  return AugmentPromptRequest(
    vertexRagStore: switch (json['vertexRagStore']) {
      null => null,
      Object $1 => VertexRagStore.fromJson($1),
    },
    parent: switch (json['parent']) {
      null => '',
      Object $1 => decodeString($1),
    },
    contents: switch (json['contents']) {
      null => [],
      List<Object?> $1 => [for (final i in $1) Content.fromJson(i)],
      _ => throw const FormatException('"contents" is not a list'),
    },
    model: switch (json['model']) {
      null => null,
      Object $1 => AugmentPromptRequest_Model.fromJson($1),
    },
  );
}