@java.lang.Override
  public int getSerializedSize() {
    int size = memoizedSize;
    if (size != -1) return size;

    size = 0;
    {
      int dataSize = 0;
      for (int i = 0; i < tokens_.size(); i++) {
        dataSize += com.google.protobuf.CodedOutputStream.computeBytesSizeNoTag(tokens_.get(i));
      }
      size += dataSize;
      size += 1 * getTokensList().size();
    }
    {
      int dataSize = 0;
      for (int i = 0; i < tokenIds_.size(); i++) {
        dataSize +=
            com.google.protobuf.CodedOutputStream.computeInt64SizeNoTag(tokenIds_.getLong(i));
      }
      size += dataSize;
      if (!getTokenIdsList().isEmpty()) {
        size += 1;
        size += com.google.protobuf.CodedOutputStream.computeInt32SizeNoTag(dataSize);
      }
      tokenIdsMemoizedSerializedSize = dataSize;
    }
    if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(role_)) {
      size += com.google.protobuf.GeneratedMessageV3.computeStringSize(3, role_);
    }
    size += getUnknownFields().getSerializedSize();
    memoizedSize = size;
    return size;
  }
<pre>
Optional. Optional fields for the role from the corresponding Content.
</pre>

<code>string role = 3 [(.google.api.field_behavior) = OPTIONAL];</code>

@return The bytes for role.
java-vertexai/proto-google-cloud-vertexai-v1/src/main/java/com/google/cloud/vertexai/api/TokensInfo.java