content property

The content of the message.

The schema allows one block or a list of them under content, and both read as a list here. One block comes back as a single-element list.

Implementation

List<SamplingMessageContentBlock> get content {
  final content = _value[Keys.content];
  if (content == null) {
    throw ArgumentError('Missing ${Keys.content} field in $SamplingMessage.');
  }
  if (content is List) {
    return content.cast<SamplingMessageContentBlock>();
  }
  return [content as SamplingMessageContentBlock];
}